From gerrit-no-reply at lists.osmocom.org Thu Jun 1 08:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 08:20:48 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 1 08:22:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 08:22:48 +0000 Subject: osmo-bts[master]: measurement: Fix measurement reporting period tables In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Having reference to the spec which explains why this correction is correct and previous was wrong would be nice. https://gerrit.osmocom.org/#/c/2795/1/src/common/measurement.c File src/common/measurement.c: Line 39: /* Added (-2) offset in DATA-IND frame number to align with Meas period ends */ You should correct or remove this comment so it matches the code below. -- To view, visit https://gerrit.osmocom.org/2795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e0fdf081e0e28bed7d2b04f47ebc26bd2b94658 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 Thu Jun 1 08:27:14 2017 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Thu, 1 Jun 2017 08:27:14 +0000 Subject: [PATCH] osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support Message-ID: Review at https://gerrit.osmocom.org/2817 adding dmo support Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 --- M AUTHORS M src/conv_enc_test.c M src/lower_mac/tetra_lower_mac.c M src/lower_mac/tetra_scramb.c M src/lower_mac/tetra_scramb.h M src/phy/tetra_burst.c M src/phy/tetra_burst_sync.c M src/phy/tetra_burst_sync.h M src/tetra-rx.c M src/tetra_common.h M src/tetra_gsmtap.c 11 files changed, 465 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/17/2817/1 diff --git a/AUTHORS b/AUTHORS index a0c987b..7702664 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,5 @@ Harald Welte Sylvain Munaut Holger Hans Peter Freyther +Jan-Pascal Kwiotek +Jannik J?rgens diff --git a/src/conv_enc_test.c b/src/conv_enc_test.c index 303ef31..e714ec6 100644 --- a/src/conv_enc_test.c +++ b/src/conv_enc_test.c @@ -49,6 +49,11 @@ { } +/* incoming DP-SAP UNITDATA.ind from PHY into lower MAC */ +void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv) +{ +} + static void decode_schf(const uint8_t *bits) { uint8_t type4[1024]; diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c index 53fe73a..040de7b 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -103,6 +103,38 @@ .type2_bits = 30, .type1_bits = 14, }, + [DPSAP_SCH_S] = { //DMO Synchronization Burst Block 1 + .name = "SCH/S", + .type345_bits = 120, + .type2_bits = 80, + .type1_bits = 60, + .interleave_a = 11, + .have_crc16 = 1, + }, + [DPSAP_SCH_H] = { //DMO Synchronization Burst Block 2 + .name = "SCH/H", + .type345_bits = 216, + .type2_bits = 144, + .type1_bits = 124, + .interleave_a = 101, + .have_crc16 = 1, + }, + [DPSAP_SCH_F] = { //DMO Normal Burst Block 1+2 + .name = "SCH/F", + .type345_bits = 432, + .type2_bits = 288, + .type1_bits = 268, + .interleave_a = 103, + .have_crc16 = 1, + }, + [DPSAP_STCH] = { //DMO Normal Burst with Slot Flag + .name = "STCH", + .type345_bits = 216, + .type2_bits = 144, + .type1_bits = 124, + .interleave_a = 101, + .have_crc16 = 1, + }, }; struct tetra_cell_data { @@ -112,6 +144,7 @@ struct tetra_tdma_time time; uint32_t scramb_init; + uint32_t textmessage_length; }; static struct tetra_cell_data _tcd, *tcd = &_tcd; @@ -151,6 +184,7 @@ uint8_t type3dp[512*4]; uint8_t type3[512]; uint8_t type2[512]; + uint8_t frag_offset; // for variable fields in DPSAP_SCH_H const struct tetra_blk_param *tbp = &tetra_blk_param[type]; struct tetra_mac_state *tms = priv; @@ -181,7 +215,7 @@ /* De-scramble, pay special attention to SB1 pre-defined scrambling */ memcpy(type4, bits, tbp->type345_bits); - if (type == TPSAP_T_SB1) { + if (type == TPSAP_T_SB1 || type == DPSAP_SCH_S || type == DPSAP_SCH_H) { tetra_scramb_bits(SCRAMB_INIT, type4, tbp->type345_bits); tup->scrambling_code = SCRAMB_INIT; } else { @@ -235,7 +269,7 @@ printf("MN %s(%2u) ", osmo_ubit_dump(type2+17, 6), bits_to_uint(type2+17, 6)); printf("MCC %s(%u) ", osmo_ubit_dump(type2+31, 10), bits_to_uint(type2+31, 10)); printf("MNC %s(%u)\n", osmo_ubit_dump(type2+41, 14), bits_to_uint(type2+41, 14)); - /* obtain information from SYNC PDU */ + /* obtain information from SYNC PDU - 21.4.4.2 */ tcd->colour_code = bits_to_uint(type2+4, 6); tcd->time.tn = bits_to_uint(type2+10, 2); tcd->time.fn = bits_to_uint(type2+12, 5); @@ -296,6 +330,295 @@ } /* sq5bpf: koniec */ break; + case DPSAP_SCH_F: + /* 396-3 9.2 */ + if (bits_to_uint(type2, 2) == 0) { + printf("MAC PDU type: DMAC-DATA PDU %s(%2u) ", osmo_ubit_dump(type2, 2), bits_to_uint(type2, 2)); + + } else if(bits_to_uint(type2, 2) == 3) { + printf("MAC PDU type: DMAC-U-Signal PDU %s(%2u) ", osmo_ubit_dump(type2, 2), bits_to_uint(type2, 2)); + } else if(bits_to_uint(type2, 2) == 1) { + if(bits_to_uint(type2+2, 1) == 0) { + printf("MAC PDU type: DMAC-FRAG PDU %s(%2u) ", osmo_ubit_dump(type2, 2), bits_to_uint(type2, 2)); + } else { + printf("MAC PDU type: DMAC-END PDU %s(%2u) ", + osmo_ubit_dump(type2, 2), bits_to_uint(type2, 2)); + printf("MAC PDU subtype: %s(%2u) ", + osmo_ubit_dump(type2 + 2, 1), + bits_to_uint(type2 + 2, 1)); + /* 392-2 29.4.2.4 and 29.5.2.3 */ + printf("Protocol identifier: %s(%2u) ", + osmo_ubit_dump(type2 + 4, 8), + bits_to_uint(type2 + 4, 8)); + printf("Message type: %s(%2u) ", osmo_ubit_dump(type2 + 12, 4), + bits_to_uint(type2 + 12, 4)); + if (bits_to_uint(type2 + 12, 4) == 0) { + /* SDS TRANSFER */ + printf("Delivery report request: %s(%2u) ", + osmo_ubit_dump(type2 + 16, 2), + bits_to_uint(type2 + 16, 2)); + printf("Encoding: %s(%2u) ", osmo_ubit_dump(type2 + 28, 7), + bits_to_uint(type2 + 28, 7)); + printf("Message: "); + int i = 0; + while (i + 28 + 7 < tcd->textmessage_length) { + char message = bits_to_uint(type2 + 28 + 7 + i, 8); + printf("%c", message); + i += 8; + if (i + 28 + 7 > 29 * 8) + break; + } + } + } + } + printf("\n"); + tup->lchan = TETRA_LC_DMO_SCH_F; /* FIXME: Implement LC DMO Channel */ + break; + case DPSAP_SCH_S: + /* 396-3 9.1.1 Table 21 */ + printf(" System code: %s(%2u)", osmo_ubit_dump(type2, 4), + bits_to_uint(type2, 4)); + printf(" PDU type: %s(%u)", osmo_ubit_dump(type2 + 4, 2), + bits_to_uint(type2 + 4, 2)); + printf(" Comm type: %s(%u)", osmo_ubit_dump(type2 + 6, 2), + bits_to_uint(type2 + 6, 2)); + printf(" AB Channel: %s(%u)", osmo_ubit_dump(type2 + 10, 2), + bits_to_uint(type2 + 10, 2)); + printf(" Slot Num: %s(%u)", osmo_ubit_dump(type2 + 12, 2), + bits_to_uint(type2 + 12, 2)); + printf(" FN: %s(%u)", osmo_ubit_dump(type2 + 14, 5), + bits_to_uint(type2 + 14, 5)); + printf(" Encr: %s(%u)", osmo_ubit_dump(type2 + 19, 2), + bits_to_uint(type2 + 19, 2)); + printf("\n"); + + /* obtain information from SYNC PDU - 21.4.4.2 */ + tcd->time.tn = bits_to_uint(type2+12, 2); + tcd->time.fn = bits_to_uint(type2+14, 5); + + /* update the PHY layer time */ + memcpy(&t_phy_state.time, &tcd->time, sizeof(t_phy_state.time)); + + tup->lchan = TETRA_LC_DMO_SCH_S; /* FIXME: Implement LC DMO Channel */ + break; + case DPSAP_SCH_H: + /* 396-3 9.1.1 Table 22 */ + frag_offset = 0; + uint8_t scrambling[32]; + + printf(" Fill bit: %s(%u)", osmo_ubit_dump(type2 + 10, 1), + bits_to_uint(type2 + 10, 1)); + printf(" Frag flag: %s(%u)", osmo_ubit_dump(type2 + 11, 1), + bits_to_uint(type2 + 11, 1)); + + if (bits_to_uint(type2 + 11, 1) == 1) { + frag_offset = 4; + printf(" Num of SCH/F: %s(%2u)", osmo_ubit_dump(type2 + 12, 4), + bits_to_uint(type2 + 12, 4)); + } + printf(" Frame countdown: %s(%2u)", + osmo_ubit_dump(type2 + 12 + frag_offset, 2), + bits_to_uint(type2 + 12 + frag_offset, 2)); + printf("\n"); + + printf(" Dest Addr Type: %s(%2u)", + osmo_ubit_dump(type2 + 14 + frag_offset, 2), + bits_to_uint(type2 + 14 + frag_offset, 2)); + printf(" Dest Addr: %s(%2u)", + osmo_ubit_dump(type2 + 16 + frag_offset, 24), + bits_to_uint(type2 + 16 + frag_offset, 24)); + printf("\n"); + + printf(" Src Addr Type: %s(%2u)", + osmo_ubit_dump(type2 + 40 + frag_offset, 2), + bits_to_uint(type2 + 40 + frag_offset, 2)); + printf(" Src addr: %s(%2u)", + osmo_ubit_dump(type2 + 42 + frag_offset, 24), + bits_to_uint(type2 + 42 + frag_offset, 24)); + printf("\n"); + printf(" MNI: %s(%2u)", osmo_ubit_dump(type2 + 66 + frag_offset, 24), + bits_to_uint(type2 + 66 + frag_offset, 24)); + printf(" Message Type: %s(%2u)", + osmo_ubit_dump(type2 + 90 + frag_offset, 5), + bits_to_uint(type2 + 90 + frag_offset, 5)); + printf("\n"); + uint8_t mess_type = bits_to_uint(type2 + 90 + frag_offset, 5); + + memcpy(scrambling, type2 + 66 + frag_offset + 18, 6); // last 6 of mni + memcpy(scrambling + 6, type2 + 42 + frag_offset, 24); // src addr + uint32_t scramb_init1 = bits_to_uint(scrambling, 32); + scramb_init1 = scramb_init1 | 3; // last 2 bits have to be 1 + + printf("scrambling seq: %s %u\n", osmo_ubit_dump(scrambling, 32), + scramb_init1); + tcd->scramb_init = scramb_init1; + + printf("\n"); + switch (mess_type) { + case 8: + printf("DM-SETUP PDU:: Timing flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset, 1)); + printf(" LCH in frame 3 flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 1, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 1, 1)); + printf(" Pre-emption flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 2, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 2, 1)); + printf("\n"); + printf("Power class: %s(%2u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 3, 3), + bits_to_uint(type2 + 90 + 5 + frag_offset + 3, 3)); + printf(" Power control flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 6, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 6, 1)); + printf(" Dual watch synchronization flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 9, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 9, 1)); + printf("\n"); + printf("Two-frequency call flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 10, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 10, 1)); + printf(" Circuit mode type: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 11, 4), + bits_to_uint(type2 + 90 + 5 + frag_offset + 11, 4)); + printf(" Priority level: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 19, 2), + bits_to_uint(type2 + 90 + 5 + frag_offset + 19, 2)); + printf("\n"); + printf("DM-SDU elements:: End-to-end encryption flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21, 1)); + printf(" Call type flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21 + 1, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21 +1, 1)); + printf(" External source flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21 + 2, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21 + 2, 1)); + break; + case 9: + printf("DM-SETUP PRES PDU:: Power class: %s(%2u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 3, 3), + bits_to_uint(type2 + 90 + 5 + frag_offset + 3, 3)); + printf(" Power control flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 6, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 6, 1)); + printf(" Dual watch synchronization flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 9, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 9, 1)); + printf("\n"); + printf("Two-frequency call flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 10, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 10, 1)); + printf(" Circuit mode type: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 11, 4), + bits_to_uint(type2 + 90 + 5 + frag_offset + 11, 4)); + printf(" Priority level: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 19, 2), + bits_to_uint(type2 + 90 + 5 + frag_offset + 19, 2)); + printf("\n"); + printf("DM-SDU elements:: Ent-to-end encryption flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21, 1)); + printf(" Call type flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 22, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 22, 1)); + printf(" External source flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 23, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 23, 1)); + break; + case 10: + printf("DM-CONNECT PDU:: Circuit mode type: %s(%2u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset, 4), + bits_to_uint(type2 + 90 + 5 + frag_offset, 4)); + break; + case 12: + printf("DM-CONNECT ACK PDU:: Timing flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset, 1)); + printf(" LCH in frame 3 flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 1, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 1, 1)); + printf(" Pre-emption flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 2, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 2, 1)); + printf("\n"); + printf("Power class: %s(%2u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 3, 3), + bits_to_uint(type2 + 90 + 5 + frag_offset + 3, 3)); + printf(" Power control flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 6, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 6, 1)); + printf(" Dual watch synchronization flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 9, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 9, 1)); + printf("\n"); + printf("Two-frequency call flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 10, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 10, 1)); + printf(" Circuit mode type: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 11, 4), + bits_to_uint(type2 + 90 + 5 + frag_offset + 11, 4)); + printf(" Priority level: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 19, 2), + bits_to_uint(type2 + 90 + 5 + frag_offset + 19, 2)); + printf("\n"); + printf("DM-SDU elements:: End-to-end encryption flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21, 1)); + printf(" Call type flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21 + 1, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21 +1, 1)); + printf(" External source flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 21 + 2, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 21 + 2, 1)); + break; + case 22: + printf("DM-SDS UDATA PDU:: SDS time remaining: %s(%2u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset, 4), + bits_to_uint(type2 + 90 + 5 + frag_offset, 4)); + printf(" DMSDS transaction type: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 4, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 4, 1)); + printf(" Priority level: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 4 + 1, 2), + bits_to_uint(type2 + 90 + 5 + frag_offset + 4 + 1, 2)); + printf("\n"); + printf(" FCS flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 4 + 1 + 2, 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 4 + 1 + 2, 1)); + printf(" Additional addressing flag: %s(%u)", + osmo_ubit_dump(type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1, + 1), + bits_to_uint(type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1, + 1)); + printf(" Short Data Type Identifier: %s(%u)", + osmo_ubit_dump( + type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1 + 1, + 4), + bits_to_uint( + type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1 + 1, + 4)); + printf("\n"); + printf(" Length indicator: %s(%u)", + osmo_ubit_dump( + type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1 + 1 + + 4, 11), + bits_to_uint( + type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1 + 1 + + 4, 11)); + + tcd->textmessage_length = bits_to_uint( + type2 + 90 + 5 + frag_offset + 4 + 1 + 2 + 1 + 1 + 4, 11); + break; + default: + printf("Message type is not implemented"); + break; + } + printf("\n"); + //printBits(32,tcd->scramb_init); + tup->lchan = TETRA_LC_DMO_SCH_H; /* FIXME: Implement LC DMO Channel */ + break; default: /* FIXME: do something */ break; @@ -306,4 +629,9 @@ upper_mac_prim_recv(&ttp->oph, tms); } - +/* incoming DP-SAP UNITDATA.ind from PHY into lower MAC */ +void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv) +{ + /* call TMO Physical Layer SAP because the code is almost identical */ + tp_sap_udata_ind(type, bits, len, priv); +} diff --git a/src/lower_mac/tetra_scramb.c b/src/lower_mac/tetra_scramb.c index c83165a..f35123b 100644 --- a/src/lower_mac/tetra_scramb.c +++ b/src/lower_mac/tetra_scramb.c @@ -20,6 +20,7 @@ * */ +#include #include #include @@ -30,6 +31,9 @@ #define GL(x) (1<<(x-1)) #define GALOIS_LFSR (GL(32)|GL(26)|GL(23)|GL(22)|GL(16)|GL(12)|GL(11)|GL(10)|GL(8)|GL(7)|GL(5)|GL(4)|GL(2)|GL(1)) +#define SCRAMB_INIT 3 +#define SCRAMB_ZERO 0 + #if 1 static uint8_t next_lfsr_bit(uint32_t *lf) { diff --git a/src/lower_mac/tetra_scramb.h b/src/lower_mac/tetra_scramb.h index 9729ac2..534563a 100644 --- a/src/lower_mac/tetra_scramb.h +++ b/src/lower_mac/tetra_scramb.h @@ -12,8 +12,10 @@ * p(k) = 1 for k = -31, -30 */ #define SCRAMB_INIT 3 +#define SCRAMB_ZERO 0 uint32_t tetra_scramb_get_init(uint16_t mcc, uint16_t mnc, uint8_t colour); +uint32_t tetra_scramb_get_init_dmo(uint8_t mni, uint32_t src); int tetra_scramb_get_bits(uint32_t lfsr_init, uint8_t *out, int len); diff --git a/src/phy/tetra_burst.c b/src/phy/tetra_burst.c index 62efb72..8654b4c 100644 --- a/src/phy/tetra_burst.c +++ b/src/phy/tetra_burst.c @@ -31,6 +31,7 @@ #define SB_BLK1_OFFSET ((6+1+40)*DQPSK4_BITS_PER_SYM) #define SB_BBK_OFFSET ((6+1+40+60+19)*DQPSK4_BITS_PER_SYM) #define SB_BLK2_OFFSET ((6+1+40+60+19+15)*DQPSK4_BITS_PER_SYM) +#define SB_BLK2_DMO_OFFSET ((6+1+40+60+19)*DQPSK4_BITS_PER_SYM) #define SB_BLK1_BITS (60*DQPSK4_BITS_PER_SYM) #define SB_BBK_BITS (15*DQPSK4_BITS_PER_SYM) @@ -46,6 +47,10 @@ #define NDB_BLK_BITS (108*DQPSK4_BITS_PER_SYM) #define NDB_BBK_BITS SB_BBK_BITS +#define DNB_BLK_BITS (108*DQPSK4_BITS_PER_SYM) + +#define DNB_BLK1_OFFSET ((6+1)*DQPSK4_BITS_PER_SYM) +#define DNB_BLK2_OFFSET ((6+1+108+11)*DQPSK4_BITS_PER_SYM) /* 9.4.4.3.1 Frequency Correction Field */ static const uint8_t f_bits[80] = { @@ -55,7 +60,12 @@ [72] = 1, [73] = 1, [74] = 1, [75] = 1, [76] = 1, [77] = 1, [78] = 1, [79] = 1 }; -/* 9.4.4.3.2 Normal Training Sequence */ +/* 9.4.3.3.3 DMO Radio Aspects preambe */ +static const uint8_t dmo_pre1_bits[12] = { 0,0,1,1,0,0,1,0,0,0,1,1 }; +static const uint8_t dmo_pre2_bits[12] = { 1,0,0,1,1,0,1,0,1,0,0,1 }; +static const uint8_t dmo_pre3_bits[12] = { 0,0,0,1,0,1,0,0,0,1,1,1 }; + +/* 9.4.4.3.2 Normal Training Sequence (first and second are also for DMO - 9.4.3.3.3 */ static const uint8_t n_bits[22] = { 1,1, 0,1, 0,0, 0,0, 1,1, 1,0, 1,0, 0,1, 1,1, 0,1, 0,0 }; static const uint8_t p_bits[22] = { 0,1, 1,1, 1,0, 1,0, 0,1, 0,0, 0,0, 1,1, 0,1, 1,1, 1,0 }; static const uint8_t q_bits[22] = { 1,0, 1,1, 0,1, 1,1, 0,0, 0,0, 0,1, 1,0, 1,0, 1,1, 0,1 }; @@ -66,7 +76,7 @@ static const uint8_t x_bits[30] = { 1,0, 0,1, 1,1, 0,1, 0,0, 0,0, 1,1, 1,0, 1,0, 0,1, 1,1, 0,1, 0,0, 0,0, 1,1 }; static const uint8_t X_bits[45] = { 0,1,1,1,0,0,1,1,0,1,0,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,1,0 }; -/* 9.4.4.3.4 Synchronization training sequence */ +/* 9.4.4.3.4 Synchronization training sequence (also for DMO - 9.4.3.3.4) */ static const uint8_t y_bits[38] = { 1,1, 0,0, 0,0, 0,1, 1,0, 0,1, 1,1, 0,0, 1,1, 1,0, 1,0, 0,1, 1,1, 0,0, 0,0, 0,1, 1,0, 0,1, 1,1 }; /* 9.4.4.3.5 Tail bits */ @@ -267,11 +277,11 @@ } int tetra_find_train_seq(const uint8_t *in, unsigned int end_of_in, - uint32_t mask_of_train_seq, unsigned int *offset) + uint32_t mask_of_train_seq, unsigned int *offset, unsigned int skip) { const uint8_t *cur; - for (cur = in; cur < in + end_of_in; cur++) { + for (cur = in+skip; cur < in + end_of_in; cur++) { int remain_len = (in + end_of_in) - cur; if (mask_of_train_seq & (1 << TETRA_TRAIN_SYNC) && @@ -292,6 +302,7 @@ *offset = (cur - in); return TETRA_TRAIN_NORM_2; } +#if 0 /* not used */ if (mask_of_train_seq & (1 << TETRA_TRAIN_NORM_3) && remain_len >= sizeof(q_bits) && !memcmp(cur, q_bits, sizeof(q_bits))) { @@ -304,10 +315,43 @@ *offset = (cur - in); return TETRA_TRAIN_EXT; } +#endif } return -1; } +int check_tmo_or_dmo(const uint8_t *in, enum tetra_train_seq type) +{ + switch (type) { + case TETRA_TRAIN_SYNC: + /* if it is a DMO sync burst, it should contain preamble P3 */ + if (!memcmp(in, dmo_pre3_bits, sizeof(dmo_pre3_bits))) + return TETRA_TRAIN_SYNC_DMO; + else + return TETRA_TRAIN_SYNC; + break; + case TETRA_TRAIN_NORM_1: + /* if it is a DMO normal 1 burst, it should contain preamble P1 */ + if (!memcmp(in, dmo_pre1_bits, sizeof(dmo_pre1_bits))) + return TETRA_TRAIN_NORM_1_DMO; + else + return TETRA_TRAIN_NORM_1; + break; + case TETRA_TRAIN_NORM_2: + /* if it is a DMO normal 2 burst, it should contain preamble P2 */ + if (!memcmp(in, dmo_pre2_bits, sizeof(dmo_pre2_bits))) + return TETRA_TRAIN_NORM_2_DMO; + else + return TETRA_TRAIN_NORM_2; + break; + default: + /* There aren't any other DMO burst types, so it must be TMO */ + return type; + break; + } +} + +/* splits the bursts in relevant blocks (depending on the type) and sends them to the upper layer */ void tetra_burst_rx_cb(const uint8_t *burst, unsigned int len, enum tetra_train_seq type, void *priv) { uint8_t bbk_buf[NDB_BBK_BITS]; @@ -320,6 +364,12 @@ tp_sap_udata_ind(TPSAP_T_SB1, burst+SB_BLK1_OFFSET, SB_BLK1_BITS, priv); tp_sap_udata_ind(TPSAP_T_BBK, burst+SB_BBK_OFFSET, SB_BBK_BITS, priv); tp_sap_udata_ind(TPSAP_T_SB2, burst+SB_BLK2_OFFSET, SB_BLK2_BITS, priv); + break; + case TETRA_TRAIN_SYNC_DMO: + /* Split SB1 and SB2 */ + /* send two parts of the burst via TP-SAP into lower MAC */ + dp_sap_udata_ind(DPSAP_SCH_S, burst+SB_BLK1_OFFSET, SB_BLK1_BITS, priv); + dp_sap_udata_ind(DPSAP_SCH_H, burst+SB_BLK2_DMO_OFFSET, SB_BLK2_BITS, priv); break; case TETRA_TRAIN_NORM_2: /* re-combine the broadcast block */ @@ -341,5 +391,16 @@ tp_sap_udata_ind(TPSAP_T_BBK, bbk_buf, NDB_BBK_BITS, priv); tp_sap_udata_ind(TPSAP_T_SCH_F, ndbf_buf, 2*NDB_BLK_BITS, priv); break; + case TETRA_TRAIN_NORM_2_DMO: + /* TODO: send parts of the burst via TP-SAP into lower MAC */ + fprintf(stderr, "#### TETRA_TRAIN_NORM_2_DMO bursts are not implemented\n"); + break; + case TETRA_TRAIN_NORM_1_DMO: + /* re-combine the two parts */ + memcpy(ndbf_buf, burst+DNB_BLK1_OFFSET, DNB_BLK_BITS); + memcpy(ndbf_buf+DNB_BLK_BITS, burst+DNB_BLK2_OFFSET, DNB_BLK_BITS); + /* send part of the burst via TP-SAP into lower MAC */ + dp_sap_udata_ind(DPSAP_SCH_F, ndbf_buf, DNB_BLK_BITS*2, priv); + break; } } diff --git a/src/phy/tetra_burst_sync.c b/src/phy/tetra_burst_sync.c index e363c74..5acd0ba 100644 --- a/src/phy/tetra_burst_sync.c +++ b/src/phy/tetra_burst_sync.c @@ -51,7 +51,7 @@ } /* input a raw bitstream into the tetra burst synchronizaer */ -int tetra_burst_sync_in(struct tetra_rx_state *trs, uint8_t *bits, unsigned int len) +int tetra_burst_sync_in(struct tetra_rx_state *trs, uint8_t *bits, unsigned int len, int *scounter) { int rc; unsigned int train_seq_offs; @@ -74,11 +74,13 @@ DEBUGP("-> trying to find training sequence between bit %u and %u\n", trs->bitbuf_start_bitnum, trs->bits_in_buf); rc = tetra_find_train_seq(trs->bitbuf, trs->bits_in_buf, - (1 << TETRA_TRAIN_SYNC), &train_seq_offs); + (1 << TETRA_TRAIN_SYNC), &train_seq_offs, 0); if (rc < 0) return rc; printf("found SYNC training sequence in bit #%u\n", train_seq_offs); trs->state = RX_S_KNOW_FSTART; + /* for DMO image that the 34 bits guard at the beginning of a burst */ + /* belongs to the previous burst */ trs->next_frame_start_bitnum = trs->bitbuf_start_bitnum + train_seq_offs + 296; #if 0 if (train_seq_offs < 214) { @@ -112,7 +114,7 @@ } else { /* we have successfully received (at least) one frame */ tetra_tdma_time_add_tn(&t_phy_state.time, 1); - printf("\nBURST"); + printf("\n\nBURST: "); DEBUGP(": %s", osmo_ubit_dump(trs->bitbuf, TETRA_BITS_PER_TS)); printf("\n"); @@ -120,31 +122,58 @@ sprintf(tmpstr,"TETMON_begin FUNC:BURST RX:%i TETMON_end",tetra_hack_rxid); sendto(tetra_hack_live_socket, (char *)&tmpstr, 128, 0, (struct sockaddr *)&tetra_hack_live_sockaddr, tetra_hack_socklen); - + /* skip the first 200 bits, because normally the first training sequence can be found in bit 214 */ rc = tetra_find_train_seq(trs->bitbuf, trs->bits_in_buf, (1 << TETRA_TRAIN_NORM_1)| (1 << TETRA_TRAIN_NORM_2)| - (1 << TETRA_TRAIN_SYNC), &train_seq_offs); + (1 << TETRA_TRAIN_SYNC), &train_seq_offs, 200); switch (rc) { case TETRA_TRAIN_SYNC: - if (train_seq_offs == 214) - tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); - else { - fprintf(stderr, "#### SYNC burst at offset %u?!?\n", train_seq_offs); + if (train_seq_offs == 214) { + *scounter = 0; + rc = check_tmo_or_dmo(trs->bitbuf, rc); + if (rc == TETRA_TRAIN_SYNC) { + printf("TETRA_TRAIN_SYNC_TMO\n"); + tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, TETRA_TRAIN_SYNC, trs->burst_cb_priv); + } else { + printf("TETRA_TRAIN_SYNC_DMO\n"); + tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, TETRA_TRAIN_SYNC_DMO, trs->burst_cb_priv); + } + } else { + fprintf(stderr, "\n#### SYNC burst at offset %u?!?\n", train_seq_offs); trs->state = RX_S_UNLOCKED; } break; - case TETRA_TRAIN_NORM_1: - case TETRA_TRAIN_NORM_2: - case TETRA_TRAIN_NORM_3: - if (train_seq_offs == 244) + case (TETRA_TRAIN_NORM_1): /* fall through */ + case (TETRA_TRAIN_NORM_2): + if (train_seq_offs == 230) { + *scounter = 0; + rc = check_tmo_or_dmo(trs->bitbuf, rc); + if (rc == TETRA_TRAIN_NORM_1_DMO || rc == TETRA_TRAIN_NORM_2_DMO) { + printf("TETRA_TRAIN_NORM_%u_DMO\n", rc); + tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); + break; + } else { + fprintf(stderr, "#### TRAIN NORM %u DMO burst at offset %u?!?\n", rc, train_seq_offs); + trs->state = RX_S_UNLOCKED; + } + } else if (train_seq_offs == 244) { + *scounter = 0; + printf("TETRA_TRAIN_NORM_%u\n", rc); tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); - else - fprintf(stderr, "#### SYNC burst at offset %u?!?\n", train_seq_offs); + } else { + fprintf(stderr, "\n#### TRAIN NORM %u burst at offset %u?!?\n", rc, train_seq_offs); + trs->state = RX_S_UNLOCKED; + } break; default: - fprintf(stderr, "#### could not find successive burst training sequence\n"); - trs->state = RX_S_UNLOCKED; + (*scounter)++; + if (*scounter >= 4) { + fprintf(stderr, "#### could not find successive burst training sequence\n"); + trs->state = RX_S_UNLOCKED; + } else { + fprintf(stderr, "#### slot is empty, checking next %d slots before searching a new synchronization burst\n", 4-(*scounter)); + } break; } diff --git a/src/phy/tetra_burst_sync.h b/src/phy/tetra_burst_sync.h index 7862461..11f6224 100644 --- a/src/phy/tetra_burst_sync.h +++ b/src/phy/tetra_burst_sync.h @@ -21,6 +21,6 @@ /* input a raw bitstream into the tetra burst synchronizaer */ -int tetra_burst_sync_in(struct tetra_rx_state *trs, uint8_t *bits, unsigned int len); +int tetra_burst_sync_in(struct tetra_rx_state *trs, uint8_t *bits, unsigned int len, int *scounter); #endif /* TETRA_BURST_SYNC_H */ diff --git a/src/tetra-rx.c b/src/tetra-rx.c index 42045b5..2387b4d 100644 --- a/src/tetra-rx.c +++ b/src/tetra-rx.c @@ -117,6 +117,7 @@ float filter_goal=0; int ccounter=0; char tmpstr2[64]; + int scounter = 0; //slot counter tetra_hack_reassemble_fragments=0; tetra_hack_all_sds_as_text=0; @@ -260,7 +261,7 @@ break; } } - tetra_burst_sync_in(trs, buf, len); + tetra_burst_sync_in(trs, buf, len, &scounter); if (accept_float) { ccounter++; diff --git a/src/tetra_common.h b/src/tetra_common.h index 98327ba..2ba110b 100644 --- a/src/tetra_common.h +++ b/src/tetra_common.h @@ -36,6 +36,10 @@ TETRA_LC_BSCH, TETRA_LC_BNCH, + TETRA_LC_DMO_SCH_S, + TETRA_LC_DMO_SCH_H, + TETRA_LC_DMO_SCH_F, + /* FIXME: QAM */ }; uint32_t bits_to_uint(const uint8_t *bits, unsigned int len); diff --git a/src/tetra_gsmtap.c b/src/tetra_gsmtap.c index f575c20..df6b8fd 100644 --- a/src/tetra_gsmtap.c +++ b/src/tetra_gsmtap.c @@ -25,6 +25,9 @@ [TETRA_LC_TCH] = GSMTAP_TETRA_TCH_F, [TETRA_LC_BSCH] = GSMTAP_TETRA_BSCH, [TETRA_LC_BNCH] = GSMTAP_TETRA_BNCH, + [TETRA_LC_DMO_SCH_S] = GSMTAP_TETRA_DMO_SCH_S, + [TETRA_LC_DMO_SCH_H] = GSMTAP_TETRA_DMO_SCH_H, + [TETRA_LC_DMO_SCH_F] = GSMTAP_TETRA_DMO_SCH_F, }; -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 From gerrit-no-reply at lists.osmocom.org Thu Jun 1 08:28:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 08:28:19 +0000 Subject: libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d Gerrit-PatchSet: 1 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 Jun 1 08:29:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 08:29:04 +0000 Subject: libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 1 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 Jun 1 09:33:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 09:33:59 +0000 Subject: osmo-hlr[master]: VTY: Add hlr node and bind ip field In-Reply-To: References: Message-ID: Patch Set 1: (6 comments) https://gerrit.osmocom.org/#/c/2809/1/doc/examples/osmo-hlr.cfg File doc/examples/osmo-hlr.cfg: Line 18: bind ip 127.0.0.1 > name GSUP explicitly; either as another VTY parent node or as 'gsup bind ip Done https://gerrit.osmocom.org/#/c/2809/1/src/hlr.c File src/hlr.c: Line 438: hlr_vty_init(g_hlr, &hlr_log_info, hlr_ctx); > g_hlr is also a talloc'd item, and it would indeed make more sense to use t In other places like in hnbgw.c (osmo-iuh) the same is done as I do here (even passing the main talloc_ctx instead of the config object, and passing it as 2nd parameter). I'll drop the hlr_ctx parameter and use g_hlr for everything. https://gerrit.osmocom.org/#/c/2809/1/src/hlr.h File src/hlr.h: Line 39: char *bind_addr; > this should also say 'gsup_bind_addr'. (While at it, we could also add the Done https://gerrit.osmocom.org/#/c/2809/1/src/hlr_vty.c File src/hlr_vty.c: Line 61: "IPv4 Address to bind to\n") > "GSUP" Done Line 65: g_hlr->bind_addr = talloc_strdup(tall_hlr_ctx, argv[0]); > s/tall_hlr_ctx/g_hlr Done https://gerrit.osmocom.org/#/c/2809/1/src/hlr_vty.h File src/hlr_vty.h: Line 35: void hlr_vty_init(struct hlr *hlr, const struct log_info *cat, void *tall_ctx); > in most osmo code we pass the tall_ctx as first argument, if we have one. Will not apply anymore as there will only be 1 parameter. -- To view, visit https://gerrit.osmocom.org/2809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79f7a300480f308b21116dd14d1698be38725afd Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr 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 Thu Jun 1 09:34:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 09:34:33 +0000 Subject: [PATCH] osmo-hlr[master]: VTY: Add hlr node and bind ip 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/2809 to look at the new patch set (#2). VTY: Add hlr node and bind ip field With this patch the address osmo-hlr binds to can be changed to something else than 0.0.0.0 Change-Id: I79f7a300480f308b21116dd14d1698be38725afd --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_vty.c M src/hlr_vty.h 5 files changed, 114 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/09/2809/2 diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index 2b49958..853d3c2 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -14,3 +14,6 @@ bind 127.0.0.1 ctrl bind 127.0.0.1 +hlr + gsup + bind ip 127.0.0.1 diff --git a/src/hlr.c b/src/hlr.c index b5777e2..7d1bf75 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -415,6 +415,7 @@ .version = PACKAGE_VERSION, .copyright = vlr_copyright, .is_config_node = hlr_vty_is_config_node, + .go_parent_cb = hlr_vty_go_parent, }; int main(int argc, char **argv) @@ -435,7 +436,7 @@ vty_init(&vty_info); ctrl_vty_init(hlr_ctx); handle_options(argc, argv); - hlr_vty_init(&hlr_log_info); + hlr_vty_init(g_hlr, &hlr_log_info); rc = vty_read_config_file(cmdline_opts.config_file, NULL); if (rc < 0) { @@ -465,8 +466,8 @@ exit(1); } - g_hlr->gs = osmo_gsup_server_create(hlr_ctx, NULL, 2222, read_cb, - &g_lu_ops); + g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, 2222, + read_cb, &g_lu_ops); if (!g_hlr->gs) { LOGP(DMAIN, LOGL_FATAL, "Error starting GSUP server\n"); exit(1); diff --git a/src/hlr.h b/src/hlr.h index 1e8eff8..f63bc2b 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -34,4 +34,7 @@ /* Control Interface */ struct ctrl_handle *ctrl; const char *ctrl_bind_addr; + + /* Local bind addr */ + char *gsup_bind_addr; }; diff --git a/src/hlr_vty.c b/src/hlr_vty.c index e4eef8f..946117e 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -20,11 +20,93 @@ * */ +#include #include #include #include #include "hlr_vty.h" + +static struct hlr *g_hlr = NULL; + +struct cmd_node hlr_node = { + HLR_NODE, + "%s(config-hlr)# ", + 1, +}; + +DEFUN(cfg_hlr, + cfg_hlr_cmd, + "hlr", + "Configure the HLR") +{ + vty->node = HLR_NODE; + return CMD_SUCCESS; +} + +struct cmd_node gsup_node = { + GSUP_NODE, + "%s(config-hlr-gsup)# ", + 1, +}; + +DEFUN(cfg_gsup, + cfg_gsup_cmd, + "gsup", + "Configure GSUP options") +{ + vty->node = GSUP_NODE; + return CMD_SUCCESS; +} + +static int config_write_hlr(struct vty *vty) +{ + vty_out(vty, "hlr%s", VTY_NEWLINE); + return CMD_SUCCESS; +} + +static int config_write_hlr_gsup(struct vty *vty) +{ + vty_out(vty, " gsup%s", VTY_NEWLINE); + if (g_hlr->gsup_bind_addr) + vty_out(vty, " bind ip %s%s", g_hlr->gsup_bind_addr, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(cfg_hlr_gsup_bind_ip, + cfg_hlr_gsup_bind_ip_cmd, + "bind ip A.B.C.D", + "Listen/Bind related socket option\n" + IP_STR + "IPv4 Address to bind the GSUP interface to\n") +{ + if(g_hlr->gsup_bind_addr) + talloc_free(g_hlr->gsup_bind_addr); + g_hlr->gsup_bind_addr = talloc_strdup(g_hlr, argv[0]); + + return CMD_SUCCESS; +} + +int hlr_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GSUP_NODE: + vty->node = HLR_NODE; + vty->index = NULL; + break; + default: + case HLR_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + break; + case CONFIG_NODE: + vty->node = ENABLE_NODE; + vty->index = NULL; + break; + } + + return vty->node; +} int hlr_vty_is_config_node(struct vty *vty, int node) { @@ -38,7 +120,19 @@ } } -void hlr_vty_init(const struct log_info *cat) +void hlr_vty_init(struct hlr *hlr, const struct log_info *cat) { + g_hlr = hlr; + logging_vty_add_cmds(cat); + + install_element(CONFIG_NODE, &cfg_hlr_cmd); + install_node(&hlr_node, config_write_hlr); + install_default(HLR_NODE); + + install_element(HLR_NODE, &cfg_gsup_cmd); + install_node(&gsup_node, config_write_hlr_gsup); + install_default(GSUP_NODE); + + install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); } diff --git a/src/hlr_vty.h b/src/hlr_vty.h index abc9804..cd2ff73 100644 --- a/src/hlr_vty.h +++ b/src/hlr_vty.h @@ -24,6 +24,14 @@ #include #include +#include +#include "hlr.h" + +enum hlr_vty_node { + HLR_NODE = _LAST_OSMOVTY_NODE + 1, + GSUP_NODE, +}; int hlr_vty_is_config_node(struct vty *vty, int node); -void hlr_vty_init(const struct log_info *cat); +int hlr_vty_go_parent(struct vty *vty); +void hlr_vty_init(struct hlr *hlr, const struct log_info *cat); -- To view, visit https://gerrit.osmocom.org/2809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79f7a300480f308b21116dd14d1698be38725afd Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr 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 Thu Jun 1 09:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 1 Jun 2017 09:55:17 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2811 to look at the new patch set (#2). gsm0808: update permitted speech constants 3GPP TS 48.008 specifies two new half rate speech modes and two new full rate speech modes. This patch adds the matching constants to enum gsm0808_permitted_speech Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 10 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/2811/2 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..0de2f9e 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -393,12 +393,16 @@ /* GSM 08.08 3.2.2.11 Channel Type */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /* GSM FR */ + GSM0808_PERM_FR2 = 0x11, /* GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /* FR AMR */ + GSM0808_PERM_FR4 = 0x41, /* OFR AMR-WB */ + GSM0808_PERM_FR5 = 0x42, /* FR AMR-WB */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /* GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /* deprecated */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /* HR AMR */ + GSM0808_PERM_HR4 = 0x46, /* OHR AMR-WB */ + GSM0808_PERM_HR6 = 0x45, /* OHR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d 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 Thu Jun 1 09:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 1 Jun 2017 09:55:17 +0000 Subject: [PATCH] libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2812 to look at the new patch set (#2). gsm0408: update bearer capability speech version 3GPP TS 24.008 specifies two new speech versions for half rate and two new speech modes for full rate. This patch adds the relevant constants to enum gsm48_bcap_speech_ver in gsm_04_08.h Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/2812/2 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 3f0ce64..73db0c9 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1618,13 +1618,18 @@ GSM48_BCAP_MT_AUTO_1 = 8, }; -/* GSM 04.08 Bearer Capability: Speech Version Indication */ +/* GSM 04.08 Bearer Capability: Speech Version Indication + * (See also 3GPP TS 24.008, Table 10.5.103) */ enum gsm48_bcap_speech_ver { - GSM48_BCAP_SV_FR = 0, - GSM48_BCAP_SV_HR = 1, - GSM48_BCAP_SV_EFR = 2, - GSM48_BCAP_SV_AMR_F = 4, - GSM48_BCAP_SV_AMR_H = 5, + GSM48_BCAP_SV_FR = 0, /* GSM FR V1 (GSM FR) */ + GSM48_BCAP_SV_HR = 1, /* GSM HR V1 (GSM HR) */ + GSM48_BCAP_SV_EFR = 2, /* GSM FR V2 (GSM EFR) */ + GSM48_BCAP_SV_AMR_F = 4, /* GSM FR V3 (FR AMR) */ + GSM48_BCAP_SV_AMR_H = 5, /* GSM HR V3 (HR_AMR) */ + GSM48_BCAP_SV_AMR_OFW = 6, /* GSM FR V4 (OFR AMR-WB) */ + GSM48_BCAP_SV_AMR_OHW = 7, /* GSM HR V4 (OHR AMR-WB) */ + GSM48_BCAP_SV_AMR_FW = 8, /* GSM FR V5 (FR AMR-WB) */ + GSM48_BCAP_SV_AMR_OH = 11, /* GSM HR V6 (OHR AMR) */ }; #define GSM48_TMSI_LEN 5 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 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 Thu Jun 1 09:58:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 09:58:14 +0000 Subject: libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2811/2/include/osmocom/gsm/protocol/gsm_08_08.h File include/osmocom/gsm/protocol/gsm_08_08.h: Line 394: /* GSM 08.08 3.2.2.11 Channel Type */ 48.008 should be added to the comment because additional types are not available in 08.08 (if I understood commit message correctly). -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d 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 Thu Jun 1 09:58:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 09:58:49 +0000 Subject: libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 2 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 Jun 1 10:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 10:05:58 +0000 Subject: [PATCH] osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs 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/2745 to look at the new patch set (#3). trx: Allow BTS and TRX to be on different IPs Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 --- M doc/examples/trx/osmo-bts.cfg M include/osmo-bts/phy_link.h M src/osmo-bts-trx/main.c M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 6 files changed, 58 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/2745/3 diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index 29d5655..e455540 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -23,6 +23,8 @@ phy 0 instance 0 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 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4d1dadb..4c7ff34 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -37,7 +37,8 @@ struct { } sysmobts; struct { - char *transceiver_ip; + char *local_ip; + char *remote_ip; uint16_t base_port_local; uint16_t base_port_remote; struct osmo_fd trx_ofd_clk; diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 0148e5b..b2cbb39 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -113,7 +113,8 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.local_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.remote_ip = talloc_strdup(plink, "127.0.0.1"); plink->u.osmotrx.base_port_local = 5800; plink->u.osmotrx.base_port_remote = 5700; plink->u.osmotrx.clock_advance = 20; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 989e77a..c676d11 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -57,14 +57,10 @@ */ /* open socket */ -static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host, - uint16_t port_local, uint16_t port_remote, +static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, + uint16_t port_local, const char *host_remote, uint16_t port_remote, int (*cb)(struct osmo_fd *fd, unsigned int what)) { - struct sockaddr_storage sas; - struct sockaddr *sa = (struct sockaddr *)&sas; - socklen_t sa_len; - int rc; /* Init */ @@ -72,30 +68,10 @@ ofd->cb = cb; ofd->data = priv; - /* Listen / Binds */ - rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, host, - port_local, OSMO_SOCK_F_BIND); + /* Listen / Binds + Connect */ + rc = osmo_sock_init2_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, host_local, port_local, + host_remote, port_remote, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); if (rc < 0) - return rc; - - /* Connect */ - sa_len = sizeof(sas); - rc = getsockname(ofd->fd, sa, &sa_len); - if (rc) - return rc; - - if (sa->sa_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - sin->sin_port = htons(port_remote); - } else if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - sin6->sin6_port = htons(port_remote); - } else { - return -EINVAL; - } - - rc = connect(ofd->fd, sa, sa_len); - if (rc) return rc; return 0; @@ -528,8 +504,9 @@ /* open the shared/common clock socket */ rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, plink->u.osmotrx.base_port_remote, trx_clk_read_cb); if (rc < 0) { @@ -588,14 +565,16 @@ /* open sockets */ rc = trx_udp_open(l1h, &l1h->trx_ofd_ctrl, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 0), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 0), trx_ctrl_read_cb); if (rc < 0) goto err; rc = trx_udp_open(l1h, &l1h->trx_ofd_data, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 1), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 1), trx_data_read_cb); if (rc < 0) goto err; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index fdc8a8d..05e8bff 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,7 +2,8 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *transceiver_ip; +extern const char *local_ip; +extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3822b0f..1bde2eb 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -459,14 +460,40 @@ DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR - "Set remote IP address\n" - "IP address of OsmoTRX\n") + "Set local and remote IP address\n" + "IP address (for both OsmoBtsTrx and OsmoTRX)\n") { struct phy_link *plink = vty->index; - if (plink->u.osmotrx.transceiver_ip) - talloc_free(plink->u.osmotrx.transceiver_ip); - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, argv[0]); + if (plink->u.osmotrx.local_ip) + talloc_free(plink->u.osmotrx.local_ip); + plink->u.osmotrx.local_ip = talloc_strdup(plink, argv[0]); + if (plink->u.osmotrx.remote_ip) + talloc_free(plink->u.osmotrx.remote_ip); + plink->u.osmotrx.remote_ip = talloc_strdup(plink, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_osmotrx_ip, cfg_phy_osmotrx_ip_cmd, + "osmotrx ip (local|remote) HOST", + OSMOTRX_STR + "Set IP address\n" "Local IP address (BTS)\n" + "Remote IP address (OsmoTRX)\n" "IP address\n") +{ + struct phy_link *plink = vty->index; + + if (!strcmp(argv[0], "local")) { + if (plink->u.osmotrx.local_ip) + talloc_free(plink->u.osmotrx.local_ip); + plink->u.osmotrx.local_ip = talloc_strdup(plink, argv[1]); + } else if (!strcmp(argv[0], "remote")) { + if (plink->u.osmotrx.remote_ip) + talloc_free(plink->u.osmotrx.remote_ip); + plink->u.osmotrx.remote_ip = talloc_strdup(plink, argv[1]); + } else { + return CMD_WARNING; + } return CMD_SUCCESS; } @@ -488,9 +515,12 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { - if (plink->u.osmotrx.transceiver_ip) - vty_out(vty, " osmotrx ip %s%s", - plink->u.osmotrx.transceiver_ip, VTY_NEWLINE); + if (plink->u.osmotrx.local_ip) + vty_out(vty, " osmotrx ip local %s%s", + plink->u.osmotrx.local_ip, VTY_NEWLINE); + if (plink->u.osmotrx.remote_ip) + vty_out(vty, " osmotrx ip remote %s%s", + plink->u.osmotrx.remote_ip, VTY_NEWLINE); vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); @@ -568,6 +598,7 @@ install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); + install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 3 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 Thu Jun 1 10:05:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 10:05:58 +0000 Subject: [PATCH] osmo-bts[master]: trx: Save osmotrx base-port vty properties 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/2746 to look at the new patch set (#4). trx: Save osmotrx base-port vty properties Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/2746/4 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 1bde2eb..b67d242 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -522,6 +522,13 @@ vty_out(vty, " osmotrx ip remote %s%s", plink->u.osmotrx.remote_ip, VTY_NEWLINE); + if (plink->u.osmotrx.base_port_local) + vty_out(vty, " osmotrx base-port local %"PRIu16"%s", + plink->u.osmotrx.base_port_local, VTY_NEWLINE); + if (plink->u.osmotrx.base_port_remote) + vty_out(vty, " osmotrx base-port remote %"PRIu16"%s", + plink->u.osmotrx.base_port_remote, VTY_NEWLINE); + vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); vty_out(vty, " osmotrx rts-advance %d%s", -- To view, visit https://gerrit.osmocom.org/2746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6 Gerrit-PatchSet: 4 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 Thu Jun 1 10:17:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 10:17:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2747 to look at the new patch set (#2). OsmoBTS: Update osmotrx ip to diff between local and remote Change Id of the code implementation: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/47/2747/2 diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index 1c619d3..a5c3218 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -226,8 +226,14 @@ ===== `osmotrx ip HOST` -Set the IP address of the OsmoTRX transceiver to which we should connect -to. +Set the IP address for the OsmoTRX interface for both the local (OsmoBTS) and +remote (OsmoTRX) side of the UDP flows. This option has been deprecated by the +more detailed option `osmotrx ip (local|remote) HOST`. + +===== `osmotrx ip (local|remote) HOST` + +Set the IP address for the OsmoTRX interface for either the local (OsmoBTS) or +remote (OsmoTRX) side of the UDP flows. ===== `osmotrx base-port (local|remote) <0-65535>` -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 1 10:20:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 1 Jun 2017 10:20:30 +0000 Subject: osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2745/3/src/osmo-bts-trx/trx_vty.c File src/osmo-bts-trx/trx_vty.c: Line 487: if (plink->u.osmotrx.local_ip) we have osmo_talloc_replace_string() for this. Line 492: talloc_free(plink->u.osmotrx.remote_ip); same here again, please use osmo_talloc_replace_string() which all related VTY code should already be using whenever assigning strign members via vty. -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 3 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 1 10:21:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 1 Jun 2017 10:21:10 +0000 Subject: osmo-bts[master]: trx: Save osmotrx base-port vty properties In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6 Gerrit-PatchSet: 4 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 Thu Jun 1 10:25:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 1 Jun 2017 10:25:28 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2811 to look at the new patch set (#3). gsm0808: update permitted speech constants 3GPP TS 48.008 specifies two new half rate speech modes and two new full rate speech modes. This patch adds the matching constants to enum gsm0808_permitted_speech Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 12 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/2811/3 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..1e8d430 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,19 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/* GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /* GSM FR */ + GSM0808_PERM_FR2 = 0x11, /* GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /* FR AMR */ + GSM0808_PERM_FR4 = 0x41, /* OFR AMR-WB */ + GSM0808_PERM_FR5 = 0x42, /* FR AMR-WB */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /* GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /* (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /* HR AMR */ + GSM0808_PERM_HR4 = 0x46, /* OHR AMR-WB */ + GSM0808_PERM_HR6 = 0x45, /* OHR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d 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 Jun 1 10:25:29 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 1 Jun 2017 10:25:29 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: Add speech codec type constants Message-ID: Review at https://gerrit.osmocom.org/2818 gsm0808: Add speech codec type constants The codec type to be set in member type in struct gsm0808_speech_codec has its own coding scheme to reference the used codec types. This patch declares an enum with valid speech codec types. Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/2818/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 1e8d430..4c24cdd 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -406,6 +406,19 @@ GSM0808_PERM_HR6 = 0x45, /* OHR AMR */ }; +/* 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ +enum gsm0808_speech_codec_type { + GSM0808_SCT_FR1 = 0x0, /* GSM FR */ + GSM0808_SCT_FR2 = 0x2, /* GSM EFR */ + GSM0808_SCT_FR3 = 0x3, /* FR AMR */ + GSM0808_SCT_FR4 = 0xc, /* OFR AMR-WB */ + GSM0808_SCT_FR5 = 0x9, /* FR AMR-WB */ + GSM0808_SCT_HR1 = 0x1, /* GSM_HR */ + GSM0808_SCT_HR3 = 0x4, /* HR_AMR */ + GSM0808_SCT_HR4 = 0xd, /* OHR AMR-WB */ + GSM0808_SCT_HR6 = 0xb, /* OHR AMR */ +}; + /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ enum gsm0808_chosen_enc_alg { GSM0808_ALG_ID_A5_0 = 0x01, -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 1 10:27:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 10:27:58 +0000 Subject: libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d 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 Jun 1 10:31:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 10:31:22 +0000 Subject: [PATCH] osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs 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/2745 to look at the new patch set (#4). trx: Allow BTS and TRX to be on different IPs Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 --- M doc/examples/trx/osmo-bts.cfg M include/osmo-bts/phy_link.h M src/osmo-bts-trx/main.c M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 6 files changed, 49 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/2745/4 diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index 29d5655..e455540 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -23,6 +23,8 @@ phy 0 instance 0 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 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4d1dadb..4c7ff34 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -37,7 +37,8 @@ struct { } sysmobts; struct { - char *transceiver_ip; + char *local_ip; + char *remote_ip; uint16_t base_port_local; uint16_t base_port_remote; struct osmo_fd trx_ofd_clk; diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 0148e5b..b2cbb39 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -113,7 +113,8 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.local_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.remote_ip = talloc_strdup(plink, "127.0.0.1"); plink->u.osmotrx.base_port_local = 5800; plink->u.osmotrx.base_port_remote = 5700; plink->u.osmotrx.clock_advance = 20; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 989e77a..c676d11 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -57,14 +57,10 @@ */ /* open socket */ -static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host, - uint16_t port_local, uint16_t port_remote, +static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, + uint16_t port_local, const char *host_remote, uint16_t port_remote, int (*cb)(struct osmo_fd *fd, unsigned int what)) { - struct sockaddr_storage sas; - struct sockaddr *sa = (struct sockaddr *)&sas; - socklen_t sa_len; - int rc; /* Init */ @@ -72,30 +68,10 @@ ofd->cb = cb; ofd->data = priv; - /* Listen / Binds */ - rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, host, - port_local, OSMO_SOCK_F_BIND); + /* Listen / Binds + Connect */ + rc = osmo_sock_init2_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, host_local, port_local, + host_remote, port_remote, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); if (rc < 0) - return rc; - - /* Connect */ - sa_len = sizeof(sas); - rc = getsockname(ofd->fd, sa, &sa_len); - if (rc) - return rc; - - if (sa->sa_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - sin->sin_port = htons(port_remote); - } else if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - sin6->sin6_port = htons(port_remote); - } else { - return -EINVAL; - } - - rc = connect(ofd->fd, sa, sa_len); - if (rc) return rc; return 0; @@ -528,8 +504,9 @@ /* open the shared/common clock socket */ rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, plink->u.osmotrx.base_port_remote, trx_clk_read_cb); if (rc < 0) { @@ -588,14 +565,16 @@ /* open sockets */ rc = trx_udp_open(l1h, &l1h->trx_ofd_ctrl, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 0), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 0), trx_ctrl_read_cb); if (rc < 0) goto err; rc = trx_udp_open(l1h, &l1h->trx_ofd_data, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 1), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 1), trx_data_read_cb); if (rc < 0) goto err; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index fdc8a8d..05e8bff 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,7 +2,8 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *transceiver_ip; +extern const char *local_ip; +extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3822b0f..421ee5a 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -459,14 +460,31 @@ DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR - "Set remote IP address\n" - "IP address of OsmoTRX\n") + "Set local and remote IP address\n" + "IP address (for both OsmoBtsTrx and OsmoTRX)\n") { struct phy_link *plink = vty->index; - if (plink->u.osmotrx.transceiver_ip) - talloc_free(plink->u.osmotrx.transceiver_ip); - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_osmotrx_ip, cfg_phy_osmotrx_ip_cmd, + "osmotrx ip (local|remote) HOST", + OSMOTRX_STR + "Set IP address\n" "Local IP address (BTS)\n" + "Remote IP address (OsmoTRX)\n" "IP address\n") +{ + struct phy_link *plink = vty->index; + + if (!strcmp(argv[0], "local")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[1]); + else if (!strcmp(argv[0], "remote")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[1]); + else + return CMD_WARNING; return CMD_SUCCESS; } @@ -488,9 +506,12 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { - if (plink->u.osmotrx.transceiver_ip) - vty_out(vty, " osmotrx ip %s%s", - plink->u.osmotrx.transceiver_ip, VTY_NEWLINE); + if (plink->u.osmotrx.local_ip) + vty_out(vty, " osmotrx ip local %s%s", + plink->u.osmotrx.local_ip, VTY_NEWLINE); + if (plink->u.osmotrx.remote_ip) + vty_out(vty, " osmotrx ip remote %s%s", + plink->u.osmotrx.remote_ip, VTY_NEWLINE); vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); @@ -568,6 +589,7 @@ install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); + install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 4 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 Thu Jun 1 10:36:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 1 Jun 2017 10:36:48 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/2779/6/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 455: if (self.mcc is None and self.mnc is not None) or (self.mcc is not None and self.mnc is None): > imho input validation should be done even before, when checking/reading the $ python3 Python 3.6.1 (default, Mar 27 2017, 00:27:06) [GCC 6.3.1 20170306] on linux Type "help", "copyright", "credits" or "license" for more information. >>> (None, None) == None False >>> len(('123', None)) 2 >>> len((None, None)) 2 -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 6 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 1 11:45:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 1 Jun 2017 11:45:48 +0000 Subject: [PATCH] openbsc[master]: bsc_init: Forget which SIs are valid for the trx Message-ID: Review at https://gerrit.osmocom.org/2819 bsc_init: Forget which SIs are valid for the trx Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/2819/1 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index caec800..138a67f 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -115,6 +115,10 @@ GSM_BTS_SI(bts, i), si_len); break; default: + if (bts->c0 != trx) + LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS/TRX (%d/%d)\n", + get_value_string(osmo_sitype_strs, i), bts->nr, trx->nr); + rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), GSM_BTS_SI(bts, i), si_len); break; @@ -135,6 +139,9 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; + /* Zero, forget the state of the SIs */ + bts->si_valid = 0; + /* First, we determine which of the SI messages we actually need */ if (trx == bts->c0) { -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 1 16:05:06 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 1 Jun 2017 16:05:06 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add speech codec type constants In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2818 to look at the new patch set (#2). gsm0808: add speech codec type constants The codec type to be set in member type in struct gsm0808_speech_codec has its own coding scheme to reference the used codec types. This patch declares an enum with valid speech codec types. Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/2818/2 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 1e8d430..94fd4f6 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -406,6 +406,20 @@ GSM0808_PERM_HR6 = 0x45, /* OHR AMR */ }; +/* 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ +enum gsm0808_speech_codec_type { + GSM0808_SCT_FR1 = 0x0, /* GSM FR */ + GSM0808_SCT_FR2 = 0x2, /* GSM EFR */ + GSM0808_SCT_FR3 = 0x3, /* FR AMR */ + GSM0808_SCT_FR4 = 0xc, /* OFR AMR-WB */ + GSM0808_SCT_FR5 = 0x9, /* FR AMR-WB */ + GSM0808_SCT_HR1 = 0x1, /* GSM_HR */ + GSM0808_SCT_HR3 = 0x4, /* HR_AMR */ + GSM0808_SCT_HR4 = 0xd, /* OHR AMR-WB */ + GSM0808_SCT_HR6 = 0xb, /* OHR AMR */ + GSM0808_SCT_CSD = 0xfd, /* CSData (see also TS 26.103) */ +}; + /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ enum gsm0808_chosen_enc_alg { GSM0808_ALG_ID_A5_0 = 0x01, -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 1 16:05:07 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 1 Jun 2017 16:05:07 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator Message-ID: Review at https://gerrit.osmocom.org/2820 gsm0808: fix AoIP speech codec element parser/generator The implementation of the parser/generator for the speech codec information element slightly wrong, making it impossible to use it properly. (See also: 3GPP TS 48.008, 3.2.2.103) Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 192 insertions(+), 79 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/2820/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 94fd4f6..e93b8bc 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -447,8 +447,6 @@ bool tf; uint8_t type; uint16_t cfg; - bool type_extended; - bool cfg_present; }; /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index ff97b2d..c0c2cc2 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -139,6 +139,48 @@ /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; uint8_t *old_tail; + bool type_extended = false; + + /* Note: Extended codec types are codec types that require 8 instead + * of 4 bit to fully specify the selected codec. In the following, + * we check if we work with an extended type or not. We also check + * if the codec type is valid at all. */ + switch(sc->type) { + case GSM0808_SCT_FR1: + type_extended = false; + break; + case GSM0808_SCT_FR2: + type_extended = false; + break; + case GSM0808_SCT_FR3: + type_extended = false; + break; + case GSM0808_SCT_FR4: + type_extended = false; + break; + case GSM0808_SCT_FR5: + type_extended = false; + break; + case GSM0808_SCT_HR1: + type_extended = false; + break; + case GSM0808_SCT_HR3: + type_extended = false; + break; + case GSM0808_SCT_HR4: + type_extended = false; + break; + case GSM0808_SCT_HR6: + type_extended = false; + break; + case GSM0808_SCT_CSD: + type_extended = true; + break; + default: + /* Invalid codec type specified */ + OSMO_ASSERT(false); + break; + } old_tail = msg->tail; @@ -150,20 +192,50 @@ header |= (1 << 5); if (sc->tf) header |= (1 << 4); - if (sc->type_extended) { + + if (type_extended) { header |= 0x0f; msgb_put_u8(msg, header); + msgb_put_u8(msg, sc->type); } else { OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); - return (uint8_t) (msg->tail - old_tail); } - msgb_put_u8(msg, sc->type); - - if (sc->cfg_present) + /* Note: If a configuration is present or not depends on the selected + * codec type. If present, it can either consist of one or two octet, + * depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR3: msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_FR4: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + case GSM0808_SCT_FR5: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + case GSM0808_SCT_HR3: + msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_HR4: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + case GSM0808_SCT_HR6: + msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_CSD: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + default: + OSMO_ASSERT(sc->cfg == 0); + break; + } return (uint8_t) (msg->tail - old_tail); } @@ -225,21 +297,69 @@ if ((header & 0x0F) != 0x0F) { sc->type = (header & 0x0F); - return (int)(elem - old_elem); + } else { + sc->type = *elem; + elem++; + len--; } - sc->type = *elem; - elem++; - len--; - - sc->type_extended = true; - - if (len < 2) - return (int)(elem - old_elem); - - sc->cfg = osmo_load16be(elem); - elem += 2; - sc->cfg_present = true; + /* Note: If a configuration is present or not depends on the selected + * codec type. If present, it can either consist of one or two octet, + * depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR1: + break; + case GSM0808_SCT_FR2: + break; + case GSM0808_SCT_FR3: + if(len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + case GSM0808_SCT_FR4: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_FR5: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_HR1: + break; + case GSM0808_SCT_HR3: + if(len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + case GSM0808_SCT_HR4: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_HR6: + if(len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + case GSM0808_SCT_CSD: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + default: + /* Invalid codec type => malformed speech codec element! */ + return -EINVAL; + break; + } return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8304052..68771a4 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -49,19 +49,17 @@ scl->codec[0].pi = true; scl->codec[0].tf = true; - scl->codec[0].type = 0xab; - scl->codec[0].type_extended = true; - scl->codec[0].cfg_present = true; + scl->codec[0].type = GSM0808_SCT_FR3; scl->codec[0].cfg = 0xcdef; scl->codec[1].fi = true; scl->codec[1].pt = true; - scl->codec[1].type = 0x05; + scl->codec[1].type = GSM0808_SCT_FR2; scl->codec[2].fi = true; scl->codec[2].tf = true; - scl->codec[2].type = 0xf2; - scl->codec[2].type_extended = true; + scl->codec[2].type = GSM0808_SCT_CSD; + scl->codec[2].cfg = 0xc0; scl->len = 3; } @@ -89,8 +87,9 @@ static const uint8_t res[] = { 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, - 0xa5, 0x9f, 0xf2 + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, + 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg, *in_msg; @@ -282,9 +281,10 @@ static const uint8_t res2[] = { 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, 0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, - 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, - 0xef, 0xa5, 0x9f, 0xf2, GSM0808_IE_CALL_ID, 0xaa, 0xbb, 0xcc, - 0xdd }; + 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, + GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb, + 0xcc, 0xdd }; struct msgb *msg; struct gsm0808_channel_type ct; @@ -351,9 +351,9 @@ static const uint8_t res[] = { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04, - 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, 0x9a, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, - 0x9f, 0xf2 }; + 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90, + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg; memset(&sin, 0, sizeof(sin)); @@ -367,7 +367,7 @@ memset(&sc, 0, sizeof(sc)); sc.fi = true; sc.tf = true; - sc.type = 0x0a; + sc.type = GSM0808_SCT_HR1; setup_codec_list(&sc_list); @@ -400,11 +400,12 @@ { static const uint8_t res1[] = { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, - 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, + 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; static const uint8_t res2[] = { 0x00, 0x0f, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, - 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; uint8_t rr_res = 2; struct msgb *msg; struct gsm0808_speech_codec_list sc_list; @@ -574,7 +575,7 @@ memset(&enc_sc, 0, sizeof(enc_sc)); enc_sc.fi = true; enc_sc.pt = true; - enc_sc.type = 0x05; + enc_sc.type = GSM0808_SCT_FR2; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); @@ -589,6 +590,31 @@ } +static void test_gsm0808_enc_dec_speech_codec_with_cfg() +{ + struct gsm0808_speech_codec enc_sc; + struct gsm0808_speech_codec dec_sc; + struct msgb *msg; + uint8_t rc_enc; + int rc_dec; + + enc_sc.pi = true; + enc_sc.tf = true; + enc_sc.type = GSM0808_SCT_FR3; + enc_sc.cfg = 0xabcd; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); + OSMO_ASSERT(rc_enc == 5); + + rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + + OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() { struct gsm0808_speech_codec enc_sc; @@ -599,44 +625,15 @@ enc_sc.pi = true; enc_sc.tf = true; - enc_sc.type = 0xab; - enc_sc.type_extended = true; - enc_sc.cfg_present = true; - enc_sc.cfg = 0xcdef; + enc_sc.type = GSM0808_SCT_CSD; + enc_sc.cfg = 0xc0; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 6); + OSMO_ASSERT(rc_enc == 5); rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 4); - - OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); - - msgb_free(msg); -} - -static void test_gsm0808_enc_dec_speech_codec_ext() -{ - struct gsm0808_speech_codec enc_sc; - struct gsm0808_speech_codec dec_sc; - struct msgb *msg; - uint8_t rc_enc; - int rc_dec; - - enc_sc.fi = true; - enc_sc.tf = true; - enc_sc.type = 0xf2; - enc_sc.type_extended = true; - enc_sc.cfg_present = false; - enc_sc.cfg = 0x0000; - - msg = msgb_alloc(1024, "output buffer"); - rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 4); - - rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 2); + OSMO_ASSERT(rc_dec == 3); OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); @@ -655,19 +652,17 @@ enc_scl.codec[0].pi = true; enc_scl.codec[0].tf = true; - enc_scl.codec[0].type = 0xab; - enc_scl.codec[0].type_extended = true; - enc_scl.codec[0].cfg_present = true; + enc_scl.codec[0].type = GSM0808_SCT_FR3; enc_scl.codec[0].cfg = 0xcdef; enc_scl.codec[1].fi = true; enc_scl.codec[1].pt = true; - enc_scl.codec[1].type = 0x05; + enc_scl.codec[1].type = GSM0808_SCT_FR2; enc_scl.codec[2].fi = true; enc_scl.codec[2].tf = true; - enc_scl.codec[2].type = 0xf2; - enc_scl.codec[2].type_extended = true; + enc_scl.codec[2].type = GSM0808_SCT_CSD; + enc_scl.codec[2].cfg = 0xc0; enc_scl.len = 3; @@ -860,8 +855,8 @@ test_enc_dec_aoip_trasp_addr_v4(); test_enc_dec_aoip_trasp_addr_v6(); test_gsm0808_enc_dec_speech_codec(); - test_gsm0808_enc_dec_speech_codec_ext(); test_gsm0808_enc_dec_speech_codec_ext_with_cfg(); + test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_channel_type(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 2 09:00:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 09:00:24 +0000 Subject: [PATCH] openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2819 to look at the new patch set (#2). bsc_init: Forget which SIs are valid for the trx Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 12 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/2819/2 diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index e61d4ea..cf54dec 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -25,7 +25,7 @@ #include #include #include - +#include #include struct gsm_bts; @@ -35,8 +35,7 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len); +int rsl_bcch_info(const struct gsm_bts *bts, const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr, diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 7ee19a7..8156ca6 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -226,11 +226,15 @@ /* Send a BCCH_INFO message as per Chapter 8.5.1 */ -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len) +int rsl_bcch_info(const struct gsm_bts *bts, const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, int len) { struct abis_rsl_dchan_hdr *dh; struct msgb *msg = rsl_msgb_alloc(); + uint8_t *data = GSM_BTS_SI(bts, si_type), type = osmo_sitype2rsl(si_type); + + if (bts->c0 != trx) + LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS%u/TRX%u\n", + get_value_string(osmo_sitype_strs, si_type), bts->nr, trx->nr); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof*dh); init_dchan_hdr(dh, RSL_MT_BCCH_INFO); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index caec800..db18070 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -115,8 +115,7 @@ GSM_BTS_SI(bts, i), si_len); break; default: - rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(bts, trx, i, si_len); break; } @@ -135,6 +134,9 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; + /* Zero, forget the state of the SIs */ + bts->si_valid = 0; + /* First, we determine which of the SI messages we actually need */ if (trx == bts->c0) { -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 09:00:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 09:00:25 +0000 Subject: [PATCH] openbsc[master]: Add define to check SI presence Message-ID: Review at https://gerrit.osmocom.org/2821 Add define to check SI presence Add define from OsmoBTS which checks for presence of a given SI message in gsm_bts struct. Rename it to avoid conflicts with OsmoBTS code and to match naming conventions of similar macros. Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Related: OS#1660 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.c 4 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/2821/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 1380a6c..4557367 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -486,6 +486,7 @@ }; #define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) #define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i]) #define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i]) diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index db18070..9284376 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -188,7 +188,7 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; - if (!(bts->si_valid & (1 << i))) + if (!GSM_BTS_HAS_SI(bts, i)) continue; rc = rsl_si(trx, i, si_len[i]); if (rc < 0) diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 644bebd..a074a78 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -774,13 +774,13 @@ /* allow/disallow DTXu */ gsm48_set_dtx(&si3->cell_options, bts->dtxu, bts->dtxu, true); - if ((bts->si_valid & (1 << SYSINFO_TYPE_2ter))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) { LOGP(DRR, LOGL_INFO, "SI 2ter is included.\n"); si_info.si2ter_indicator = 1; } else { si_info.si2ter_indicator = 0; } - if ((bts->si_valid & (1 << SYSINFO_TYPE_2quater))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater)) { LOGP(DRR, LOGL_INFO, "SI 2quater is included, based on %zu EARFCNs and %zu UARFCNs.\n", si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); si_info.si2quater_indicator = 1; diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 36f6993..5a78505 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -105,7 +105,7 @@ r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); if (r > 0) printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", - (bts->si_valid & (1 << SYSINFO_TYPE_2quater)) ? "valid" : "invalid", + GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", bts->si2q_index, bts->si2q_count, r, osmo_hexdump((void *)GSM_BTS_SI2Q(bts), GSM_MACBLOCK_LEN)); else -- To view, visit https://gerrit.osmocom.org/2821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 2 09:18:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 09:18:17 +0000 Subject: [PATCH] openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2819 to look at the new patch set (#3). bsc_init: Forget which SIs are valid for the trx Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 12 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/2819/3 diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index e61d4ea..36e0839 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -25,7 +25,7 @@ #include #include #include - +#include #include struct gsm_bts; @@ -35,7 +35,7 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, +int rsl_bcch_info(const struct gsm_bts *bts, const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 7ee19a7..ef31346 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -226,11 +226,16 @@ /* Send a BCCH_INFO message as per Chapter 8.5.1 */ -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, +int rsl_bcch_info(const struct gsm_bts *bts, const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len) { struct abis_rsl_dchan_hdr *dh; struct msgb *msg = rsl_msgb_alloc(); + uint8_t type = osmo_sitype2rsl(si_type); + + if (bts->c0 != trx) + LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS%u/TRX%u\n", + get_value_string(osmo_sitype_strs, si_type), bts->nr, trx->nr); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof*dh); init_dchan_hdr(dh, RSL_MT_BCCH_INFO); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index caec800..ead9c74 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -115,8 +115,7 @@ GSM_BTS_SI(bts, i), si_len); break; default: - rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(bts, trx, i, GSM_BTS_SI(bts, i), si_len); break; } @@ -135,6 +134,9 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; + /* Zero, forget the state of the SIs */ + bts->si_valid = 0; + /* First, we determine which of the SI messages we actually need */ if (trx == bts->c0) { -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 09:18:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 09:18:17 +0000 Subject: [PATCH] openbsc[master]: Move SI-related defines In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2821 to look at the new patch set (#2). Move SI-related defines * move SI2quater related defines to shared header * add define from OsmoBTS which checks for presence of a given SI message in gsm_bts struct. Rename it to avoid conflicts with OsmoBTS code and to match naming conventions of similar macros. Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Related: OS#1660 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/include/openbsc/rest_octets.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.c 5 files changed, 11 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/2821/2 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 1380a6c..13aee1a 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -26,6 +26,12 @@ #include +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 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; @@ -486,6 +492,7 @@ }; #define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) #define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i]) #define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i]) diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 7b324d3..49a2312 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -5,12 +5,6 @@ #include #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 4-bit index is used */ -#define SI2Q_MAX_NUM 16 -/* length in bits (for single SI2quater message) */ -#define SI2Q_MAX_LEN 160 -#define SI2Q_MIN_LEN 18 - /* generate SI1 rest octets */ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ead9c74..4b69a0e 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -188,7 +188,7 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; - if (!(bts->si_valid & (1 << i))) + if (!GSM_BTS_HAS_SI(bts, i)) continue; rc = rsl_si(trx, i, si_len[i]); if (rc < 0) diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 644bebd..a074a78 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -774,13 +774,13 @@ /* allow/disallow DTXu */ gsm48_set_dtx(&si3->cell_options, bts->dtxu, bts->dtxu, true); - if ((bts->si_valid & (1 << SYSINFO_TYPE_2ter))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) { LOGP(DRR, LOGL_INFO, "SI 2ter is included.\n"); si_info.si2ter_indicator = 1; } else { si_info.si2ter_indicator = 0; } - if ((bts->si_valid & (1 << SYSINFO_TYPE_2quater))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater)) { LOGP(DRR, LOGL_INFO, "SI 2quater is included, based on %zu EARFCNs and %zu UARFCNs.\n", si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); si_info.si2quater_indicator = 1; diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 36f6993..5a78505 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -105,7 +105,7 @@ r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); if (r > 0) printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", - (bts->si_valid & (1 << SYSINFO_TYPE_2quater)) ? "valid" : "invalid", + GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", bts->si2q_index, bts->si2q_count, r, osmo_hexdump((void *)GSM_BTS_SI2Q(bts), GSM_MACBLOCK_LEN)); else -- To view, visit https://gerrit.osmocom.org/2821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 09:40:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 09:40:53 +0000 Subject: [PATCH] osmo-bts[master]: Use SI presence check macro from OpenBSC Message-ID: Review at https://gerrit.osmocom.org/2822 Use SI presence check macro from OpenBSC Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 Related: OS#1660 --- M src/common/sysinfo.c 1 file changed, 11 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/2822/1 diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index d8671c8..df337cc 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,8 +25,6 @@ #include #include -#define BTS_HAS_SI(bts, sinum) ((bts)->si_valid & (1 << sinum)) - /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time) { @@ -77,22 +75,20 @@ /* iterate over 2ter, 2quater, 9, 13 */ /* determine how many SI we need to send on TC=4, * and which of them we send when */ - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && - BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_2ter; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && - (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) || - BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && + (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) || GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_2quater; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_13)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_13; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_9)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_9)) { /* FIXME: check SI3 scheduling info! */ tc4_sub[tc4_cnt] = SYSINFO_TYPE_9; tc4_cnt += 1; @@ -107,21 +103,17 @@ } case 5: /* 2bis, 2ter, 2quater */ - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && + !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); break; case 6: @@ -137,7 +129,7 @@ { struct gsm_bts *b = trx->bts; struct gsm48_system_information_type_3 *si3; - if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) { + if (GSM_BTS_HAS_SI(b, SYSINFO_TYPE_3)) { si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3); return si3->control_channel_desc.bs_ag_blks_res; } -- To view, visit https://gerrit.osmocom.org/2822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 2 10:34:36 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 2 Jun 2017 10:34:36 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: Fix a classic typo of mine Message-ID: Review at https://gerrit.osmocom.org/2823 sccp: Fix a classic typo of mine Change-Id: Ie1194406d9d9c62a513fac35ffa458957809a0e3 --- M include/sccp/sccp_types.h 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/23/2823/1 diff --git a/include/sccp/sccp_types.h b/include/sccp/sccp_types.h index e1dcfe7..f01febc 100644 --- a/include/sccp/sccp_types.h +++ b/include/sccp/sccp_types.h @@ -271,7 +271,7 @@ * messages... as of Q.713 Chapter 4 */ struct sccp_connection_request { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference source_local_reference; uint8_t proto_class; @@ -299,7 +299,7 @@ } __attribute__((packed)); struct sccp_connection_confirm { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; struct sccp_source_reference source_local_reference; @@ -321,7 +321,7 @@ } __attribute__((packed)); struct sccp_connection_refused { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; uint8_t cause; @@ -341,7 +341,7 @@ } __attribute__((packed)); struct sccp_connection_released { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; struct sccp_source_reference source_local_reference; @@ -366,7 +366,7 @@ } __attribute__((packed)); struct sccp_data_form1 { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; uint8_t segmenting; @@ -383,7 +383,7 @@ struct sccp_data_unitdata { - /* mandantory */ + /* mandatory */ uint8_t type; uint8_t proto_class; @@ -422,7 +422,7 @@ struct sccp_data_it { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; struct sccp_source_reference source_local_reference; -- To view, visit https://gerrit.osmocom.org/2823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1194406d9d9c62a513fac35ffa458957809a0e3 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Jun 2 11:33:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 11:33:58 +0000 Subject: [PATCH] osmo-bts[master]: Cleanup SI scheduling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2822 to look at the new patch set (#2). Cleanup SI scheduling * use GSM_BTS_HAS_SI() from OpenBSC instead of local copy * arrange GSM_BTS_HAS_SI() checks to improve readability * constify SI scheduler parameters Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 Related: OS#1660 --- M include/osmo-bts/bts.h M src/common/sysinfo.c 2 files changed, 13 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/2822/2 diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 567772e..9e16e05 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -31,7 +31,7 @@ int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, int is_ag_res); -uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time); +uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time); uint8_t *lchan_sacch_get(struct gsm_lchan *lchan); int lchan_init_lapdm(struct gsm_lchan *lchan); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index d8671c8..7a53627 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,10 +25,8 @@ #include #include -#define BTS_HAS_SI(bts, sinum) ((bts)->si_valid & (1 << sinum)) - /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ -uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time) +uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { struct gsm_bts_role_bts *btsb = bts_role_bts(bts); unsigned int tc4_cnt = 0; @@ -77,22 +75,20 @@ /* iterate over 2ter, 2quater, 9, 13 */ /* determine how many SI we need to send on TC=4, * and which of them we send when */ - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && - BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_2ter; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && - (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) || - BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && + (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) || GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_2quater; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_13)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_13; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_9)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_9)) { /* FIXME: check SI3 scheduling info! */ tc4_sub[tc4_cnt] = SYSINFO_TYPE_9; tc4_cnt += 1; @@ -107,21 +103,17 @@ } case 5: /* 2bis, 2ter, 2quater */ - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && + !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); break; case 6: @@ -137,7 +129,7 @@ { struct gsm_bts *b = trx->bts; struct gsm48_system_information_type_3 *si3; - if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) { + if (GSM_BTS_HAS_SI(b, SYSINFO_TYPE_3)) { si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3); return si3->control_channel_desc.bs_ag_blks_res; } -- To view, visit https://gerrit.osmocom.org/2822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 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 Fri Jun 2 11:33:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 11:33:59 +0000 Subject: [PATCH] osmo-bts[master]: RSL: receive and send multiple SI2q messages Message-ID: Review at https://gerrit.osmocom.org/2824 RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Related: OS#1660 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 49 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/2824/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 0f2b671..da66254 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -292,36 +292,43 @@ 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_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + switch (osmo_si) { + case SYSINFO_TYPE_2quater: + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + memset(GSM_BTS_SI2Q(bts, bts->si2q_index), 0x2b, sizeof(sysinfo_buf_t)); + memcpy(GSM_BTS_SI2Q(bts, bts->si2q_index), TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); + break; + case SYSINFO_TYPE_3: + if (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; + } /* intentional fall-through to copy SI3 data */ + default: + 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); } } else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/2824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 2 11:35:21 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Fri, 2 Jun 2017 11:35:21 +0000 Subject: [PATCH] osmo-hlr[master]: tests/auc: Don't require python3 Message-ID: Review at https://gerrit.osmocom.org/2825 tests/auc: Don't require python3 Our jenkins buildslave does not have python3 installed so call python instead of any specific version. Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Ticket: SYS#3322 --- M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/25/2825/1 diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 0efa7ac..058113c 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Fri Jun 2 12:04:16 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Fri, 2 Jun 2017 12:04:16 +0000 Subject: [PATCH] osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2825 to look at the new patch set (#2). tests/auc: Don't require python3 Our jenkins buildslave does not have python3 installed so call python2 instead. Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Ticket: SYS#3322 --- M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/25/2825/2 diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 0efa7ac..3a1c2b1 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 13:20:46 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Fri, 2 Jun 2017 13:20:46 +0000 Subject: [PATCH] osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2825 to look at the new patch set (#3). tests/auc: Don't require python3 Our jenkins buildslave does not have python3 installed so call python2 instead. Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Ticket: SYS#3322 --- M debian/control M tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/25/2825/3 diff --git a/debian/control b/debian/control index 571c24e..934abea 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ dh-systemd (>= 1.5), autotools-dev, pkg-config, - python3, + python2.7, libosmocore-dev, libosmo-abis-dev, libosmo-netif-dev, diff --git a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py index 0efa7ac..3a1c2b1 100755 --- a/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py +++ b/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 # Convert test sets pasted from 3GPP TS 55.205 to C code. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jun 2 13:57:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:57:47 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh Message-ID: Review at https://gerrit.osmocom.org/2826 jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh Change-Id: Ia030aebd7341f198bc768d2beb6abbe8f57a57a0 --- D contrib/jenkins-build-osmo-bts-octphy.sh 1 file changed, 0 insertions(+), 70 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/26/2826/1 diff --git a/contrib/jenkins-build-osmo-bts-octphy.sh b/contrib/jenkins-build-osmo-bts-octphy.sh deleted file mode 100755 index 4045948..0000000 --- a/contrib/jenkins-build-osmo-bts-octphy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -set -x -e - -base="$PWD" -prefix="$base/inst-osmo-bts-octphy" - -rm -f "$base/osmo-bts-octphy*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -# for gsm_data_shared.* -have_repo openbsc - -# octphy headers -have_repo octphy-2g-headers - - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-octphy_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="$config_opts --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers" ;; - esac - - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -done - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-octphy.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" -- To view, visit https://gerrit.osmocom.org/2826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia030aebd7341f198bc768d2beb6abbe8f57a57a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 2 13:57:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:57:47 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: remove unused file: jenkins-remote-update.sh Message-ID: Review at https://gerrit.osmocom.org/2827 jenkins: remove unused file: jenkins-remote-update.sh Change-Id: I2858331393722d13e05d194656d8ee4dc17253f9 --- D contrib/jenkins-remote-update.sh 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/2827/1 diff --git a/contrib/jenkins-remote-update.sh b/contrib/jenkins-remote-update.sh deleted file mode 100755 index f30855e..0000000 --- a/contrib/jenkins-remote-update.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -e -x - -if [ -z "$OSMO_GSM_TESTER_REMOTE_MAIN_UNIT" ]; then - echo "To run the tests from jenkins, a main unit host must be defined." - echo "e.g. OSMO_GSM_TESTER_REMOTE_MAIN_UNIT=\"user at 10.9.8.7\"" -fi - -osmo_gsm_tester_host="$OSMO_GSM_TESTER_REMOTE_MAIN_UNIT" -osmo_gsm_tester_src="${OSMO_GSM_TESTER_REMOTE_SRC:-/usr/local/src/osmo-gsm-tester}" - -if ssh "$osmo_gsm_tester_host" "test -d \"$osmo_gsm_tester_src\"" ; then - # exists - status="$(ssh "$osmo_gsm_tester_host" "git -C \"$osmo_gsm_tester_src\" status --porcelain")" - if [ "x$status" != "x" ]; then - echo "Remote osmo-gsm-tester is not clean: $osmo_gsm_tester_host:$osmo_gsm_tester_src" - echo "$status" - exit 1 - fi - ssh "$osmo_gsm_tester_host" "cd \"$osmo_gsm_tester_src\"; git clean -fdx; git fetch; git reset --hard origin/master" -else - osmo_gsm_tester_src_dirname="$(dirname "$osmo_gsm_tester_src")" - ssh "$osmo_gsm_tester_host" "git clone git://git.osmocom.org/osmo-gsm-tester.git \"$osmo_gsm_tester_src\"" -fi -- To view, visit https://gerrit.osmocom.org/2827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2858331393722d13e05d194656d8ee4dc17253f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 2 13:57:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:57:47 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: extract common parts of build scripts to separate file Message-ID: Review at https://gerrit.osmocom.org/2828 jenkins: extract common parts of build scripts to separate file Have all complexity in one common shell script, greatly simplify the individual scripts. This allows to provide a specific branch or git hash to build instead of current master. Some scripts allowed to provide branch names before, this now also allows using git hashes directly. Environment variables can be used to override the git hash/branch to use for specific repositories. Motivation for this patch: we need this to investigate failure causes more easily. Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 --- A contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 186 insertions(+), 364 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/2828/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh new file mode 100644 index 0000000..ee5a3ba --- /dev/null +++ b/contrib/jenkins-build-common.sh @@ -0,0 +1,148 @@ +#!source_this_file + +# Common parts for osmo-gsm-tester jenkins build scripts. Use like in below example: +# +#-------------- +# #!/bin/sh +# set -e -x +# base="$PWD" +# name="osmo-name" +# . "$(dirname "$0")/jenkins-build-common.sh" +# +# build_repo libosmocore --configure --opts +# build_repo libosmo-foo special_branch --configure --opts +# build_repo osmo-bar +# +# create_bin_tgz +#-------------- +# +# Some explanations: +# +# To allow calling from arbitrary working directories, other scripts should +# source this file like shown above. +# +# Sourcing scripts must provide some variables/functions, see above. +# In addition, these values can optionally be passed to override: +# git_url, prefix, prefix_real, BUILD_NUMBER +# +# CONFIGURE_FLAGS may contain flags that should be passed to all builds' +# ./configure steps (useful e.g. for building in the sysmobts SDK). +# +# For each built repository, a specific git branch or hash can be provided by +# environment variable: OSMO_GSM_TESTER_BUILD_$repo="" +# NOTE: convert $repo's dashes to underscore. For example: +# OSMO_GSM_TESTER_BUILD_osmo_hlr="f001234abc" +# OSMO_GSM_TESTER_BUILD_libosmocore="my/branch" +# ("origin/" is prepended to branch names automatically) + +if [ -z "$name" -o -z "$base" ]; then + set +x + echo "Some environment variables are not provided as required by jenkins-build-common.sh. Error." + exit 1 +fi + +git_url="${git_url-"git://git.osmocom.org"}" +prefix="${prefix-"$base/inst-$name"}" +# prefix_real is usually identical with prefix, except when installing to a +# different $DESTDIR than /, which is the case for example when building +# osmo-bts within the sysmoBTS SDK +prefix_real="${prefix_real-"$prefix"}" + +export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$prefix_real/lib:$LD_LIBRARY_PATH" + +# Show current environment. Sometimes the LESS_ vars have ansi colors making a +# mess, so exclude those. +env | grep -v "^LESS" | sort + +# clean the workspace +rm -f "$base/${name}*.tgz" rm -f "$base/${name}*.md5" +rm -rf "$prefix_real" +mkdir -p "$prefix_real" + +have_repo() { + repo="$1" + branch="${2-master}" + + # Evaluate environment for instructions to build a specific git hash. + # Using a hash as $branch above unfortunately doesn't work. + branch_override_var="$(echo "OSMO_GSM_TESTER_BUILD_$repo" | sed 's/-/_/g')" + branch_override="$(eval "echo \$$branch_override_var")" + if [ -n "$branch_override" ]; then + branch="$branch_override" + fi + + # Figure out whether we need to prepend origin/ to find branches in upstream + if ! git rev-parse "$branch"; then + branch="origin/$branch" + fi + + cd "$base" + if [ ! -d "$repo" ]; then + git clone "$git_url/$repo" "$repo" + fi + cd "$repo" + rm -rf * + git fetch origin + git reset --hard "$branch" + + git rev-parse HEAD + + cd "$base" +} + +build_repo() { + # usage: build_repo [] [--configure-opts [...]] + dep="$1" + if [ -z "$(echo "$2" | grep '^-')" ]; then + # second arg does not start with a dash, it's empty or a branch + branch="${2-master}" + if [ -n "$2" ]; then + # we had a branch arg, need to shift once more to get config options + shift + fi + fi + shift + configure_opts="$@" + + set +x; echo " + +====================== $dep + +"; set -x + + + have_repo "$dep" "$branch" + + cd "$dep" + + echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/${name}_git_hashes.txt" + + # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir. + if [ "$dep" = "openbsc" ]; then + cd openbsc + fi + + set +x; echo; echo; set -x + autoreconf -fi + set +x; echo; echo; set -x + ./configure --prefix="$prefix" $CONFIGURE_FLAGS $configure_opts + set +x; echo; echo; set -x + make -j8 || make # libsmpp34 can't build in parallel + set +x; echo; echo; set -x + make install +} + +create_bin_tgz() { + # don't package documentation -- the libosmocore docs can be up to 16 Mb large, + # a significant amount compared to the binaries + rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + + # build the archive that is going to be copied to the tester + cd "$prefix_real" + this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" + tar="${this}.tgz" + tar czf "$base/$tar" * + cd "$base" + md5sum "$tar" > "${this}.md5" +} diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index 9838834..8de587d 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -1,92 +1,23 @@ #!/bin/sh set -e -x -deps=" -libosmocore -libosmo-abis -osmo-bts -" +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" base="$PWD" -rm -f "$base/osmo-bts-sysmo.*.tgz" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -for dep in $deps; do - have_repo "$dep" -done +name="osmo-bts-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.h have_repo openbsc -. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi +build_repo libosmocore --disable-pcsc +build_repo libosmo-abis --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include +build_repo osmo-bts -# Cross-compilation: all installations need to be put in the sysmo SDK sysroot -export DESTDIR="/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi" - -prefix_base="/usr/local/jenkins-build" -prefix_base_real="$DESTDIR$prefix_base" -rm -rf "$prefix_base_real" - -prefix="$prefix_base/inst-osmo-bts-sysmo" -prefix_real="$DESTDIR$prefix" -mkdir -p "$prefix_real" - -# Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK: -export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" - -env - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - cd "$base/$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" - - autoreconf -fi - - config_opts="" - case "$dep" in - 'libosmocore') config_opts="--disable-pcsc" ;; - 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix_real/share/doc" - -# build the archive that is going to be copied to the tester and then to the BTS -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix_real" -this="osmo-bts-sysmo.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 1b1d94e..3e61b70 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -1,82 +1,15 @@ #!/bin/sh -set -x -e - +set -e -x base="$PWD" -prefix="$base/inst-osmo-bts-trx" - -rm -f "$base/osmo-bts-trx*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-trx -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} +name="osmo-bts-trx" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +build_repo libosmocore +build_repo libosmo-abis +build_repo osmo-trx --without-sse +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; - 'osmo-trx') config_opts="--without-sse" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-trx.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 6fbebab..8207451 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -1,69 +1,11 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-hlr" - -rm -f "$base/osmo-hlr*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-hlr_git_hashes.txt" - - config_opts="" - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-hlr" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis build_repo osmo-hlr -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc/libosmocore" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-hlr.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f7808ff..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -1,62 +1,8 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-msc" - -rm -f "$base/osmo-msc*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-msc_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu" - cd openbsc/ - ;; - esac - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 || make # libsmpp34 can't build in parallel - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-msc" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis @@ -66,17 +12,6 @@ build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip +build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-msc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 86d787c..76fd6ba 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -1,82 +1,15 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-nitb" +name="osmo-nitb" +. "$(dirname "$0")/jenkins-build-common.sh" -rm -f "$base/osmo-nitb*.tgz" +build_repo libosmocore +build_repo libosmo-abis +build_repo libosmo-netif +build_repo openggsn +build_repo libsmpp34 +build_repo libosmo-sccp +build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -deps=" -libosmocore -libosmo-abis -libosmo-netif -openggsn -libsmpp34 -libosmo-sccp -openbsc -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-nitb_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat" - cd openbsc/ - ;; - esac - - autoreconf -fi - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 || make # libsmpp34 can't build in parallel - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-nitb.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/2828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 2 13:59:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:59:28 +0000 Subject: osmo-gsm-tester[master]: jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia030aebd7341f198bc768d2beb6abbe8f57a57a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 2 13:59:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:59:32 +0000 Subject: osmo-gsm-tester[master]: jenkins: remove unused file: jenkins-remote-update.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2858331393722d13e05d194656d8ee4dc17253f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 2 13:59:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:59:35 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: remove unused file: jenkins-remote-update.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: remove unused file: jenkins-remote-update.sh ...................................................................... jenkins: remove unused file: jenkins-remote-update.sh Change-Id: I2858331393722d13e05d194656d8ee4dc17253f9 --- D contrib/jenkins-remote-update.sh 1 file changed, 0 insertions(+), 24 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-remote-update.sh b/contrib/jenkins-remote-update.sh deleted file mode 100755 index f30855e..0000000 --- a/contrib/jenkins-remote-update.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -e -x - -if [ -z "$OSMO_GSM_TESTER_REMOTE_MAIN_UNIT" ]; then - echo "To run the tests from jenkins, a main unit host must be defined." - echo "e.g. OSMO_GSM_TESTER_REMOTE_MAIN_UNIT=\"user at 10.9.8.7\"" -fi - -osmo_gsm_tester_host="$OSMO_GSM_TESTER_REMOTE_MAIN_UNIT" -osmo_gsm_tester_src="${OSMO_GSM_TESTER_REMOTE_SRC:-/usr/local/src/osmo-gsm-tester}" - -if ssh "$osmo_gsm_tester_host" "test -d \"$osmo_gsm_tester_src\"" ; then - # exists - status="$(ssh "$osmo_gsm_tester_host" "git -C \"$osmo_gsm_tester_src\" status --porcelain")" - if [ "x$status" != "x" ]; then - echo "Remote osmo-gsm-tester is not clean: $osmo_gsm_tester_host:$osmo_gsm_tester_src" - echo "$status" - exit 1 - fi - ssh "$osmo_gsm_tester_host" "cd \"$osmo_gsm_tester_src\"; git clean -fdx; git fetch; git reset --hard origin/master" -else - osmo_gsm_tester_src_dirname="$(dirname "$osmo_gsm_tester_src")" - ssh "$osmo_gsm_tester_host" "git clone git://git.osmocom.org/osmo-gsm-tester.git \"$osmo_gsm_tester_src\"" -fi -- To view, visit https://gerrit.osmocom.org/2827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2858331393722d13e05d194656d8ee4dc17253f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 2 13:59:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 13:59:36 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh ...................................................................... jenkins: remove unused file: jenkins-build-osmo-bts-octphy.sh Change-Id: Ia030aebd7341f198bc768d2beb6abbe8f57a57a0 --- D contrib/jenkins-build-osmo-bts-octphy.sh 1 file changed, 0 insertions(+), 70 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-bts-octphy.sh b/contrib/jenkins-build-osmo-bts-octphy.sh deleted file mode 100755 index 4045948..0000000 --- a/contrib/jenkins-build-osmo-bts-octphy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -set -x -e - -base="$PWD" -prefix="$base/inst-osmo-bts-octphy" - -rm -f "$base/osmo-bts-octphy*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -# for gsm_data_shared.* -have_repo openbsc - -# octphy headers -have_repo octphy-2g-headers - - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-octphy_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="$config_opts --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers" ;; - esac - - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -done - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-octphy.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" -- To view, visit https://gerrit.osmocom.org/2826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia030aebd7341f198bc768d2beb6abbe8f57a57a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 2 14:37:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 14:37:07 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: extract common parts of build scripts to separate file In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2828 to look at the new patch set (#2). jenkins: extract common parts of build scripts to separate file Have all complexity in one common shell script, greatly simplify the individual scripts. This allows to provide a specific branch or git hash to build instead of current master. Some scripts allowed to provide branch names before, this now also allows using git hashes directly. Environment variables can be used to override the git hash/branch to use for specific repositories. Motivation for this patch: we need this to investigate failure causes more easily. Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 --- A contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 188 insertions(+), 364 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/2828/2 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh new file mode 100644 index 0000000..cd1315e --- /dev/null +++ b/contrib/jenkins-build-common.sh @@ -0,0 +1,150 @@ +#!source_this_file + +# Common parts for osmo-gsm-tester jenkins build scripts. Use like in below example: +# +#-------------- +# #!/bin/sh +# set -e -x +# base="$PWD" +# name="osmo-name" +# . "$(dirname "$0")/jenkins-build-common.sh" +# +# build_repo libosmocore --configure --opts +# build_repo libosmo-foo special_branch --configure --opts +# build_repo osmo-bar +# +# create_bin_tgz +#-------------- +# +# Some explanations: +# +# To allow calling from arbitrary working directories, other scripts should +# source this file like shown above. +# +# Sourcing scripts must provide some variables/functions, see above. +# In addition, these values can optionally be passed to override: +# git_url, prefix, prefix_real, BUILD_NUMBER +# +# CONFIGURE_FLAGS may contain flags that should be passed to all builds' +# ./configure steps (useful e.g. for building in the sysmobts SDK). +# +# For each built repository, a specific git branch or hash can be provided by +# environment variable: OSMO_GSM_TESTER_BUILD_$repo="" +# NOTE: convert $repo's dashes to underscore. For example: +# OSMO_GSM_TESTER_BUILD_osmo_hlr="f001234abc" +# OSMO_GSM_TESTER_BUILD_libosmocore="my/branch" +# ("origin/" is prepended to branch names automatically) + +if [ -z "$name" -o -z "$base" ]; then + set +x + echo "Some environment variables are not provided as required by jenkins-build-common.sh. Error." + exit 1 +fi + +git_url="${git_url-"git://git.osmocom.org"}" +prefix="${prefix-"$base/inst-$name"}" +# prefix_real is usually identical with prefix, except when installing to a +# different $DESTDIR than /, which is the case for example when building +# osmo-bts within the sysmoBTS SDK +prefix_real="${prefix_real-"$prefix"}" + +export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$prefix_real/lib:$LD_LIBRARY_PATH" + +# Show current environment. Sometimes the LESS_ vars have ansi colors making a +# mess, so exclude those. +env | grep -v "^LESS" | sort + +# clean the workspace +rm -f "$base/${name}*.tgz" rm -f "$base/${name}*.md5" +rm -rf "$prefix_real" +mkdir -p "$prefix_real" + +have_repo() { + repo="$1" + branch="${2-master}" + + # Evaluate environment for instructions to build a specific git hash. + # Using a hash as $branch above unfortunately doesn't work. + branch_override_var="$(echo "OSMO_GSM_TESTER_BUILD_$repo" | sed 's/-/_/g')" + branch_override="$(eval "echo \$$branch_override_var")" + if [ -n "$branch_override" ]; then + branch="$branch_override" + fi + + cd "$base" + if [ ! -d "$repo" ]; then + git clone "$git_url/$repo" "$repo" + fi + cd "$repo" + rm -rf * + git fetch origin + + # Figure out whether we need to prepend origin/ to find branches in upstream + if ! git rev-parse "$branch"; then + branch="origin/$branch" + fi + + git reset --hard "$branch" + + git rev-parse HEAD + + cd "$base" +} + +build_repo() { + # usage: build_repo [] [--configure-opts [...]] + dep="$1" + unset branch + if [ -z "$(echo "$2" | grep '^-')" ]; then + # second arg does not start with a dash, it's empty or a branch + branch="${2-master}" + if [ -n "$2" ]; then + # we had a branch arg, need to shift once more to get config options + shift + fi + fi + shift + configure_opts="$@" + + set +x; echo " + +====================== $dep + +"; set -x + + + have_repo "$dep" "$branch" + + cd "$dep" + + echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/${name}_git_hashes.txt" + + # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir. + if [ "$dep" = "openbsc" ]; then + cd openbsc + fi + + set +x; echo; echo; set -x + autoreconf -fi + set +x; echo; echo; set -x + ./configure --prefix="$prefix" $CONFIGURE_FLAGS $configure_opts + set +x; echo; echo; set -x + make -j8 || make # libsmpp34 can't build in parallel + set +x; echo; echo; set -x + make install +} + +create_bin_tgz() { + # don't package documentation -- the libosmocore docs can be up to 16 Mb large, + # a significant amount compared to the binaries + rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + + # build the archive that is going to be copied to the tester + cd "$prefix_real" + this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" + tar="${this}.tgz" + tar czf "$base/$tar" * + cd "$base" + md5sum "$tar" > "${this}.md5" +} diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index 9838834..8de587d 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -1,92 +1,23 @@ #!/bin/sh set -e -x -deps=" -libosmocore -libosmo-abis -osmo-bts -" +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" base="$PWD" -rm -f "$base/osmo-bts-sysmo.*.tgz" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -for dep in $deps; do - have_repo "$dep" -done +name="osmo-bts-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.h have_repo openbsc -. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi +build_repo libosmocore --disable-pcsc +build_repo libosmo-abis --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include +build_repo osmo-bts -# Cross-compilation: all installations need to be put in the sysmo SDK sysroot -export DESTDIR="/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi" - -prefix_base="/usr/local/jenkins-build" -prefix_base_real="$DESTDIR$prefix_base" -rm -rf "$prefix_base_real" - -prefix="$prefix_base/inst-osmo-bts-sysmo" -prefix_real="$DESTDIR$prefix" -mkdir -p "$prefix_real" - -# Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK: -export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" - -env - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - cd "$base/$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" - - autoreconf -fi - - config_opts="" - case "$dep" in - 'libosmocore') config_opts="--disable-pcsc" ;; - 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix_real/share/doc" - -# build the archive that is going to be copied to the tester and then to the BTS -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix_real" -this="osmo-bts-sysmo.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 1b1d94e..3e61b70 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -1,82 +1,15 @@ #!/bin/sh -set -x -e - +set -e -x base="$PWD" -prefix="$base/inst-osmo-bts-trx" - -rm -f "$base/osmo-bts-trx*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-trx -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} +name="osmo-bts-trx" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +build_repo libosmocore +build_repo libosmo-abis +build_repo osmo-trx --without-sse +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; - 'osmo-trx') config_opts="--without-sse" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-trx.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 6fbebab..8207451 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -1,69 +1,11 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-hlr" - -rm -f "$base/osmo-hlr*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-hlr_git_hashes.txt" - - config_opts="" - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-hlr" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis build_repo osmo-hlr -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc/libosmocore" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-hlr.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f7808ff..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -1,62 +1,8 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-msc" - -rm -f "$base/osmo-msc*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-msc_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu" - cd openbsc/ - ;; - esac - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 || make # libsmpp34 can't build in parallel - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-msc" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis @@ -66,17 +12,6 @@ build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip +build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-msc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 86d787c..76fd6ba 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -1,82 +1,15 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-nitb" +name="osmo-nitb" +. "$(dirname "$0")/jenkins-build-common.sh" -rm -f "$base/osmo-nitb*.tgz" +build_repo libosmocore +build_repo libosmo-abis +build_repo libosmo-netif +build_repo openggsn +build_repo libsmpp34 +build_repo libosmo-sccp +build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -deps=" -libosmocore -libosmo-abis -libosmo-netif -openggsn -libsmpp34 -libosmo-sccp -openbsc -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-nitb_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat" - cd openbsc/ - ;; - esac - - autoreconf -fi - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 || make # libsmpp34 can't build in parallel - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-nitb.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/2828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 14:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 14:41:06 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: extract common parts of build scripts to separate file In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2828 to look at the new patch set (#3). jenkins: extract common parts of build scripts to separate file Have all complexity in one common shell script, greatly simplify the individual scripts. This allows to provide a specific branch or git hash to build instead of current master. Some scripts allowed to provide branch names before, this now also allows using git hashes directly. Environment variables can be used to override the git hash/branch to use for specific repositories. Motivation for this patch: we need this to investigate failure causes more easily. Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 --- A contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 190 insertions(+), 364 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/2828/3 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh new file mode 100644 index 0000000..4c64dda --- /dev/null +++ b/contrib/jenkins-build-common.sh @@ -0,0 +1,152 @@ +#!source_this_file + +# Common parts for osmo-gsm-tester jenkins build scripts. Use like in below example: +# +#-------------- +# #!/bin/sh +# set -e -x +# base="$PWD" +# name="osmo-name" +# . "$(dirname "$0")/jenkins-build-common.sh" +# +# build_repo libosmocore --configure --opts +# build_repo libosmo-foo special_branch --configure --opts +# build_repo osmo-bar +# +# create_bin_tgz +#-------------- +# +# Some explanations: +# +# To allow calling from arbitrary working directories, other scripts should +# source this file like shown above. +# +# Sourcing scripts must provide some variables/functions, see above. +# In addition, these values can optionally be passed to override: +# git_url, prefix, prefix_real, BUILD_NUMBER +# +# CONFIGURE_FLAGS may contain flags that should be passed to all builds' +# ./configure steps (useful e.g. for building in the sysmobts SDK). +# +# For each built repository, a specific git branch or hash can be provided by +# environment variable: OSMO_GSM_TESTER_BUILD_$repo="" +# NOTE: convert $repo's dashes to underscore. For example: +# OSMO_GSM_TESTER_BUILD_osmo_hlr="f001234abc" +# OSMO_GSM_TESTER_BUILD_libosmocore="my/branch" +# ("origin/" is prepended to branch names automatically) + +if [ -z "$name" -o -z "$base" ]; then + set +x + echo "Some environment variables are not provided as required by jenkins-build-common.sh. Error." + exit 1 +fi + +git_url="${git_url-"git://git.osmocom.org"}" +prefix="${prefix-"$base/inst-$name"}" +# prefix_real is usually identical with prefix, except when installing to a +# different $DESTDIR than /, which is the case for example when building +# osmo-bts within the sysmoBTS SDK +prefix_real="${prefix_real-"$prefix"}" + +export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$prefix_real/lib:$LD_LIBRARY_PATH" + +# Show current environment. Sometimes the LESS_ vars have ansi colors making a +# mess, so exclude those. +env | grep -v "^LESS" | sort + +# clean the workspace +rm -f "$base/${name}*.tgz" rm -f "$base/${name}*.md5" +rm -rf "$prefix_real" +mkdir -p "$prefix_real" + +have_repo() { + repo="$1" + branch="${2-master}" + + # Evaluate environment for instructions to build a specific git hash. + # Using a hash as $branch above unfortunately doesn't work. + branch_override_var="$(echo "OSMO_GSM_TESTER_BUILD_$repo" | sed 's/-/_/g')" + branch_override="$(eval "echo \$$branch_override_var")" + if [ -n "$branch_override" ]; then + branch="$branch_override" + fi + + cd "$base" + if [ ! -d "$repo" ]; then + git clone "$git_url/$repo" "$repo" + fi + cd "$repo" + rm -rf * + git fetch origin + + # Figure out whether we need to prepend origin/ to find branches in upstream + if ! git rev-parse "$branch"; then + branch="origin/$branch" + fi + + git reset --hard "$branch" + + git rev-parse HEAD + + cd "$base" +} + +build_repo() { + # usage: build_repo [] [--configure-opts [...]] + dep="$1" + branch="master" + if [ -z "$(echo "$2" | grep '^-')" ]; then + # second arg does not start with a dash, it's empty or a branch + branch="$2" + if [ -n "$branch" ]; then + # we had a branch arg, need to shift once more to get config options + shift + else + branch="master" + fi + fi + shift + configure_opts="$@" + + set +x; echo " + +====================== $dep + +"; set -x + + + have_repo "$dep" "$branch" + + cd "$dep" + + echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/${name}_git_hashes.txt" + + # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir. + if [ "$dep" = "openbsc" ]; then + cd openbsc + fi + + set +x; echo; echo; set -x + autoreconf -fi + set +x; echo; echo; set -x + ./configure --prefix="$prefix" $CONFIGURE_FLAGS $configure_opts + set +x; echo; echo; set -x + make -j8 || make # libsmpp34 can't build in parallel + set +x; echo; echo; set -x + make install +} + +create_bin_tgz() { + # don't package documentation -- the libosmocore docs can be up to 16 Mb large, + # a significant amount compared to the binaries + rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + + # build the archive that is going to be copied to the tester + cd "$prefix_real" + this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" + tar="${this}.tgz" + tar czf "$base/$tar" * + cd "$base" + md5sum "$tar" > "${this}.md5" +} diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index 9838834..8de587d 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -1,92 +1,23 @@ #!/bin/sh set -e -x -deps=" -libosmocore -libosmo-abis -osmo-bts -" +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" base="$PWD" -rm -f "$base/osmo-bts-sysmo.*.tgz" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -for dep in $deps; do - have_repo "$dep" -done +name="osmo-bts-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.h have_repo openbsc -. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi +build_repo libosmocore --disable-pcsc +build_repo libosmo-abis --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include +build_repo osmo-bts -# Cross-compilation: all installations need to be put in the sysmo SDK sysroot -export DESTDIR="/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi" - -prefix_base="/usr/local/jenkins-build" -prefix_base_real="$DESTDIR$prefix_base" -rm -rf "$prefix_base_real" - -prefix="$prefix_base/inst-osmo-bts-sysmo" -prefix_real="$DESTDIR$prefix" -mkdir -p "$prefix_real" - -# Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK: -export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" - -env - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - cd "$base/$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" - - autoreconf -fi - - config_opts="" - case "$dep" in - 'libosmocore') config_opts="--disable-pcsc" ;; - 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix_real/share/doc" - -# build the archive that is going to be copied to the tester and then to the BTS -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix_real" -this="osmo-bts-sysmo.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 1b1d94e..3e61b70 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -1,82 +1,15 @@ #!/bin/sh -set -x -e - +set -e -x base="$PWD" -prefix="$base/inst-osmo-bts-trx" - -rm -f "$base/osmo-bts-trx*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-trx -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} +name="osmo-bts-trx" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +build_repo libosmocore +build_repo libosmo-abis +build_repo osmo-trx --without-sse +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; - 'osmo-trx') config_opts="--without-sse" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-trx.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 6fbebab..8207451 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -1,69 +1,11 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-hlr" - -rm -f "$base/osmo-hlr*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-hlr_git_hashes.txt" - - config_opts="" - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-hlr" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis build_repo osmo-hlr -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc/libosmocore" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-hlr.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f7808ff..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -1,62 +1,8 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-msc" - -rm -f "$base/osmo-msc*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-msc_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu" - cd openbsc/ - ;; - esac - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 || make # libsmpp34 can't build in parallel - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-msc" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis @@ -66,17 +12,6 @@ build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip +build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-msc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 86d787c..76fd6ba 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -1,82 +1,15 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-nitb" +name="osmo-nitb" +. "$(dirname "$0")/jenkins-build-common.sh" -rm -f "$base/osmo-nitb*.tgz" +build_repo libosmocore +build_repo libosmo-abis +build_repo libosmo-netif +build_repo openggsn +build_repo libsmpp34 +build_repo libosmo-sccp +build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -deps=" -libosmocore -libosmo-abis -libosmo-netif -openggsn -libsmpp34 -libosmo-sccp -openbsc -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-nitb_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat" - cd openbsc/ - ;; - esac - - autoreconf -fi - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 || make # libsmpp34 can't build in parallel - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-nitb.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/2828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 14:58:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 14:58:49 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: extract common parts of build scripts to separate file In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2828 to look at the new patch set (#4). jenkins: extract common parts of build scripts to separate file Have all complexity in one common shell script, greatly simplify the individual scripts. This allows to provide a specific branch or git hash to build instead of current master. Some scripts allowed to provide branch names before, this now also allows using git hashes directly. Environment variables can be used to override the git hash/branch to use for specific repositories. Motivation for this patch: we need this to investigate failure causes more easily. Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 --- A contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 190 insertions(+), 364 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/2828/4 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh new file mode 100644 index 0000000..921434d --- /dev/null +++ b/contrib/jenkins-build-common.sh @@ -0,0 +1,152 @@ +#!source_this_file + +# Common parts for osmo-gsm-tester jenkins build scripts. Use like in below example: +# +#-------------- +# #!/bin/sh +# set -e -x +# base="$PWD" +# name="osmo-name" +# . "$(dirname "$0")/jenkins-build-common.sh" +# +# build_repo libosmocore --configure --opts +# build_repo libosmo-foo special_branch --configure --opts +# build_repo osmo-bar +# +# create_bin_tgz +#-------------- +# +# Some explanations: +# +# To allow calling from arbitrary working directories, other scripts should +# source this file like shown above. +# +# Sourcing scripts must provide some variables/functions, see above. +# In addition, these values can optionally be passed to override: +# git_url, prefix, prefix_real, BUILD_NUMBER +# +# CONFIGURE_FLAGS may contain flags that should be passed to all builds' +# ./configure steps (useful e.g. for building in the sysmobts SDK). +# +# For each built repository, a specific git branch or hash can be provided by +# environment variable: OSMO_GSM_TESTER_BUILD_$repo="" +# NOTE: convert $repo's dashes to underscore. For example: +# OSMO_GSM_TESTER_BUILD_osmo_hlr="f001234abc" +# OSMO_GSM_TESTER_BUILD_libosmocore="my/branch" +# ("origin/" is prepended to branch names automatically) + +if [ -z "$name" -o -z "$base" ]; then + set +x + echo "Some environment variables are not provided as required by jenkins-build-common.sh. Error." + exit 1 +fi + +git_url="${git_url-"git://git.osmocom.org"}" +prefix="${prefix-"$base/inst-$name"}" +# prefix_real is usually identical with prefix, except when installing to a +# different $DESTDIR than /, which is the case for example when building +# osmo-bts within the sysmoBTS SDK +prefix_real="${prefix_real-"$prefix"}" + +export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$prefix_real/lib:$LD_LIBRARY_PATH" + +# Show current environment. Sometimes the LESS_ vars have ansi colors making a +# mess, so exclude those. +env | grep -v "^LESS" | sort + +# clean the workspace +rm -f "$base/${name}"*.tgz rm -f "$base/${name}"*.md5 +rm -rf "$prefix_real" +mkdir -p "$prefix_real" + +have_repo() { + repo="$1" + branch="${2-master}" + + # Evaluate environment for instructions to build a specific git hash. + # Using a hash as $branch above unfortunately doesn't work. + branch_override_var="$(echo "OSMO_GSM_TESTER_BUILD_$repo" | sed 's/-/_/g')" + branch_override="$(eval "echo \$$branch_override_var")" + if [ -n "$branch_override" ]; then + branch="$branch_override" + fi + + cd "$base" + if [ ! -d "$repo" ]; then + git clone "$git_url/$repo" "$repo" + fi + cd "$repo" + rm -rf * + git fetch origin + + # Figure out whether we need to prepend origin/ to find branches in upstream + if ! git rev-parse "$branch"; then + branch="origin/$branch" + fi + + git reset --hard "$branch" + + git rev-parse HEAD + + cd "$base" +} + +build_repo() { + # usage: build_repo [] [--configure-opts [...]] + dep="$1" + branch="master" + if [ -z "$(echo "$2" | grep '^-')" ]; then + # second arg does not start with a dash, it's empty or a branch + branch="$2" + if [ -n "$branch" ]; then + # we had a branch arg, need to shift once more to get config options + shift + else + branch="master" + fi + fi + shift + configure_opts="$@" + + set +x; echo " + +====================== $dep + +"; set -x + + + have_repo "$dep" "$branch" + + cd "$dep" + + echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/${name}_git_hashes.txt" + + # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir. + if [ "$dep" = "openbsc" ]; then + cd openbsc + fi + + set +x; echo; echo; set -x + autoreconf -fi + set +x; echo; echo; set -x + ./configure --prefix="$prefix" $CONFIGURE_FLAGS $configure_opts + set +x; echo; echo; set -x + make -j8 || make # libsmpp34 can't build in parallel + set +x; echo; echo; set -x + make install +} + +create_bin_tgz() { + # don't package documentation -- the libosmocore docs can be up to 16 Mb large, + # a significant amount compared to the binaries + rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + + # build the archive that is going to be copied to the tester + cd "$prefix_real" + this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" + tar="${this}.tgz" + tar czf "$base/$tar" * + cd "$base" + md5sum "$tar" > "${this}.md5" +} diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index 9838834..dad2151 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -1,92 +1,23 @@ #!/bin/sh set -e -x -deps=" -libosmocore -libosmo-abis -osmo-bts -" +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" base="$PWD" -rm -f "$base/osmo-bts-sysmo.*.tgz" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -for dep in $deps; do - have_repo "$dep" -done +name="osmo-bts-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.h have_repo openbsc -. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi +build_repo libosmocore --disable-pcsc +build_repo libosmo-abis +build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include -# Cross-compilation: all installations need to be put in the sysmo SDK sysroot -export DESTDIR="/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi" - -prefix_base="/usr/local/jenkins-build" -prefix_base_real="$DESTDIR$prefix_base" -rm -rf "$prefix_base_real" - -prefix="$prefix_base/inst-osmo-bts-sysmo" -prefix_real="$DESTDIR$prefix" -mkdir -p "$prefix_real" - -# Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK: -export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" - -env - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - cd "$base/$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" - - autoreconf -fi - - config_opts="" - case "$dep" in - 'libosmocore') config_opts="--disable-pcsc" ;; - 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix_real/share/doc" - -# build the archive that is going to be copied to the tester and then to the BTS -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix_real" -this="osmo-bts-sysmo.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 1b1d94e..3e61b70 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -1,82 +1,15 @@ #!/bin/sh -set -x -e - +set -e -x base="$PWD" -prefix="$base/inst-osmo-bts-trx" - -rm -f "$base/osmo-bts-trx*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-trx -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} +name="osmo-bts-trx" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +build_repo libosmocore +build_repo libosmo-abis +build_repo osmo-trx --without-sse +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; - 'osmo-trx') config_opts="--without-sse" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-trx.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 6fbebab..8207451 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -1,69 +1,11 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-hlr" - -rm -f "$base/osmo-hlr*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-hlr_git_hashes.txt" - - config_opts="" - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-hlr" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis build_repo osmo-hlr -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc/libosmocore" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-hlr.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f7808ff..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -1,62 +1,8 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-msc" - -rm -f "$base/osmo-msc*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-msc_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu" - cd openbsc/ - ;; - esac - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 || make # libsmpp34 can't build in parallel - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-msc" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis @@ -66,17 +12,6 @@ build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip +build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-msc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 86d787c..76fd6ba 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -1,82 +1,15 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-nitb" +name="osmo-nitb" +. "$(dirname "$0")/jenkins-build-common.sh" -rm -f "$base/osmo-nitb*.tgz" +build_repo libosmocore +build_repo libosmo-abis +build_repo libosmo-netif +build_repo openggsn +build_repo libsmpp34 +build_repo libosmo-sccp +build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -deps=" -libosmocore -libosmo-abis -libosmo-netif -openggsn -libsmpp34 -libosmo-sccp -openbsc -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-nitb_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat" - cd openbsc/ - ;; - esac - - autoreconf -fi - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 || make # libsmpp34 can't build in parallel - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-nitb.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/2828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 2 15:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 2 Jun 2017 15:20:47 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add default speech codec configuration Message-ID: Review at https://gerrit.osmocom.org/2829 gsm0808: add default speech codec configuration In an AoIP scenario, the speech codec list field specifies the codecs used in the RTP interface. This patch adds a table with default codec configurations that match the codec configurations that are also used on the air interface. Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/2829/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e93b8bc..f7cd1cb 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -449,6 +449,26 @@ uint16_t cfg; }; +/* Default speech codec configurations: Some codecs specified with + * struct gsm0808_speech_codec, require a configuration (cfg). The following + * default configuration will configure the codec (RTP) to match the + * configuration that is used on the air interface (Um). */ +enum gsm0808_speech_codec_defaults { + /* Default values for FR_AMR, HR_AMR and OHR_AMR: + * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations + * for the Adaptive Multi-Rate Codec Types */ + GSM0808_SC_CFG_DEFAULT_FR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_HR_AMR = 0x073f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR = 0xffff, + + /* Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: + * See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations for the + * Adaptive Multi-Rate ? Wideband Codec Types */ + GSM0808_SC_CFG_DEFAULT_FR_AMR_WB = 0x01, + GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB = 0x3f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01, +}; + /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ #define SPEECH_CODEC_MAXLEN 255 struct gsm0808_speech_codec_list { -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 2 15:20:47 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 2 Jun 2017 15:20:47 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to translate perm speech to speech co... Message-ID: Review at https://gerrit.osmocom.org/2830 gsm0808: add function to translate perm speech to speech codec type The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 50 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/1 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..59f64ca 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,8 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +/* Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index c0c2cc2..edd6317 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -653,3 +653,47 @@ cil->id_list_len = item_count; return (int)(elem - old_elem); } + +/* Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) +{ + /* The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + break; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + break; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + break; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + break; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + break; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + break; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + break; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + break; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + break; + } + + /* Invalid input */ + return -EINVAL; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 8fb9878..c48b0fc 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 2 15:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 2 Jun 2017 15:20:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to extrapolate speech codec Message-ID: Review at https://gerrit.osmocom.org/2831 gsm0808: add function to extrapolate speech codec The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/1 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 59f64ca..2a53508 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -76,3 +76,7 @@ * that is used in struct gsm0808_channel_type to the speech codec * representation we use in struct gsm0808_speech_codec */ int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); + +/* Extrapolate a speech codec field from a given permitted speech parameter */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index edd6317..dcefde5 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -697,3 +697,54 @@ /* Invalid input */ return -EINVAL; } + +/* Extrapolate a speech codec field from a given permitted speech parameter */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + /* Note: This function accepts the permitted speech configuration + * from the channel type information and computes an AoIP speech + * codec that field that consistantly matches the channel type + * configuration. This will basically reflect a non-transcoding- + * situation. (In transcoding scenarios, the codec used in the RTP + * stream may be differ from the codec used on the air interface) */ + + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the, pick a default codc configuration, that + * exactly matches the configuration on the air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index c48b0fc..e27fd1a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 2 15:21:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 2 Jun 2017 15:21:26 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: gsm0808: add function to translate perm speech to speech codec type The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 50 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/2 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..59f64ca 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,8 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +/* Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index c0c2cc2..edd6317 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -653,3 +653,47 @@ cil->id_list_len = item_count; return (int)(elem - old_elem); } + +/* Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) +{ + /* The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + break; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + break; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + break; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + break; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + break; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + break; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + break; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + break; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + break; + } + + /* Invalid input */ + return -EINVAL; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 8fb9878..c48b0fc 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 2 15:21:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 2 Jun 2017 15:21:26 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to extrapolate speech codec In-Reply-To: References: Message-ID: gsm0808: add function to extrapolate speech codec The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/2 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 59f64ca..2a53508 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -76,3 +76,7 @@ * that is used in struct gsm0808_channel_type to the speech codec * representation we use in struct gsm0808_speech_codec */ int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); + +/* Extrapolate a speech codec field from a given permitted speech parameter */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index edd6317..dcefde5 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -697,3 +697,54 @@ /* Invalid input */ return -EINVAL; } + +/* Extrapolate a speech codec field from a given permitted speech parameter */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + /* Note: This function accepts the permitted speech configuration + * from the channel type information and computes an AoIP speech + * codec that field that consistantly matches the channel type + * configuration. This will basically reflect a non-transcoding- + * situation. (In transcoding scenarios, the codec used in the RTP + * stream may be differ from the codec used on the air interface) */ + + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the, pick a default codc configuration, that + * exactly matches the configuration on the air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index c48b0fc..e27fd1a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 2 15:54:44 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 2 Jun 2017 15:54:44 +0000 Subject: [PATCH] osmo-bts[master]: measurement: Fix measurement reporting period tables In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2795 to look at the new patch set (#2). measurement: Fix measurement reporting period tables The offsets, which are subtracted from the values specified in the measurement period tables (tchh0_meas_rep_fn104[] and tchh1_meas_rep_fn104[]) for half rate are off by one. Change-Id: I4e0fdf081e0e28bed7d2b04f47ebc26bd2b94658 --- M src/common/measurement.c 1 file changed, 17 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/2795/2 diff --git a/src/common/measurement.c b/src/common/measurement.c index 22ab27c..e4d243f 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -36,28 +36,27 @@ [7] = 90 - 1, }; -/* Added (-2) offset in DATA-IND frame number to align with Meas period ends */ +/* Added (-1) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchh0_meas_rep_fn104[] = { - [0] = 103 - 2, - [1] = 103 - 2, - [2] = 25 - 2, - [3] = 25 - 2, - [4] = 51 - 2, - [5] = 51 - 2, - [6] = 77 - 2, - [7] = 77 - 2, + [0] = 103 - 1, + [1] = 103 - 1, + [2] = 25 - 1, + [3] = 25 - 1, + [4] = 51 - 1, + [5] = 51 - 1, + [6] = 77 - 1, + [7] = 77 - 1, }; -/* Added (-1) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12 - 1, - [1] = 12 - 1, - [2] = 38 - 1, - [3] = 38 - 1, - [4] = 64 - 1, - [5] = 64 - 1, - [6] = 90 - 1, - [7] = 90 - 1, + [0] = 12, + [1] = 12, + [2] = 38, + [3] = 38, + [4] = 64, + [5] = 64, + [6] = 90, + [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan -- To view, visit https://gerrit.osmocom.org/2795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4e0fdf081e0e28bed7d2b04f47ebc26bd2b94658 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 Jun 2 16:08:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 2 Jun 2017 16:08:30 +0000 Subject: [PATCH] openbsc[master]: Update SI data structures and generation Message-ID: Review at https://gerrit.osmocom.org/2832 Update SI data structures and generation To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660 --- M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/include/openbsc/system_information.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.c M openbsc/tests/gsm0408/gsm0408_test.ok 9 files changed, 353 insertions(+), 164 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/32/2832/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 6d814c8..d1b4ad2 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -29,6 +29,13 @@ #define tmsi_from_string(str) strtoul(str, NULL, 10) +/* 3-bit long values */ +#define EARFCN_PRIO_INVALID 8 +#define EARFCN_MEAS_BW_INVALID 8 +/* 5-bit long values */ +#define EARFCN_QRXLV_INVALID 32 +#define EARFCN_THRESH_LOW_INVALID 32 + enum gsm_security_event { GSM_SECURITY_NOAVAIL, GSM_SECURITY_AUTH_FAILED, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 13aee1a..787f6b6 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -26,7 +26,8 @@ #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 4-bit index is used (2#1111 = 10#15) */ +/* 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 @@ -301,8 +302,9 @@ /* 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 */ - sysinfo_buf_t buf[_MAX_SYSINFO_TYPE]; + /* 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; @@ -491,10 +493,10 @@ struct gsm_bts_trx_ts ts[TRX_NR_TS]; }; -#define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater]) +#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]) -#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[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, @@ -728,7 +730,7 @@ 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]; + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; /* offsets used while generating SI2quater */ size_t e_offset; size_t u_offset; diff --git a/openbsc/include/openbsc/system_information.h b/openbsc/include/openbsc/system_information.h index 21016b8..71bea26 100644 --- a/openbsc/include/openbsc/system_information.h +++ b/openbsc/include/openbsc/system_information.h @@ -14,6 +14,8 @@ int range_encode(enum gsm48_range r, int *arfcns, int arfcns_used, int *w, int f0, uint8_t *chan_list); uint8_t si2q_num(struct gsm_bts *bts); +int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, + uint8_t qrx, uint8_t meas_bw); int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble); int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 4b69a0e..a6820e5 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -101,7 +101,7 @@ static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) { struct gsm_bts *bts = trx->bts; - int rc; + int rc, j; DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); @@ -114,6 +114,10 @@ rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), GSM_BTS_SI(bts, i), si_len); break; + case SYSINFO_TYPE_2quater: + for (j = 0; j <= bts->si2q_count; j++) + rc = rsl_bcch_info(bts, trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); + break; default: rc = rsl_bcch_info(bts, trx, i, GSM_BTS_SI(bts, i), si_len); break; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index f17bde6..19b8d5f 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -2774,6 +2774,7 @@ return CMD_SUCCESS; } +/* help text should be kept in sync with EARFCN_*_INVALID defines */ DEFUN(cfg_bts_si2quater_neigh_add, cfg_bts_si2quater_neigh_add_cmd, "si2quater neighbor-list add earfcn <0-65535> thresh-hi <0-31> " "thresh-lo <0-32> prio <0-8> qrxlv <0-32> meas <0-8>", @@ -2791,54 +2792,37 @@ uint16_t arfcn = atoi(argv[0]); uint8_t thresh_hi = atoi(argv[1]), thresh_lo = atoi(argv[2]), prio = atoi(argv[3]), qrx = atoi(argv[4]), meas = atoi(argv[5]); - int r = osmo_earfcn_add(e, arfcn, - (meas < 8) ? meas : OSMO_EARFCN_MEAS_INVALID); + int r = bts_earfcn_add(bts, arfcn, thresh_hi, thresh_lo, prio, qrx, meas); - if (r < 0) { - vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), - VTY_NEWLINE); - return CMD_WARNING; + switch (r) { + case 1: + vty_out(vty, "Warning: multiple threshold-high are not supported, overriding with %u%s", + thresh_hi, VTY_NEWLINE); + break; + case EARFCN_THRESH_LOW_INVALID: + vty_out(vty, "Warning: multiple threshold-low are not supported, overriding with %u%s", + thresh_lo, VTY_NEWLINE); + break; + case EARFCN_QRXLV_INVALID + 1: + vty_out(vty, "Warning: multiple QRXLEVMIN are not supported, overriding with %u%s", + qrx, VTY_NEWLINE); + break; + case EARFCN_PRIO_INVALID: + vty_out(vty, "Warning: multiple priorities are not supported, overriding with %u%s", + prio, VTY_NEWLINE); + break; + default: + if (r < 0) { + vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), VTY_NEWLINE); + return CMD_WARNING; + } } - if (e->thresh_hi && thresh_hi != e->thresh_hi) - vty_out(vty, "Warning: multiple threshold-high are not " - "supported, overriding previous threshold %u%s", - e->thresh_hi, VTY_NEWLINE); - - e->thresh_hi = thresh_hi; - - if (thresh_lo != 32) { - if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) - vty_out(vty, "Warning: multiple threshold-low are not " - "supported, overriding previous threshold %u%s", - e->thresh_lo, VTY_NEWLINE); - e->thresh_lo = thresh_lo; - e->thresh_lo_valid = true; - } - - if (qrx != 32) { - if (e->qrxlm_valid && e->qrxlm != qrx) - vty_out(vty, "Warning: multiple QRXLEVMIN are not " - "supported, overriding previous value %u%s", - e->qrxlm, VTY_NEWLINE); - e->qrxlm = qrx; - e->qrxlm_valid = true; - } - - if (prio != 8) { - if (e->prio_valid && e->prio != prio) - vty_out(vty, "Warning: multiple priorities are not " - "supported, overriding previous value %u%s", - e->prio, VTY_NEWLINE); - e->prio = prio; - e->prio_valid = true; - } - - if (si2q_num(bts) < 2) /* FIXME: use SI2Q_MAX_NUM */ + if (si2q_num(bts) <= SI2Q_MAX_NUM) return CMD_SUCCESS; vty_out(vty, "Warning: not enough space in SI2quater (%u/%u used) for a given EARFCN %u%s", - bts->si2q_count, 2, arfcn, VTY_NEWLINE); /* FIXME: use SI2Q_MAX_NUM */ + bts->si2q_count, SI2Q_MAX_NUM, arfcn, VTY_NEWLINE); osmo_earfcn_del(e, arfcn); return CMD_WARNING; @@ -2877,16 +2861,14 @@ switch(bts_uarfcn_add(bts, arfcn, scramble, atoi(argv[2]))) { case -ENOMEM: - vty_out(vty, "Unable to add arfcn: max number of UARFCNs (%u) " - "reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); + vty_out(vty, "Unable to add UARFCN: max number of UARFCNs (%u) reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); return CMD_WARNING; case -ENOSPC: - vty_out(vty, "Warning: not enough space in si2quater for a " - "given arfcn%s", VTY_NEWLINE); + vty_out(vty, "Warning: not enough space in SI2quater for a given UARFCN (%u, %u)%s", + arfcn, scramble, VTY_NEWLINE); return CMD_WARNING; case -EADDRINUSE: - vty_out(vty, "Unable to add arfcn: (%u, %u) is already added%s", - arfcn, scramble, VTY_NEWLINE); + vty_out(vty, "Unable to add UARFCN: (%u, %u) is already added%s", arfcn, scramble, VTY_NEWLINE); return CMD_WARNING; } diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index a6fdf46..fdab70a 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -65,6 +65,12 @@ 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 */ + + if (budget <= 6) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + /* first we have to properly adjust budget requirements */ if (e->prio_valid) /* E-UTRAN_PRIORITY: 3GPP TS 45.008*/ rem -= 4; @@ -87,16 +93,17 @@ if (skip < offset) { skip++; /* ignore EARFCNs added on previous calls */ } else { - earfcn_budget = 17; /* computer budget per-EARFCN */ + earfcn_budget = 17; /* compute budget per-EARFCN */ if (OSMO_EARFCN_MEAS_INVALID == e->meas_bw[i]) earfcn_budget++; else earfcn_budget += 4; - if (rem - earfcn_budget < 0) { + if (rem - earfcn_budget < 0) break; - } else { + else { bts->e_offset++; + rem -= earfcn_budget; bitvec_set_bit(bv, 1); /* EARFCN: */ bitvec_set_uint(bv, e->arfcn[i], 16); @@ -143,6 +150,12 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { + int rem = budget - 25; + if (rem <= 0) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + /* Additions in Rel-5: */ bitvec_set_bit(bv, H); /* No 3G Additional Measurement Param. Descr. */ @@ -191,7 +204,7 @@ 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, budget - 25); + append_eutran_neib_cell(bv, bts, rem); /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ bitvec_set_bit(bv, 0); @@ -267,7 +280,12 @@ 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]; uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ - uint8_t rem = budget - 7; /* account for constant bits right away */ + uint8_t rem = budget - 7, offset_diff; /* account for constant bits right away */ + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + + if (budget <= 7) + return -ENOMEM; /* 3G Neighbour Cell Description */ bitvec_set_bit(bv, 1); @@ -282,20 +300,22 @@ bitvec_set_bit(bv, 0); for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - for (j = st, k = 0; j < i; j++) + offset_diff = 0; + for (j = st, k = 0; j < i; j++) { a[k++] = sc[j]; /* copy corresponding SCs */ - + offset_diff++; /* compute proper offset step */ + } 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; } - if (rem - rc < 0) { + if (rem - rc <= 0) break; /* we have ran out of budget in current SI2q */ - } else { + else { rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset++; + bts->u_offset += offset_diff; } cu = u[i]; st = i; /* update start position */ @@ -303,9 +323,11 @@ } if (rem > 22) { /* add last UARFCN not covered by previous cycle if it could possibly fit into budget */ - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++) + 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; @@ -313,7 +335,7 @@ if (rem - rc >= 0) { rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset++; + bts->u_offset += offset_diff; } } @@ -331,6 +353,10 @@ { int rc; struct bitvec bv; + + if (bts->si2q_count < bts->si2q_index) + return -EINVAL; + bv.data = data; bv.data_len = 20; bitvec_zero(&bv); @@ -362,34 +388,28 @@ /* No extension (length) */ bitvec_set_bit(&bv, 0); - if (bts->si_common.uarfcn_length) { - /* Even if we do not append EARFCN we still need to set 3 bits */ - rc = append_uarfcns(&bv, bts, SI2Q_MAX_LEN - (bv.cur_bit + 3)); + 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: failed to append %zu UARFCNs due to range encoding failure: %s\n", - bts->si_common.uarfcn_length, strerror(-rc)); + 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 */ + } else /* No 3G Neighbour Cell Description */ bitvec_set_bit(&bv, 0); - } /* No 3G Measurement Parameters Description */ bitvec_set_bit(&bv, 0); /* No GPRS_3G_MEASUREMENT Parameters Descr. */ bitvec_set_bit(&bv, 0); - if (si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) { - append_earfcn(&bv, bts, SI2Q_MAX_LEN - bv.cur_bit); - - /* FIXME: remove following check once multiple SI2q are properly supported */ - if ((bts->e_offset != si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) || - si2q_earfcn_count(&bts->si_common.si2quater_neigh_list) > 5) - return -ENOMEM; - } else { - /* No Additions in Rel-5: */ + rc = SI2Q_MAX_LEN - bv.cur_bit; + if (rc > 0 && si2q_earfcn_count(&bts->si_common.si2quater_neigh_list) - bts->e_offset > 0) + append_earfcn(&bv, bts, rc); + else /* No Additions in Rel-5: */ bitvec_set_bit(&bv, L); - } bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); return bv.data_len; diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index a074a78..dcabbbd 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -122,50 +122,73 @@ } } -static inline unsigned earfcn_size(const struct gsm_bts *bts) +size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) { - const struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; /* EARFCN */ + unsigned i, ret = 0; - /* account for all the constant bits in append_earfcn() */ - return 25 + osmo_earfcn_bit_size_ext(e, bts->e_offset); + if (!e) + return 0; + + for (i = 0; i < e->length; i++) + if (e->arfcn[i] != OSMO_EARFCN_INVALID) + ret++; + + return ret; } -static inline unsigned uarfcn_size(const struct gsm_bts *bts) +/* generate SI2quater messages, return rest octets length of last generated message or negative error code */ +static int make_si2quaters(struct gsm_bts *bts, bool counting) { - const uint16_t *u = bts->si_common.data.uarfcn_list; - uint16_t cu = u[bts->u_offset]; /* UARFCN */ - /* account for all the constant bits in append_uarfcns() */ - unsigned s = 7, append = 22, r = 0, i, st = 0, j, k; + int rc; + bool memory_exceeded = true; + struct gsm48_system_information_type_2quater *si2q; - for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - for (j = st, k = 0; j < i; j++, k++); - if (u[i] != cu) { /* we've reached new UARFCN */ - r += (append + range1024_p(k)); - cu = u[i]; - st = i; /* update start position */ + for (bts->si2q_index = 0; bts->si2q_index < SI2Q_MAX_NUM; bts->si2q_index++) { + si2q = GSM_BTS_SI2Q(bts, bts->si2q_index); + if (counting) { /* that's legitimate if we're called for counting purpose: */ + if (bts->si2q_count < bts->si2q_index) + bts->si2q_count = bts->si2q_index; + } else { + memset(si2q, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + + si2q->header.l2_plen = GSM48_LEN2PLEN(22); + si2q->header.rr_protocol_discriminator = GSM48_PDISC_RR; + si2q->header.skip_indicator = 0; + si2q->header.system_information = GSM48_MT_RR_SYSINFO_2quater; + } + + rc = rest_octets_si2quater(si2q->rest_octets, bts); + if (rc < 0) + return rc; + + if (bts->u_offset >= bts->si_common.uarfcn_length && + bts->e_offset >= si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) { + memory_exceeded = false; + break; } } - /* add last UARFCN not covered by previous cycle */ - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++, k++); + if (memory_exceeded) + return -ENOMEM; - return s + r + append + range1024_p(k); + return rc; } +/* we generate SI2q rest octets twice to get proper estimation but it's one time cost anyway */ uint8_t si2q_num(struct gsm_bts *bts) { - size_t est, e_sz = 1, u_sz = 1; + int rc = make_si2quaters(bts, true); + uint8_t num = bts->si2q_index + 1; /* number of SI2quater messages */ - if (&bts->si_common.si2quater_neigh_list) /* EARFCN */ - e_sz = earfcn_size(bts); + /* N. B: si2q_num() should NEVER be called during actualSI2q rest octets generation + we're not re-entrant because of the following code: */ + bts->u_offset = 0; + bts->e_offset = 0; - if (bts->si_common.uarfcn_length) /* UARFCN */ - u_sz = uarfcn_size(bts); + if (rc < 0) + return 0xFF; /* return impossible index as an indicator of error in generating SI2quater */ - /* 2 bits are used in between UARFCN and EARFCN structs */ - est = 1 + (e_sz + u_sz) / (SI2Q_MAX_LEN - (SI2Q_MIN_LEN + 2)); - - return est; + return num; } /* 3GPP TS 44.018, Table 9.1.54.1 - prepend diversity bit to scrambling code */ @@ -174,6 +197,44 @@ if (diversity) return scramble | (1 << 9); return scramble; +} + +int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, + uint8_t qrx, uint8_t meas_bw) +{ + struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; + int r = osmo_earfcn_add(e, earfcn, (meas_bw < EARFCN_MEAS_BW_INVALID) ? meas_bw : OSMO_EARFCN_MEAS_INVALID); + + if (r < 0) + return r; + + if (e->thresh_hi && thresh_hi != e->thresh_hi) + r = 1; + + e->thresh_hi = thresh_hi; + + if (thresh_lo != EARFCN_THRESH_LOW_INVALID) { + if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) + r = EARFCN_THRESH_LOW_INVALID; + e->thresh_lo = thresh_lo; + e->thresh_lo_valid = true; + } + + if (qrx != EARFCN_QRXLV_INVALID) { + if (e->qrxlm_valid && e->qrxlm != qrx) + r = EARFCN_QRXLV_INVALID + 1; + e->qrxlm = qrx; + e->qrxlm_valid = true; + } + + if (prio != EARFCN_PRIO_INVALID) { + if (e->prio_valid && e->prio != prio) + r = EARFCN_PRIO_INVALID; + e->prio = prio; + e->prio_valid = true; + } + + return r; } int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble) @@ -237,8 +298,10 @@ scl[k] = scr; bts->si_common.uarfcn_length++; - if (si2q_num(bts) < 2) /* FIXME: use SI2Q_MAX_NUM */ + if (si2q_num(bts) <= SI2Q_MAX_NUM) { + bts->si2q_count = si2q_num(bts) - 1; return 0; + } bts_uarfcn_del(bts, arfcn, scramble); return -ENOSPC; @@ -689,39 +752,26 @@ return false; } -size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) -{ - unsigned i, ret = 0; - - if (!e) - return 0; - - for (i = 0; i < e->length; i++) - if (e->arfcn[i] != OSMO_EARFCN_INVALID) - ret++; - - return ret; -} - static int generate_si2quater(enum osmo_sysinfo_type t, struct gsm_bts *bts) { int rc; - struct gsm48_system_information_type_2quater *si2q = GSM_BTS_SI2Q(bts); + struct gsm48_system_information_type_2quater *si2q; if (si2quater_not_needed(bts)) /* generate rest_octets for SI2q only when necessary */ return GSM_MACBLOCK_LEN; - memset(si2q, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + bts->u_offset = 0; + bts->e_offset = 0; + bts->si2q_index = 0; + bts->si2q_count = si2q_num(bts) - 1; - si2q->header.l2_plen = GSM48_LEN2PLEN(22); - si2q->header.rr_protocol_discriminator = GSM48_PDISC_RR; - si2q->header.skip_indicator = 0; - si2q->header.system_information = GSM48_MT_RR_SYSINFO_2quater; - - rc = rest_octets_si2quater(si2q->rest_octets, bts); + rc = make_si2quaters(bts, false); if (rc < 0) return rc; + OSMO_ASSERT(bts->si2q_count == bts->si2q_index); + OSMO_ASSERT(bts->si2q_count <= SI2Q_MAX_NUM); + return sizeof(*si2q) + rc; } diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a78505..5a8c6ca 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -89,25 +89,19 @@ { int r; - bts->u_offset = 0; - bts->e_offset = 0; - bts->si2q_index = 0; - bts->si2q_count = 0; bts->si_valid = 0; bts->si_valid |= (1 << SYSINFO_TYPE_2quater); - - /* should be no-op as entire buffer is filled with padding: */ - memset(GSM_BTS_SI(bts, SYSINFO_TYPE_2quater), 0xAE, GSM_MACBLOCK_LEN); printf("generating SI2quater for %zu EARFCNs and %zu UARFCNs...\n", si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); if (r > 0) - printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", - GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", - bts->si2q_index, bts->si2q_count, r, - osmo_hexdump((void *)GSM_BTS_SI2Q(bts), GSM_MACBLOCK_LEN)); + for (bts->si2q_index = 0; bts->si2q_index < bts->si2q_count + 1; bts->si2q_index++) + printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", + GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", + bts->si2q_index, bts->si2q_count, r, + osmo_hexdump((void *)GSM_BTS_SI2Q(bts, bts->si2q_index), GSM_MACBLOCK_LEN)); else printf("%s() failed to generate SI2quater: %s\n", s, strerror(-r)); } @@ -145,8 +139,10 @@ r = bts_uarfcn_add(bts, arfcn, scramble, diversity); if (r < 0) printf("failed to add UARFCN to SI2quater: %s\n", strerror(-r)); - else + else { + bts->si2q_count = si2q_num(bts) - 1; gen(bts, __func__); + } } static inline void test_si2q_segfault(void) @@ -181,7 +177,6 @@ _bts_uarfcn_add(bts, 10613, 64, 0); _bts_uarfcn_add(bts, 10613, 164, 0); _bts_uarfcn_add(bts, 10613, 14, 0); - gen(bts, __func__); } static inline void test_si2q_u(void) @@ -192,10 +187,12 @@ if (!network) exit(1); + bts = gsm_bts_alloc(network); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); + /* subsequent calls should produce valid SI if there's enough memory */ _bts_uarfcn_add(bts, 1982, 13, 1); _bts_uarfcn_add(bts, 1982, 44, 0); @@ -208,7 +205,6 @@ _bts_uarfcn_add(bts, 1982, 223, 1); _bts_uarfcn_add(bts, 1982, 14, 0); _bts_uarfcn_add(bts, 1982, 88, 0); - gen(bts, __func__); } static inline void test_si2q_e(void) @@ -219,6 +215,7 @@ if (!network) exit(1); + bts = gsm_bts_alloc(network); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; @@ -227,8 +224,10 @@ bts->si_common.si2quater_neigh_list.thresh_hi = 5; osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); + /* first generate invalid SI as no EARFCN added */ gen(bts, __func__); + /* subsequent calls should produce valid SI if there's enough memory and EARFCNs */ add_earfcn_b(bts, 1917, 5); del_earfcn_b(bts, 1917); @@ -239,6 +238,54 @@ add_earfcn_b(bts, 1965, OSMO_EARFCN_MEAS_INVALID); add_earfcn_b(bts, 1967, 4); add_earfcn_b(bts, 1982, 3); +} + +static inline void test_si2q_long(void) +{ + struct gsm_bts *bts; + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + printf("Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation:\n"); + + if (!network) + exit(1); + + bts = gsm_bts_alloc(network); + + bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; + bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; + bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; + bts->si_common.si2quater_neigh_list.thresh_hi = 5; + + osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); + + bts_earfcn_add(bts, 1922, 11, 22, 8,32, 8); + bts_earfcn_add(bts, 1922, 11, 22, 8, 32, 8); + bts_earfcn_add(bts, 1924, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 1923, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 1925, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2111, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2112, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2113, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2114, 11, 12, 6, 11, 2); + bts_earfcn_add(bts, 2131, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2132, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2133, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2134, 11, 12, 6, 11, 2); + bts_earfcn_add(bts, 2121, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2122, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2123, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2124, 11, 12, 6, 11, 2); + _bts_uarfcn_add(bts, 1976, 13, 1); + _bts_uarfcn_add(bts, 1976, 38, 1); + _bts_uarfcn_add(bts, 1976, 44, 1); + _bts_uarfcn_add(bts, 1976, 120, 1); + _bts_uarfcn_add(bts, 1976, 140, 1); + _bts_uarfcn_add(bts, 1976, 163, 1); + _bts_uarfcn_add(bts, 1976, 166, 1); + _bts_uarfcn_add(bts, 1976, 217, 1); + _bts_uarfcn_add(bts, 1976, 224, 1); + _bts_uarfcn_add(bts, 1976, 225, 1); + _bts_uarfcn_add(bts, 1976, 226, 1); } static void test_mi_functionality(void) @@ -642,6 +689,9 @@ test_si2q_e(); test_si2q_u(); test_si2q_mu(); + test_si2q_long(); + printf("Done.\n"); + return EXIT_SUCCESS; } diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index 5e0b9d5..d30f421 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -71,11 +71,11 @@ 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 Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 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 added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... @@ -87,12 +87,14 @@ 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 added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -add_earfcn_b() failed to generate SI2quater: Cannot allocate memory +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 added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -add_earfcn_b() failed to generate SI2quater: Cannot allocate memory +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 Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 generating SI2quater for 0 EARFCNs and 2 UARFCNs... @@ -111,10 +113,10 @@ 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 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 -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -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 +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 +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 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 @@ -124,9 +126,79 @@ 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 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 -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 Done. -- To view, visit https://gerrit.osmocom.org/2832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 2 21:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 21:08:58 +0000 Subject: osmo-gsm-tester[master]: jenkins: extract common parts of build scripts to separate file In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 2 21:09:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 2 Jun 2017 21:09:01 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: extract common parts of build scripts to separate file In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: extract common parts of build scripts to separate file ...................................................................... jenkins: extract common parts of build scripts to separate file Have all complexity in one common shell script, greatly simplify the individual scripts. This allows to provide a specific branch or git hash to build instead of current master. Some scripts allowed to provide branch names before, this now also allows using git hashes directly. Environment variables can be used to override the git hash/branch to use for specific repositories. Motivation for this patch: we need this to investigate failure causes more easily. Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 --- A contrib/jenkins-build-common.sh M contrib/jenkins-build-osmo-bts-sysmo.sh M contrib/jenkins-build-osmo-bts-trx.sh M contrib/jenkins-build-osmo-hlr.sh M contrib/jenkins-build-osmo-msc.sh M contrib/jenkins-build-osmo-nitb.sh 6 files changed, 190 insertions(+), 364 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh new file mode 100644 index 0000000..921434d --- /dev/null +++ b/contrib/jenkins-build-common.sh @@ -0,0 +1,152 @@ +#!source_this_file + +# Common parts for osmo-gsm-tester jenkins build scripts. Use like in below example: +# +#-------------- +# #!/bin/sh +# set -e -x +# base="$PWD" +# name="osmo-name" +# . "$(dirname "$0")/jenkins-build-common.sh" +# +# build_repo libosmocore --configure --opts +# build_repo libosmo-foo special_branch --configure --opts +# build_repo osmo-bar +# +# create_bin_tgz +#-------------- +# +# Some explanations: +# +# To allow calling from arbitrary working directories, other scripts should +# source this file like shown above. +# +# Sourcing scripts must provide some variables/functions, see above. +# In addition, these values can optionally be passed to override: +# git_url, prefix, prefix_real, BUILD_NUMBER +# +# CONFIGURE_FLAGS may contain flags that should be passed to all builds' +# ./configure steps (useful e.g. for building in the sysmobts SDK). +# +# For each built repository, a specific git branch or hash can be provided by +# environment variable: OSMO_GSM_TESTER_BUILD_$repo="" +# NOTE: convert $repo's dashes to underscore. For example: +# OSMO_GSM_TESTER_BUILD_osmo_hlr="f001234abc" +# OSMO_GSM_TESTER_BUILD_libosmocore="my/branch" +# ("origin/" is prepended to branch names automatically) + +if [ -z "$name" -o -z "$base" ]; then + set +x + echo "Some environment variables are not provided as required by jenkins-build-common.sh. Error." + exit 1 +fi + +git_url="${git_url-"git://git.osmocom.org"}" +prefix="${prefix-"$base/inst-$name"}" +# prefix_real is usually identical with prefix, except when installing to a +# different $DESTDIR than /, which is the case for example when building +# osmo-bts within the sysmoBTS SDK +prefix_real="${prefix_real-"$prefix"}" + +export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$prefix_real/lib:$LD_LIBRARY_PATH" + +# Show current environment. Sometimes the LESS_ vars have ansi colors making a +# mess, so exclude those. +env | grep -v "^LESS" | sort + +# clean the workspace +rm -f "$base/${name}"*.tgz rm -f "$base/${name}"*.md5 +rm -rf "$prefix_real" +mkdir -p "$prefix_real" + +have_repo() { + repo="$1" + branch="${2-master}" + + # Evaluate environment for instructions to build a specific git hash. + # Using a hash as $branch above unfortunately doesn't work. + branch_override_var="$(echo "OSMO_GSM_TESTER_BUILD_$repo" | sed 's/-/_/g')" + branch_override="$(eval "echo \$$branch_override_var")" + if [ -n "$branch_override" ]; then + branch="$branch_override" + fi + + cd "$base" + if [ ! -d "$repo" ]; then + git clone "$git_url/$repo" "$repo" + fi + cd "$repo" + rm -rf * + git fetch origin + + # Figure out whether we need to prepend origin/ to find branches in upstream + if ! git rev-parse "$branch"; then + branch="origin/$branch" + fi + + git reset --hard "$branch" + + git rev-parse HEAD + + cd "$base" +} + +build_repo() { + # usage: build_repo [] [--configure-opts [...]] + dep="$1" + branch="master" + if [ -z "$(echo "$2" | grep '^-')" ]; then + # second arg does not start with a dash, it's empty or a branch + branch="$2" + if [ -n "$branch" ]; then + # we had a branch arg, need to shift once more to get config options + shift + else + branch="master" + fi + fi + shift + configure_opts="$@" + + set +x; echo " + +====================== $dep + +"; set -x + + + have_repo "$dep" "$branch" + + cd "$dep" + + echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/${name}_git_hashes.txt" + + # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir. + if [ "$dep" = "openbsc" ]; then + cd openbsc + fi + + set +x; echo; echo; set -x + autoreconf -fi + set +x; echo; echo; set -x + ./configure --prefix="$prefix" $CONFIGURE_FLAGS $configure_opts + set +x; echo; echo; set -x + make -j8 || make # libsmpp34 can't build in parallel + set +x; echo; echo; set -x + make install +} + +create_bin_tgz() { + # don't package documentation -- the libosmocore docs can be up to 16 Mb large, + # a significant amount compared to the binaries + rm -rf "$prefix_real/share/doc/{libosmocore,libosmo-sccp}" || true + + # build the archive that is going to be copied to the tester + cd "$prefix_real" + this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" + tar="${this}.tgz" + tar czf "$base/$tar" * + cd "$base" + md5sum "$tar" > "${this}.md5" +} diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh index 9838834..dad2151 100755 --- a/contrib/jenkins-build-osmo-bts-sysmo.sh +++ b/contrib/jenkins-build-osmo-bts-sysmo.sh @@ -1,92 +1,23 @@ #!/bin/sh set -e -x -deps=" -libosmocore -libosmo-abis -osmo-bts -" +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" base="$PWD" -rm -f "$base/osmo-bts-sysmo.*.tgz" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -for dep in $deps; do - have_repo "$dep" -done +name="osmo-bts-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.h have_repo openbsc -. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi +build_repo libosmocore --disable-pcsc +build_repo libosmo-abis +build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include -# Cross-compilation: all installations need to be put in the sysmo SDK sysroot -export DESTDIR="/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi" - -prefix_base="/usr/local/jenkins-build" -prefix_base_real="$DESTDIR$prefix_base" -rm -rf "$prefix_base_real" - -prefix="$prefix_base/inst-osmo-bts-sysmo" -prefix_real="$DESTDIR$prefix" -mkdir -p "$prefix_real" - -# Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK: -export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" - -env - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - cd "$base/$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" - - autoreconf -fi - - config_opts="" - case "$dep" in - 'libosmocore') config_opts="--disable-pcsc" ;; - 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix_real/share/doc" - -# build the archive that is going to be copied to the tester and then to the BTS -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix_real" -this="osmo-bts-sysmo.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index 1b1d94e..3e61b70 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -1,82 +1,15 @@ #!/bin/sh -set -x -e - +set -e -x base="$PWD" -prefix="$base/inst-osmo-bts-trx" - -rm -f "$base/osmo-bts-trx*.tgz" - -deps=" -libosmocore -libosmo-abis -osmo-trx -osmo-bts -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} +name="osmo-bts-trx" +. "$(dirname "$0")/jenkins-build-common.sh" # for gsm_data_shared.* have_repo openbsc +build_repo libosmocore +build_repo libosmo-abis +build_repo osmo-trx --without-sse +build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" - - autoreconf -fi - - config_opts="" - - case "$repo" in - 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; - 'osmo-trx') config_opts="--without-sse" ;; - esac - - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-bts-trx.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh index 6fbebab..8207451 100755 --- a/contrib/jenkins-build-osmo-hlr.sh +++ b/contrib/jenkins-build-osmo-hlr.sh @@ -1,69 +1,11 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-hlr" - -rm -f "$base/osmo-hlr*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-hlr_git_hashes.txt" - - config_opts="" - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-hlr" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis build_repo osmo-hlr -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc/libosmocore" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-hlr.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index f7808ff..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -1,62 +1,8 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-msc" - -rm -f "$base/osmo-msc*.tgz" - -git_url="git://git.osmocom.org" - -have_repo() { - repo="$1" - branch="${2-master}" - - cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" -b "$branch" "$repo" - fi - cd "$repo" - rm -rf * - git fetch origin - git checkout . - git checkout "$branch" - git reset --hard origin/"$branch" - git rev-parse HEAD - - cd "$base" -} - -build_repo() { - dep="$1" - branch="${2-master}" - - have_repo "$dep" "$branch" - - cd "$dep" - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-msc_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu" - cd openbsc/ - ;; - esac - - autoreconf -fi - ./configure --prefix="$prefix" $config_opts - make -j8 || make # libsmpp34 can't build in parallel - make install -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" +name="osmo-msc" +. "$(dirname "$0")/jenkins-build-common.sh" build_repo libosmocore build_repo libosmo-abis @@ -66,17 +12,6 @@ build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH -build_repo openbsc aoip +build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-msc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh index 86d787c..76fd6ba 100755 --- a/contrib/jenkins-build-osmo-nitb.sh +++ b/contrib/jenkins-build-osmo-nitb.sh @@ -1,82 +1,15 @@ #!/bin/sh set -e -x - base="$PWD" -prefix="$base/inst-osmo-nitb" +name="osmo-nitb" +. "$(dirname "$0")/jenkins-build-common.sh" -rm -f "$base/osmo-nitb*.tgz" +build_repo libosmocore +build_repo libosmo-abis +build_repo libosmo-netif +build_repo openggsn +build_repo libsmpp34 +build_repo libosmo-sccp +build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat -deps=" -libosmocore -libosmo-abis -libosmo-netif -openggsn -libsmpp34 -libosmo-sccp -openbsc -" - -have_repo() { - repo="$1" - cd "$base" - if [ ! -d "$repo" ]; then - git clone "git://git.osmocom.org/$repo" "$repo" - fi - cd "$repo" - git clean -dxf - git fetch origin - git reset --hard origin/master - git rev-parse HEAD - cd "$base" -} - -rm -rf "$prefix" -mkdir -p "$prefix" - -export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -export LD_LIBRARY_PATH="$prefix/lib" - -for dep in $deps; do - set +x; echo " - -====================== $dep - -"; set -x - - have_repo "$dep" - cd "$dep" - rm -rf * - git checkout . - - echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-nitb_git_hashes.txt" - - config_opts="" - - case "$dep" in - 'openbsc') - config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat" - cd openbsc/ - ;; - esac - - autoreconf -fi - set +x; echo; echo; set -x - ./configure --prefix="$prefix" $config_opts - set +x; echo; echo; set -x - make -j8 || make # libsmpp34 can't build in parallel - set +x; echo; echo; set -x - make install -done - -# don't package documentation -- the libosmocore docs can be up to 16 Mb large, -# a significant amount compared to the binaries -rm -rf "$prefix/share/doc" - -# build the archive that is going to be copied to the tester -rm "$base"/*.tgz "$base"/*.md5 || true -cd "$prefix" -this="osmo-nitb.build-${BUILD_NUMBER}" -tar="${this}.tgz" -tar czf "$base/$tar" * -cd "$base" -md5sum "$tar" > "${this}.md5" +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/2828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ac2f90d006a1b2f6c246976346d852a70c89089 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 07:40:01 2017 From: gerrit-no-reply at lists.osmocom.org (Gerard) Date: Sat, 3 Jun 2017 07:40:01 +0000 Subject: [PATCH] osmo-sim-auth[master]: SIM API's to fetch information from SIM file system like Kc, ... Message-ID: Review at https://gerrit.osmocom.org/2833 SIM API's to fetch information from SIM file system like Kc, LOCI, MSISDN etc. Added -p option for fetching SIM information based on the parameter passed. Change-Id: I1f43ff918a6b96f86e661297e84010e6cdf17b84 --- M card/SIM.py M osmo-sim-auth.py 2 files changed, 335 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sim-auth refs/changes/33/2833/1 diff --git a/card/SIM.py b/card/SIM.py index 1ad45e3..5d97ba4 100644 --- a/card/SIM.py +++ b/card/SIM.py @@ -29,6 +29,7 @@ from card.ICC import ISO7816 from card.FS import SIM_FS from card.utils import * +from binascii import * class SIM(ISO7816): @@ -50,6 +51,18 @@ print '[DBG] type definition: %s' % type(self) print '[DBG] CLA definition: %s' % hex(self.CLA) + self.caller = { + 'KC' : self.get_Kc, + 'IMSI' : self.get_imsi, + 'LOCI' : self.get_loci, + 'HPPLMN' : self.get_hpplmn, + 'PLMN_SEL' : self.get_plmnsel, + 'ACC' : self.get_acc, + 'ICCID' : self.get_iccid, + 'FPLMN' : self.get_fplmn, + 'MSISDN' : self.get_msisdn, + 'SMSP' : self.get_smsp, + } def sw_status(self, sw1, sw2): ''' @@ -264,11 +277,317 @@ # and parse the received data into the IMSI structure if 'Data' in imsi.keys() and len(imsi['Data']) == 9: + + if self.dbg: + print "[DBG] International Mobile Subscriber Identity (IMSI): %s " % decode_BCD(imsi['Data'])[3:] + return decode_BCD(imsi['Data'])[3:] # if issue with the content of the DF_IMSI file if self.dbg: print '[DBG] %s' % self.coms() return None + + # This contains Ciphering Key for GSM + # File Size = 9 bytes + # select Kc to get Kc (1-8 bytes) and + # cihering key sequence number (9th byte) + # returns bytes Kc on success or None on error + def get_Kc(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + Kc = self.select([0x6F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in Kc.keys() and len(Kc['Data']) == 9: + if self.dbg: + print "[DBG] Ciphering Key (Kc): %s" % b2a_hex(byteToString(Kc['Data'][0:8])) + print "[DBG] Ciphering Key Sequence Number (n): %s " % Kc['Data'][8] + return Kc['Data'] + else: + return None + # EF loci contains location information + # This conatins TMSI, LAI, TMSI TIME, and Location update status + # and prints the information + # File Size = 11 bytes + # select LOCI to get TMSI(1-4 bytes), LAI(5-9 bytes), TMSI TIME (10th byte) + # LOCI includes Mobile country code (MCC), Mobile network code (MNC), + # and Locatio area code (LAC) + # and location update status (11th byte) + # returns bytes LOCI on success or None on error + def get_loci(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + loci = self.select([0x6F, 0x7E]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in loci.keys() and len(loci['Data']) == 11: + loci = loci['Data'] + + if self.dbg: + print "[DBG] Temporary Mobile Subscriber Identity (TMSI): %s" % b2a_hex(byteToString(loci[0:4])) + LAI = loci[4:9] + print "[DBG] Location Area Identity hex (LAI): %s" % b2a_hex(byteToString(LAI)) + MCC = ((LAI[0] & 0x0f) << 8) | (LAI[0] & 0xf0) | (LAI[1] & 0x0f) + MNC = ((LAI[2] & 0x0f) << 8) | (LAI[2] & 0xf0) | ((LAI[1] & 0xf0) >> 4) + LAC = LAI[3:5] + print "[DBG] Mobile Country Code (MCC): %s " % format(int(hex(MCC),16),"x") + print "[DBG] Mobile Country Code (MNC): %s " % format(int(hex(MNC),16),"x") + print "[DBG] Location Area Code (LAC): %s " % b2a_hex(byteToString(LAC)) + print "[DBG] TMSI TIME: %s" % loci[9] + print "[DBG] Location Update Status: %s" % loci[10] + + return loci + else: + return None + + # EF plmnsel contains Public Land Mobile Network records + # File Size: 3n (n >=8) + # Contents Mobile country code (MCC) & Mobile Netwokr code (MNC) (total 3 bytes) + # excess bytes set to 'FF' + # returns bytes PLMNSel on success or None on error + def get_plmnsel(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + plmnsel = self.select([0x6F, 0x30]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in plmnsel.keys(): + plmnsel = plmnsel['Data'] + + if self.dbg: + print "[DBG] Stored PLMN selector:\tMCC | MNC\n" + index = 0 + while len(plmnsel) > 3 and index < len(plmnsel): + if plmnsel[index] == 0xFF and plmnsel[index+1] == 0xFF and plmnsel[index+2] == 0xFF: + break + else: + MCC = ((plmnsel[index] & 0x0f) << 8) | (plmnsel[index] & 0xf0) | (plmnsel[index+1] & 0x0f) + MNC = ((plmnsel[index+2] & 0x0f) << 8) | (plmnsel[index+2] & 0xf0) | ((plmnsel[index+1] & 0xf0) >> 4) + if (MNC & 0x000f) == 0x000f: + MNC = MNC >> 4 + print "[DBG] \t\t\t\t%03x %02x" %(MCC, MNC) + else: + print "[DBG] \t\t\t\t%03x %03x" %(MCC, MNC) + index +=3 + + return plmnsel + else: + return None + + # select DF_GSM for Higher Priority PLMN search period + # File Size: 1 byte + # Contains the interval of time between searches for a higher priority PLMN + # 'YZ': (16Y + Z) minutes + # returns byte on success or None on error + def get_hpplmn(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + hpplmn = self.select([0x6F, 0x31]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in hpplmn.keys() and len(hpplmn['Data']) == 1: + hpplmn = hpplmn['Data'] + + if self.dbg: + if hpplmn[0] < 9: + print "[DBG] Higher Priority PLMN search period %s min" % hpplmn[0] + else: + hpplmn_val = list(str(hpplmn[0])) + interval = (16 * int(hpplmn_val[0])) + int(hpplmn_val[1]) + print "[DBG] Higher Priority PLMN search period %s min" % interval + + return hpplmn + else: + return None + + # select DF_GSM for accessing Access control class + # The access control class is a parameter to control the RACH utilization + # File Size = 2 bytes + # returns byte on success or None on error + def get_acc(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + acc = self.select([0x6F, 0x78]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in acc.keys() and len(acc['Data']) == 2: + acc = acc['Data'] + + if self.dbg: + print "[DBG] Access Control Classes %s " % b2a_hex(byteToString(acc)) + + return acc + else: + return None + + # select DF_TELECOM for Mobile Station Integrated Services Digital Network (MSISDN) + # Record Length: X + 14 bytes + # Type of number (TON 4 bits) and numbering plan identification (NPI 3 bits) 8th bt is always 1 = 1 byte + # Dialling Number aka Calling Number + # returns an array of msisdn's or None on error + def get_msisdn(self): + self.select([0x7F, 0x10]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + msisdn = self.select([0x6F, 0x40]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in msisdn.keys(): + msisdns = msisdn['Data'] + + if self.dbg: + for msisdn in msisdns: + rec_length = len(msisdn) - 14 + len_bcd_number = msisdn[rec_length] + + TON_NPI = msisdn[rec_length + 1 : rec_length + 2][0] + npi = TON_NPI & 0x0F + ton = (TON_NPI >> 4) & 0x07 + print "[DBG] Type of number (TON): %s " % ton + print "[DBG] Numbering plan identification (NPI): %s " % npi + + dialing_number = msisdn[rec_length + 2 : rec_length + len_bcd_number + 1] + print "[DBG] Dialling Number: %s " % decode_BCD(dialing_number)[:-2] + + return msisdns + else: + return None + + # Short Message Service Parameters (SMSP) + # select DF_TELECOM for SIM card = 0x7f10 + # Used preparation of mobile originated short messages + # It holds the settings for sending text message + # File Size = (28 + n) bytes + # returns an array of smsps or None on error + def get_smsp(self): + self.select([0x7F, 0x10]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + smsp = self.select([0x6F, 0x42]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in smsp.keys(): + smsps = smsp['Data'] + + if self.dbg: + for smsp in smsps: + rec_length = len(smsp) - 28 + rec_len = smsp[rec_length+13] + service_center_address = decode_BCD(smsp[rec_length+15:rec_length+rec_len + 14])[:-2] + print "[DBG] TP-Service Centre Address: %s " % service_center_address + + return smsps + else: + return None + + # This EF contains 4 Forbidden PLMN 3 bytes each + # File Size 12 bytes + # Unused bytes are set to 'FF' + # returns byte on success or None on error + def get_fplmn(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + fplmn = self.select([0x6F, 0x7b]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in fplmn.keys() and len(fplmn['Data']) == 12: + fplmn = fplmn['Data'] + + if self.dbg: + print "[DBG] Stored FPLMN selector:\tMCC | MNC\n" + index = 0 + while len(fplmn) > 3 and index < len(fplmn): + if fplmn[index] == 0xFF and fplmn[index+1] == 0xFF and fplmn[index+2] == 0xFF: + break + else: + MCC = ((fplmn[index] & 0x0f) << 8) | (fplmn[index] & 0xf0) | (fplmn[index+1] & 0x0f) + MNC = ((fplmn[index+2] & 0x0f) << 8) | (fplmn[index+2] & 0xf0) | ((fplmn[index+1] & 0xf0) >> 4) + if (MNC & 0x000f) == 0x000f: + MNC = MNC >> 4 + print "[DBG] \t\t\t\t%03x %02x" %(MCC, MNC) + else: + print "[DBG] \t\t\t\t%03x %03x" %(MCC, MNC) + index +=3 + + + return fplmn + else: + return None + + # This file holds a unique smart card identification number. + # file Size = 10 bytes (BCD encoded) + # Left justified and right-padded with 'F' + # returns bytes on success or None on error + def get_iccid(self): + iccid = self.select([0x2F, 0xE2]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in iccid.keys() and len(iccid['Data']) == 10: + iccid = iccid['Data'] + + if self.dbg: + print "[DBG] identification (ICCID): %s" % decode_BCD(iccid) + + return iccid + else: + return None diff --git a/osmo-sim-auth.py b/osmo-sim-auth.py index 29e0226..89deac4 100755 --- a/osmo-sim-auth.py +++ b/osmo-sim-auth.py @@ -78,6 +78,16 @@ if options.ipsec: print "1%s at uma.mnc%s.mcc%s.3gppnetwork.org,%s,%s,%s" % (imsi, imsi[3:6], imsi[0:3], b2a_hex(byteToString(rand_bin)), b2a_hex(byteToString(ret[0])), b2a_hex(byteToString(ret[1]))) +def handle_sim_info(options): + s= SIM() + if not s: + print "Error opening SIM" + exit(1) + + if options.debug: + s.dbg = 1 + + s.caller.get(options.param)() if __name__ == "__main__": parser = OptionParser() @@ -94,9 +104,15 @@ parser.add_option("-I", "--ipsec", dest="ipsec", help="IPSEC mode for strongswan triplets.dat", action="store_true") + parser.add_option("-p", "--param", dest="param", + help="Retrieve SIM card parameter (mode: SIM) KC|IMSI|LOCI|HPPLMN|PLMN_SEL|ICCID|ACC|FPLMN|MSISDN|SMSP") (options, args) = parser.parse_args() + if options.param: + handle_sim_info(options) + exit(2) + if not options.rand: print "You have to specify RAND" exit(2) -- To view, visit https://gerrit.osmocom.org/2833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f43ff918a6b96f86e661297e84010e6cdf17b84 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sim-auth Gerrit-Branch: master Gerrit-Owner: Gerard From gerrit-no-reply at lists.osmocom.org Sat Jun 3 07:54:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 3 Jun 2017 07:54:39 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Re-License under GPLv3-or-later instead of AGPLv3-or-later Message-ID: Review at https://gerrit.osmocom.org/2834 Re-License under GPLv3-or-later instead of AGPLv3-or-later The "Affero" nature makes sense for the Osmocom network components like BSC, SGSN, etc. as they are typically operated to provide a network service. For testing, this doesn't make so much sense as it is difficult to imagine people creating a business out of offering to run test cases on an end-to-end Osmocom GSM network. So let's drop the 'Affero' here. All code is so far developed by sysmocom staff, so as Managing Director of sysmocom I can effect such a license change unilaterally. Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05 --- M selftest/log_test.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/__init__.py M src/osmo_gsm_tester/bts_model.py M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/sms.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M src/osmo_gsm_tester/util.py 27 files changed, 81 insertions(+), 81 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/34/2834/1 diff --git a/selftest/log_test.py b/selftest/log_test.py index 54a0fb6..46afb73 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -7,16 +7,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import _prep diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 7304e38..5854836 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -7,16 +7,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . '''osmo_gsm_tester: invoke a single test run. diff --git a/src/osmo_gsm_tester/__init__.py b/src/osmo_gsm_tester/__init__.py index 6b6b46e..d3c1590 100644 --- a/src/osmo_gsm_tester/__init__.py +++ b/src/osmo_gsm_tester/__init__.py @@ -6,16 +6,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . __version__ = 'UNKNOWN' diff --git a/src/osmo_gsm_tester/bts_model.py b/src/osmo_gsm_tester/bts_model.py index e5f9682..41e8491 100644 --- a/src/osmo_gsm_tester/bts_model.py +++ b/src/osmo_gsm_tester/bts_model.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . from . import log, schema, util diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 95d020b..0083512 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 2da0396..5f2b3cb 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 4c24501..deb872f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # discussion for choice of config file format: diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index d082898..c3c679b 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -5,16 +5,16 @@ # Author: Pau Espin Pedrol # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # These will be initialized before each test run. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index c4a9861..d662400 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 0525019..83f3e0d 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . from . import log, test, util, event_loop, sms diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index d7f9f87..7753395 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 736c943..0b717fa 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -6,16 +6,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import socket diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 29cf164..354eb1d 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 44b9513..3e722fb 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ea539d6..ca0e246 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 1bb1fcf..b2ddfb7 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index 5453dfd..f3b1e6a 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -5,16 +5,16 @@ # Author: Pau Espin Pedrol # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e9567b2..e5d38f3 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index da0a004..7892fc6 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -5,16 +5,16 @@ # Author: Pau Espin Pedrol # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index ee3b209..3e8924a 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index a10ddd1..fb27f32 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import re diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 7fcb2d9..570ef96 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . class Sms: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 75c461e..b88b8b2 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index c00bdc8..33ce2f6 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -6,16 +6,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index e7ee232..74cebea 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # These will be initialized before each test run. diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index ab16efd..3d04de8 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index e985a0f..266243c 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os -- To view, visit https://gerrit.osmocom.org/2834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 3 07:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 3 Jun 2017 07:54:40 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add GPLv3 license text to repository Message-ID: Review at https://gerrit.osmocom.org/2835 Add GPLv3 license text to repository Change-Id: I094598c0a725a4e8a005bb255779ef5ab3456934 --- A COPYING 1 file changed, 674 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/35/2835/1 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. -- To view, visit https://gerrit.osmocom.org/2835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I094598c0a725a4e8a005bb255779ef5ab3456934 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 3 10:11:34 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 3 Jun 2017 10:11:34 +0000 Subject: osmo-bts[master]: Add version to phy_instance In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2784/2/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 1878: talloc_asprintf(pinst->version, "%u.%u dsp %u.%u.%u fpga %u.%u.%u", char* talloc_asprintf ( const void * t, const char * fmt, ... ) so passing pinst->version as a context doesn't look good.. and ignoring the allocation is ... -- To view, visit https://gerrit.osmocom.org/2784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693 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: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 3 13:37:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 13:37:34 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: add sqlite3 as dependency Message-ID: Review at https://gerrit.osmocom.org/2836 OsmoGSMTester: add sqlite3 as dependency Needed to setup the initial hlr db using the hlr.sql file from osmo-hlr since osmo-gsm-tester commit 798e592fd642a1dd86380c412a9501931b9048e1 "MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP" Change-Id: Ic19f93a69df4062364da8523b5d30a1611a0eb77 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/36/2836/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index 8ace16f..9900e6b 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -17,6 +17,7 @@ apt-get install \ dbus \ tcpdump \ + sqlite3 \ python3 \ python3-yaml \ python3-mako \ -- To view, visit https://gerrit.osmocom.org/2836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic19f93a69df4062364da8523b5d30a1611a0eb77 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 13:37:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 13:37:35 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: tweak sysmobts: systemctl, ssh, limits, reboot Message-ID: Review at https://gerrit.osmocom.org/2837 OsmoGSMTester: tweak sysmobts: systemctl, ssh, limits, reboot Simpler systemctl rule to disable stock services. Fix the limits config, which was not the right way for sysmoBTS. SSH access: apparently no need to create an ssh key at all, login is permitted right away. Add hint to reboot at the right time. Change-Id: I8e686383318ee2eece908a4e690e5061ade0cd02 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 28 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/37/2837/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index 9900e6b..41c85e4 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -530,10 +530,7 @@ be disabled: ---- -systemctl mask osmo-nitb -systemctl mask sysmobts -systemctl mask sysmopcu -systemctl mask sysmobts-mgr +systemctl mask osmo-nitb sysmobts sysmopcu sysmobts-mgr ---- This stops the stock setup keeping the BTS in operation and hence allows the @@ -563,46 +560,40 @@ You may set the name server in '/etc/resolve.conf' (most likely to the IP of the gateway), but this is not really needed by the osmo-gsm-tester. -==== SSH Access - -Copy an SSH public key from the system/user that runs the osmo-gsm-tester, -presumably user 'jenkins' on the *main unit* (not from the jenkins master!), to -the 'authorized_keys' file of user 'root' on the SysmoBTS. - -If the 'jenkins' user on the *main unit* has no key pair yet, generate one -first, with an empty passphrase: - ----- -ssh jenkins at my_main_unit -ssh-keygen ----- - -Then copy the public key to the SysmoBTS: - ----- -ssh jenkins at my_main_unit -cat ~/.ssh/id_rsa.pub -# copy this public key ----- - ----- -sysmobts=root at 10.42.42.114 -ssh $sysmobts -cat id_rsa.pub >> ~/.ssh/authorized_keys -# paste above public key and hit Ctrl-D ----- - ==== Allow Core Files In case a binary run for the test crashes, a core file of the crash should be -written. This requires a limit rule. Copy the following config file from the -osmo-gsm-tester source tree to the SysmoBTS: +written. This requires a limits rule. Append a line to /etc/limits like: ---- -sysmobts=root at 10.42.42.114 -scp install/osmo-gsm-tester-limits.conf $sysmobts:/etc/security/limits.d/ +ssh root at 10.42.42.114 +echo "* C16384" >> /etc/limits ---- +==== Reboot + +Reboot the BTS and make sure that the IP address for eth0 is now indeed +10.42.42.114, and that no osmo* programs are running. + +---- +ip a +ps w | grep osmo +---- + +==== SSH Access + +Make sure that the jenkins user on the main unit is able to login on the +sysmoBTS, possibly erasing outdated host keys after a new rootfs was loaded: + +On the main unit, for example do: + +---- +su - jenkins +ssh root at 10.42.42.114 +---- + +Fix any problems until you get a login on the sysmoBTS. + [[hardware_modems]] === Modems -- To view, visit https://gerrit.osmocom.org/2837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e686383318ee2eece908a4e690e5061ade0cd02 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 13:57:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 13:57:32 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: all: show 'DRAFT' in page header, disable DRAFT watermark Message-ID: Review at https://gerrit.osmocom.org/2838 all: show 'DRAFT' in page header, disable DRAFT watermark The 'DRAFT' watermark in the page background is a hindrance when trying to copy-paste text from the rendered PDFs. It segments the texts so that many code lines cannot be marked in whole to copy. So drop the watermark and instead just show 'DRAFT' in the page header. Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142 --- M build/Makefile.asciidoc.inc 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/38/2838/1 diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index fad91fa..82721ff 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -16,15 +16,15 @@ cleanfiles += $(ASCIIDOCPDFS) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes +DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 ifeq (,$(BUILD_RELEASE)) - DBLATEX_OPTS += -P draft.watermark=1 + REVNUMBER := DRAFT $(GIT_VERSION) else - DBLATEX_OPTS += -P draft.watermark=0 + REVNUMBER := $(GIT_VERSION) endif -A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(GIT_VERSION)" -a revdate="$(GIT_DATE)" +A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" all: $(ASCIIDOCPDFS) -- To view, visit https://gerrit.osmocom.org/2838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 13:57:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 13:57:32 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: all: show 'DRAFT' watermark on the first page Message-ID: Review at https://gerrit.osmocom.org/2839 all: show 'DRAFT' watermark on the first page Unconditionally show a 'DRAFT' watermark only on the first page of each document. I would have liked to make this conditional based on the BUILD_RELEASE=* variable, but could not figure out how to switch off a .sty code segment based on command line parameters. Since we only seem to render all manuals in DRAFT mode all the time, it seems reasonable to include the DRAFT watermark always, requiring manual .sty editing if anyone wanted to build a non-DRAFT version. In the makefile, add an echo to say so in case of non-draft builds. Change-Id: Ia71795481c2467aab11ab344517df74775b2a852 --- M build/Makefile.asciidoc.inc M build/custom-dblatex.sty 2 files changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/39/2839/1 diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 82721ff..56a6ed9 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -29,7 +29,14 @@ all: $(ASCIIDOCPDFS) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +.PHONY: hint_to_remove_draft_mode +hint_to_remove_draft_mode: + @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" \ + || true + +$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc hint_to_remove_draft_mode a2x $(A2X_OPTS) $< || asciidoc -v $(ASCIIDOC_OPTS) $< check: $(ASCIIDOC_CHECKS) diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty index a3822b5..41e7c70 100644 --- a/build/custom-dblatex.sty +++ b/build/custom-dblatex.sty @@ -19,6 +19,10 @@ \usepackage{alltt} \usepackage{upquote} +% "DRAFT" on first page +\definecolor{LtGrey}{rgb}{0.875,0.875,0.875} +\AddToShipoutPicture*{ \AtTextCenter{ \makebox(0,0)[c]{\resizebox{\textwidth}{!}{ \rotatebox{45}{\textsf{\textbf{\color{LtGrey}DRAFT}}}}} } } + \def\Company{sysmocom - s.f.m.c. GmbH} \def\DBKcover{ -- To view, visit https://gerrit.osmocom.org/2839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia71795481c2467aab11ab344517df74775b2a852 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:02:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:02:18 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2825/3//COMMIT_MSG Commit Message: Line 10: instead. Which build slave is that? can't we just install python3? -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:18:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:18:43 +0000 Subject: osmo-hlr[master]: VTY: Add hlr node and bind ip field In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79f7a300480f308b21116dd14d1698be38725afd Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr 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 Sat Jun 3 14:18:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:18:49 +0000 Subject: [MERGED] osmo-hlr[master]: VTY: Add hlr node and bind ip field In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: VTY: Add hlr node and bind ip field ...................................................................... VTY: Add hlr node and bind ip field With this patch the address osmo-hlr binds to can be changed to something else than 0.0.0.0 Change-Id: I79f7a300480f308b21116dd14d1698be38725afd --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_vty.c M src/hlr_vty.h 5 files changed, 114 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index 2b49958..853d3c2 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -14,3 +14,6 @@ bind 127.0.0.1 ctrl bind 127.0.0.1 +hlr + gsup + bind ip 127.0.0.1 diff --git a/src/hlr.c b/src/hlr.c index b5777e2..7d1bf75 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -415,6 +415,7 @@ .version = PACKAGE_VERSION, .copyright = vlr_copyright, .is_config_node = hlr_vty_is_config_node, + .go_parent_cb = hlr_vty_go_parent, }; int main(int argc, char **argv) @@ -435,7 +436,7 @@ vty_init(&vty_info); ctrl_vty_init(hlr_ctx); handle_options(argc, argv); - hlr_vty_init(&hlr_log_info); + hlr_vty_init(g_hlr, &hlr_log_info); rc = vty_read_config_file(cmdline_opts.config_file, NULL); if (rc < 0) { @@ -465,8 +466,8 @@ exit(1); } - g_hlr->gs = osmo_gsup_server_create(hlr_ctx, NULL, 2222, read_cb, - &g_lu_ops); + g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, 2222, + read_cb, &g_lu_ops); if (!g_hlr->gs) { LOGP(DMAIN, LOGL_FATAL, "Error starting GSUP server\n"); exit(1); diff --git a/src/hlr.h b/src/hlr.h index 1e8eff8..f63bc2b 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -34,4 +34,7 @@ /* Control Interface */ struct ctrl_handle *ctrl; const char *ctrl_bind_addr; + + /* Local bind addr */ + char *gsup_bind_addr; }; diff --git a/src/hlr_vty.c b/src/hlr_vty.c index e4eef8f..946117e 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -20,11 +20,93 @@ * */ +#include #include #include #include #include "hlr_vty.h" + +static struct hlr *g_hlr = NULL; + +struct cmd_node hlr_node = { + HLR_NODE, + "%s(config-hlr)# ", + 1, +}; + +DEFUN(cfg_hlr, + cfg_hlr_cmd, + "hlr", + "Configure the HLR") +{ + vty->node = HLR_NODE; + return CMD_SUCCESS; +} + +struct cmd_node gsup_node = { + GSUP_NODE, + "%s(config-hlr-gsup)# ", + 1, +}; + +DEFUN(cfg_gsup, + cfg_gsup_cmd, + "gsup", + "Configure GSUP options") +{ + vty->node = GSUP_NODE; + return CMD_SUCCESS; +} + +static int config_write_hlr(struct vty *vty) +{ + vty_out(vty, "hlr%s", VTY_NEWLINE); + return CMD_SUCCESS; +} + +static int config_write_hlr_gsup(struct vty *vty) +{ + vty_out(vty, " gsup%s", VTY_NEWLINE); + if (g_hlr->gsup_bind_addr) + vty_out(vty, " bind ip %s%s", g_hlr->gsup_bind_addr, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(cfg_hlr_gsup_bind_ip, + cfg_hlr_gsup_bind_ip_cmd, + "bind ip A.B.C.D", + "Listen/Bind related socket option\n" + IP_STR + "IPv4 Address to bind the GSUP interface to\n") +{ + if(g_hlr->gsup_bind_addr) + talloc_free(g_hlr->gsup_bind_addr); + g_hlr->gsup_bind_addr = talloc_strdup(g_hlr, argv[0]); + + return CMD_SUCCESS; +} + +int hlr_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + case GSUP_NODE: + vty->node = HLR_NODE; + vty->index = NULL; + break; + default: + case HLR_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + break; + case CONFIG_NODE: + vty->node = ENABLE_NODE; + vty->index = NULL; + break; + } + + return vty->node; +} int hlr_vty_is_config_node(struct vty *vty, int node) { @@ -38,7 +120,19 @@ } } -void hlr_vty_init(const struct log_info *cat) +void hlr_vty_init(struct hlr *hlr, const struct log_info *cat) { + g_hlr = hlr; + logging_vty_add_cmds(cat); + + install_element(CONFIG_NODE, &cfg_hlr_cmd); + install_node(&hlr_node, config_write_hlr); + install_default(HLR_NODE); + + install_element(HLR_NODE, &cfg_gsup_cmd); + install_node(&gsup_node, config_write_hlr_gsup); + install_default(GSUP_NODE); + + install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); } diff --git a/src/hlr_vty.h b/src/hlr_vty.h index abc9804..cd2ff73 100644 --- a/src/hlr_vty.h +++ b/src/hlr_vty.h @@ -24,6 +24,14 @@ #include #include +#include +#include "hlr.h" + +enum hlr_vty_node { + HLR_NODE = _LAST_OSMOVTY_NODE + 1, + GSUP_NODE, +}; int hlr_vty_is_config_node(struct vty *vty, int node); -void hlr_vty_init(const struct log_info *cat); +int hlr_vty_go_parent(struct vty *vty); +void hlr_vty_init(struct hlr *hlr, const struct log_info *cat); -- To view, visit https://gerrit.osmocom.org/2809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79f7a300480f308b21116dd14d1698be38725afd Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr 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 Sat Jun 3 14:19:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:19:26 +0000 Subject: osmo-gsm-tester[master]: Use reserved ip address for osmo-hlr GSUP interface In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 just merged the other one -- To view, visit https://gerrit.osmocom.org/2810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Sat Jun 3 14:20:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:20:30 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use reserved ip address for osmo-hlr GSUP interface In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2810 to look at the new patch set (#3). Use reserved ip address for osmo-hlr GSUP interface Otherwise 0.0.0.0 was being used and we want all interfaces for a specific osmo-hlr instance to use the same IP Requires osmo-hlr change id I79f7a300480f308b21116dd14d1698be38725afd otherwise osmo-hlr won't be able to parse the configuration file. Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1 --- M src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/10/2810/3 diff --git a/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl index fbd6cfc..ccb8224 100644 --- a/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl @@ -10,3 +10,6 @@ bind ${hlr.ip_address.addr} ctrl bind ${hlr.ip_address.addr} +hlr + gsup + bind ip ${hlr.ip_address.addr} -- To view, visit https://gerrit.osmocom.org/2810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:20:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:20:44 +0000 Subject: osmo-gsm-tester[master]: Use reserved ip address for osmo-hlr GSUP interface In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester 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 Sat Jun 3 14:21:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:21:24 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Use reserved ip address for osmo-hlr GSUP interface In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Use reserved ip address for osmo-hlr GSUP interface ...................................................................... Use reserved ip address for osmo-hlr GSUP interface Otherwise 0.0.0.0 was being used and we want all interfaces for a specific osmo-hlr instance to use the same IP Requires osmo-hlr change id I79f7a300480f308b21116dd14d1698be38725afd otherwise osmo-hlr won't be able to parse the configuration file. Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1 --- M src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl index fbd6cfc..ccb8224 100644 --- a/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-hlr.cfg.tmpl @@ -10,3 +10,6 @@ bind ${hlr.ip_address.addr} ctrl bind ${hlr.ip_address.addr} +hlr + gsup + bind ip ${hlr.ip_address.addr} -- To view, visit https://gerrit.osmocom.org/2810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4e0063abc8de3d739ebd81942b692cc2e75792f1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:22:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:22:11 +0000 Subject: osmo-gsm-tester[master]: Add GPLv3 license text to repository In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I094598c0a725a4e8a005bb255779ef5ab3456934 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:23:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:23:44 +0000 Subject: osmo-gsm-tester[master]: Re-License under GPLv3-or-later instead of AGPLv3-or-later In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:23:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:23:51 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Re-License under GPLv3-or-later instead of AGPLv3-or-later In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Re-License under GPLv3-or-later instead of AGPLv3-or-later ...................................................................... Re-License under GPLv3-or-later instead of AGPLv3-or-later The "Affero" nature makes sense for the Osmocom network components like BSC, SGSN, etc. as they are typically operated to provide a network service. For testing, this doesn't make so much sense as it is difficult to imagine people creating a business out of offering to run test cases on an end-to-end Osmocom GSM network. So let's drop the 'Affero' here. All code is so far developed by sysmocom staff, so as Managing Director of sysmocom I can effect such a license change unilaterally. Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05 --- M selftest/log_test.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/__init__.py M src/osmo_gsm_tester/bts_model.py M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/sms.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M src/osmo_gsm_tester/util.py 27 files changed, 81 insertions(+), 81 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/log_test.py b/selftest/log_test.py index 54a0fb6..46afb73 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -7,16 +7,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import _prep diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 7304e38..5854836 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -7,16 +7,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . '''osmo_gsm_tester: invoke a single test run. diff --git a/src/osmo_gsm_tester/__init__.py b/src/osmo_gsm_tester/__init__.py index 6b6b46e..d3c1590 100644 --- a/src/osmo_gsm_tester/__init__.py +++ b/src/osmo_gsm_tester/__init__.py @@ -6,16 +6,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . __version__ = 'UNKNOWN' diff --git a/src/osmo_gsm_tester/bts_model.py b/src/osmo_gsm_tester/bts_model.py index e5f9682..41e8491 100644 --- a/src/osmo_gsm_tester/bts_model.py +++ b/src/osmo_gsm_tester/bts_model.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . from . import log, schema, util diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 95d020b..0083512 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 2da0396..5f2b3cb 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 4c24501..deb872f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # discussion for choice of config file format: diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index d082898..c3c679b 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -5,16 +5,16 @@ # Author: Pau Espin Pedrol # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # These will be initialized before each test run. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index c4a9861..d662400 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 0525019..83f3e0d 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . from . import log, test, util, event_loop, sms diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index d7f9f87..7753395 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 736c943..0b717fa 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -6,16 +6,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import socket diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 29cf164..354eb1d 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 44b9513..3e722fb 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ea539d6..ca0e246 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 1bb1fcf..b2ddfb7 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index 5453dfd..f3b1e6a 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -5,16 +5,16 @@ # Author: Pau Espin Pedrol # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e9567b2..e5d38f3 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index da0a004..7892fc6 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -5,16 +5,16 @@ # Author: Pau Espin Pedrol # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index ee3b209..3e8924a 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index a10ddd1..fb27f32 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import re diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 7fcb2d9..570ef96 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . class Sms: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 75c461e..b88b8b2 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index c00bdc8..33ce2f6 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -6,16 +6,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os, sys diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index e7ee232..74cebea 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # These will be initialized before each test run. diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index ab16efd..3d04de8 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index e985a0f..266243c 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -5,16 +5,16 @@ # 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 +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . import os -- To view, visit https://gerrit.osmocom.org/2834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8959c2d605854ffdc21cb29c0fe0e715685c4c05 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:23:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:23:51 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add GPLv3 license text to repository In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add GPLv3 license text to repository ...................................................................... Add GPLv3 license text to repository Change-Id: I094598c0a725a4e8a005bb255779ef5ab3456934 --- A COPYING 1 file changed, 674 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. -- To view, visit https://gerrit.osmocom.org/2835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I094598c0a725a4e8a005bb255779ef5ab3456934 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:54:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:54:28 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 6: (7 comments) https://gerrit.osmocom.org/#/c/2779/6/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 414: if self.mcc is None or self.mnc is None: > is the following true? None == (None, None) I assume that mcc_mnc is either set, i.e. a tuple of two number strings, or unset, meaning that it is None (not a tuple but None). I think it's the cleanest choice to allow only those two cases and not bother with also checking (None, None) tuples etc. None is a valid tuple entry, so a tuple of two entries is definitely not == None. With None I prefer using 'is', to clearly indicate to not use any operator magic. Line 427: self.log('Already registered with the network') > No, we need to keep this here to avoid re-registering in case the modem got I'd prefer: have one separate function to return true when we are already connected and the operator codes match what we want to be connected to. Call this function even before we start to first Scan(). Then call it again here if needed. Would also make this function more readable. Line 454: self.mcc, self.mnc = mcc_mnc > because I need to check the separately (I think unless the following is tru IMHO store it as mcc_mnc everywhere. If you need to check separately, do things like 'None in mcc_mnc' or 'mcc_mnc[idx]'. I already suggested below: if len(mcc_mnc) != 2 or None in mcc_mnc: https://gerrit.osmocom.org/#/c/2779/6/suites/aoip_debug/interactive.py File suites/aoip_debug/interactive.py: Line 34: wait(m.is_connected) (order: first modem) https://gerrit.osmocom.org/#/c/2779/6/suites/debug/interactive.py File suites/debug/interactive.py: Line 30: wait(m.is_connected) > As far as I know, the registration confirmation comes from MSC/BSC and goes we wait until both are true, so the order doesn't matter much semantically. We can choose to wait long for the one first, or the other. I favor waiting for the modem first, because then we don't create CTRL traffic every second which shows up in the pcaps. Instead, we will in the end probably just have one single verification via CTRL that the BSC/MSC agrees that the modem is now attached. So let's wait for modems first. https://gerrit.osmocom.org/#/c/2779/6/suites/netreg/register.py File suites/netreg/register.py: Line 16: ms.connect(nitb.mcc_mnc()) > It's at the end of the file, line 21 ah missed that https://gerrit.osmocom.org/#/c/2779/6/suites/netreg/register_default.py File suites/netreg/register_default.py: Line 18: print(ms.properties()) (rather use ms.info() I guess, properties() are bloated) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 6 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: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 3 14:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 14:57:48 +0000 Subject: [MERGED] osmo-hlr[master]: hlr_data.sql: Insert ki and opc instead of op to example data In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: hlr_data.sql: Insert ki and opc instead of op to example data ...................................................................... hlr_data.sql: Insert ki and opc instead of op to example data It depends on the cards whether you have op or opc, but the most cards in use for 3G are using the opc. Change the example to reflect that. Change-Id: I8f6051ea9b285ff6261bfe346cfc29d1167921f5 --- M sql/hlr_data.sql 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sql/hlr_data.sql b/sql/hlr_data.sql index 939e4c9..0767d48 100644 --- a/sql/hlr_data.sql +++ b/sql/hlr_data.sql @@ -5,9 +5,9 @@ -- 3G only subscriber INSERT INTO subscriber (id, imsi) VALUES (2, '901990000000002'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, op, sqn) VALUES (2, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +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 auc_2g (subscriber_id, algo_id_2g, ki) VALUES (3, 1, '000102030405060708090a0b0c0d0e0f'); -INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, op, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); +INSERT INTO auc_3g (subscriber_id, algo_id_3g, k, opc, sqn) VALUES (3, 5, '000102030405060708090a0b0c0d0e0f', '101112131415161718191a1b1c1d1e1f', 0); -- To view, visit https://gerrit.osmocom.org/2653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f6051ea9b285ff6261bfe346cfc29d1167921f5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Sat Jun 3 15:00:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 15:00:55 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 10: > Please do not submit. all --enable-iu axes [1] are failing. The solution might be that for the current openbsc with --enable-iu, you need to use libosmo-sccp tag 'old_sua'. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 10 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 3 18:58:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 18:58:46 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: add sqlite3 as dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic19f93a69df4062364da8523b5d30a1611a0eb77 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 Sat Jun 3 18:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 18:58:48 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGSMTester: add sqlite3 as dependency In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGSMTester: add sqlite3 as dependency ...................................................................... OsmoGSMTester: add sqlite3 as dependency Needed to setup the initial hlr db using the hlr.sql file from osmo-hlr since osmo-gsm-tester commit 798e592fd642a1dd86380c412a9501931b9048e1 "MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP" Change-Id: Ic19f93a69df4062364da8523b5d30a1611a0eb77 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 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 8ace16f..9900e6b 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -17,6 +17,7 @@ apt-get install \ dbus \ tcpdump \ + sqlite3 \ python3 \ python3-yaml \ python3-mako \ -- To view, visit https://gerrit.osmocom.org/2836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic19f93a69df4062364da8523b5d30a1611a0eb77 Gerrit-PatchSet: 1 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 Sat Jun 3 18:59:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 18:59:33 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: tweak sysmobts: systemctl, ssh, limits, reboot In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e686383318ee2eece908a4e690e5061ade0cd02 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 Sat Jun 3 18:59:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 18:59:37 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGSMTester: tweak sysmobts: systemctl, ssh, limits, reboot In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGSMTester: tweak sysmobts: systemctl, ssh, limits, reboot ...................................................................... OsmoGSMTester: tweak sysmobts: systemctl, ssh, limits, reboot Simpler systemctl rule to disable stock services. Fix the limits config, which was not the right way for sysmoBTS. SSH access: apparently no need to create an ssh key at all, login is permitted right away. Add hint to reboot at the right time. Change-Id: I8e686383318ee2eece908a4e690e5061ade0cd02 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 28 insertions(+), 37 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 9900e6b..41c85e4 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -530,10 +530,7 @@ be disabled: ---- -systemctl mask osmo-nitb -systemctl mask sysmobts -systemctl mask sysmopcu -systemctl mask sysmobts-mgr +systemctl mask osmo-nitb sysmobts sysmopcu sysmobts-mgr ---- This stops the stock setup keeping the BTS in operation and hence allows the @@ -563,46 +560,40 @@ You may set the name server in '/etc/resolve.conf' (most likely to the IP of the gateway), but this is not really needed by the osmo-gsm-tester. -==== SSH Access - -Copy an SSH public key from the system/user that runs the osmo-gsm-tester, -presumably user 'jenkins' on the *main unit* (not from the jenkins master!), to -the 'authorized_keys' file of user 'root' on the SysmoBTS. - -If the 'jenkins' user on the *main unit* has no key pair yet, generate one -first, with an empty passphrase: - ----- -ssh jenkins at my_main_unit -ssh-keygen ----- - -Then copy the public key to the SysmoBTS: - ----- -ssh jenkins at my_main_unit -cat ~/.ssh/id_rsa.pub -# copy this public key ----- - ----- -sysmobts=root at 10.42.42.114 -ssh $sysmobts -cat id_rsa.pub >> ~/.ssh/authorized_keys -# paste above public key and hit Ctrl-D ----- - ==== Allow Core Files In case a binary run for the test crashes, a core file of the crash should be -written. This requires a limit rule. Copy the following config file from the -osmo-gsm-tester source tree to the SysmoBTS: +written. This requires a limits rule. Append a line to /etc/limits like: ---- -sysmobts=root at 10.42.42.114 -scp install/osmo-gsm-tester-limits.conf $sysmobts:/etc/security/limits.d/ +ssh root at 10.42.42.114 +echo "* C16384" >> /etc/limits ---- +==== Reboot + +Reboot the BTS and make sure that the IP address for eth0 is now indeed +10.42.42.114, and that no osmo* programs are running. + +---- +ip a +ps w | grep osmo +---- + +==== SSH Access + +Make sure that the jenkins user on the main unit is able to login on the +sysmoBTS, possibly erasing outdated host keys after a new rootfs was loaded: + +On the main unit, for example do: + +---- +su - jenkins +ssh root at 10.42.42.114 +---- + +Fix any problems until you get a login on the sysmoBTS. + [[hardware_modems]] === Modems -- To view, visit https://gerrit.osmocom.org/2837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e686383318ee2eece908a4e690e5061ade0cd02 Gerrit-PatchSet: 1 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 Sat Jun 3 19:06:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 19:06:09 +0000 Subject: osmo-bts[master]: measurement: Fix measurement reporting period tables In-Reply-To: References: Message-ID: Patch Set 2: what Max said: can you explain why the new offsets are correct? Maybe even in a code comment for future readers of the code. -- To view, visit https://gerrit.osmocom.org/2795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e0fdf081e0e28bed7d2b04f47ebc26bd2b94658 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Sat Jun 3 19:10:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 3 Jun 2017 19:10:47 +0000 Subject: osmo-sip-connector[master]: evpoll: Implement poll with ppoll and map select to poll.. In-Reply-To: References: Message-ID: Patch Set 2: what Harald said. -- To view, visit https://gerrit.osmocom.org/1987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I12d3af23315d762a8fcd83255647a3df6aff7166 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Holger Freyther 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 Sun Jun 4 04:15:36 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 4 Jun 2017 04:15:36 +0000 Subject: [ABANDON] osmo-sip-connector[master]: evpoll: Implement poll with ppoll and map select to poll.. In-Reply-To: References: Message-ID: Holger Freyther has abandoned this change. Change subject: evpoll: Implement poll with ppoll and map select to poll.. ...................................................................... Abandoned Maybe the right thing to do but a.) ppoll might be too specific api b.) the extra work to try to read an error is not significant -- To view, visit https://gerrit.osmocom.org/1987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I12d3af23315d762a8fcd83255647a3df6aff7166 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 4 04:16:05 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 4 Jun 2017 04:16:05 +0000 Subject: [ABANDON] osmo-sip-connector[master]: evpoll: Optimize layout of the pollfd array In-Reply-To: References: Message-ID: Holger Freyther has abandoned this change. Change subject: evpoll: Optimize layout of the pollfd array ...................................................................... Abandoned Previous change was abandoned. This one depends on it -- To view, visit https://gerrit.osmocom.org/1988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1dfd9716a3620ad7932e8f46fd17536a6619fe0e Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 4 11:28:08 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 4 Jun 2017 11:28:08 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: fix some typos Message-ID: Review at https://gerrit.osmocom.org/2840 cosmetic: fix some typos Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05 --- M include/osmo-bts/scheduler.h M include/osmo-bts/scheduler_backend.h M src/common/scheduler.c M src/osmo-bts-trx/scheduler_trx.c 4 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/2840/1 diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h index 33a99bb..9dbc946 100644 --- a/include/osmo-bts/scheduler.h +++ b/include/osmo-bts/scheduler.h @@ -127,7 +127,7 @@ uint8_t mf_period; /* period of multiframe */ const struct trx_sched_frame *mf_frames; /* pointer to frame layout */ - struct llist_head dl_prims; /* Queue primitves for TX */ + struct llist_head dl_prims; /* Queue primitives for TX */ /* Channel states for all logical channels */ struct l1sched_chan_state chan_state[_TRX_CHAN_MAX]; @@ -160,7 +160,7 @@ /*! \brief Handle a PH-TCH.req from L2 down to L1 */ int trx_sched_tch_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap); -/*! \brief PHY informs us of new (current) GSM freme nunmber */ +/*! \brief PHY informs us of new (current) GSM frame number */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn); /*! \brief handle an UL burst received by PHY */ diff --git a/include/osmo-bts/scheduler_backend.h b/include/osmo-bts/scheduler_backend.h index e63b961..af1cfbf 100644 --- a/include/osmo-bts/scheduler_backend.h +++ b/include/osmo-bts/scheduler_backend.h @@ -29,7 +29,7 @@ trx_sched_dl_func *dl_fn; /*! \brief function to call when burst received from PHY */ trx_sched_ul_func *ul_fn; - /*! \breif is this channel automatically active at start? */ + /*! \brief is this channel automatically active at start? */ int auto_active; }; extern const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX]; diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 27b7630..121475a 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -105,7 +105,7 @@ 0,1,0,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,0,1,1,1,1,1,1,1, }, }; -/*! \brief SCH trainign sequence (TS 05.02 Chapter 5.2.5) */ +/*! \brief SCH training sequence (TS 05.02 Chapter 5.2.5) */ const ubit_t _sched_sch_train[64] = { 1,0,1,1,1,0,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1, 0,0,1,0,1,1,0,1,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,0,0,1,1,0,1,1, @@ -584,7 +584,7 @@ enum trx_chan_type dl_chan; /*! \brief downlink block ID */ uint8_t dl_bid; - /*! \breff uplink TRX channel type */ + /*! \brief uplink TRX channel type */ enum trx_chan_type ul_chan; /*! \brief uplink block ID */ uint8_t ul_bid; @@ -1307,7 +1307,7 @@ uint8_t period; /*! \brief pointer to scheduling structure */ const struct trx_sched_frame *frames; - /*! \brife human-readable name */ + /*! \brief human-readable name */ const char *name; }; diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 9ec9592..8531d5c 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -570,7 +570,7 @@ } if (msgb_l2len(msg_tch) != len) { LOGP(DL1C, LOGL_ERROR, "Cannot send payload with " - "invalid length! (expecing %d, received %d)\n", + "invalid length! (expecting %d, received %d)\n", len, msgb_l2len(msg_tch)); free_bad_msg: /* free message */ @@ -1354,7 +1354,7 @@ /* TCH or BFI */ /* Note on FN 19 or 20: If we received the last burst of a frame, * it actually starts at FN 8 or 9. A burst starting there, overlaps - * with the slot 12, so an extra FN must be substracted to get correct + * with the slot 12, so an extra FN must be subtracted to get correct * start of frame. */ return _sched_compose_tch_ind(l1t, tn, -- To view, visit https://gerrit.osmocom.org/2840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 4 11:37:22 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 4 Jun 2017 11:37:22 +0000 Subject: [PATCH] libosmocore[master]: core/conv: combine Viterbi implementation into a single dir In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2782 to look at the new patch set (#3). core/conv: combine Viterbi implementation into a single dir Change-Id: Ifbcb020c1302e49de2a9afe8567f851a16a023e6 --- M src/Makefile.am R src/viterbi/viterbi.c R src/viterbi/viterbi_generic.c R src/viterbi/viterbi_sse.c R src/viterbi/viterbi_sse_avx.c R src/viterbi/viterbi_sse_common.h 6 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2782/3 diff --git a/src/Makefile.am b/src/Makefile.am index e98c623..0b0635d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,28 +21,28 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - viterbi.c viterbi_generic.c sercomm.c + viterbi/viterbi.c viterbi/viterbi_generic.c sercomm.c if HAVE_SSE3 -libosmocore_la_SOURCES += viterbi_sse.c +libosmocore_la_SOURCES += viterbi/viterbi_sse.c if HAVE_SSE4_1 -viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 +viterbi/viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 else -viterbi_sse.lo : CFLAGS += -msse3 +viterbi/viterbi_sse.lo : CFLAGS += -msse3 endif if HAVE_AVX2 -libosmocore_la_SOURCES += viterbi_sse_avx.c +libosmocore_la_SOURCES += viterbi/viterbi_sse_avx.c if HAVE_SSE4_1 -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +viterbi/viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 else -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 +viterbi/viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 endif endif endif BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c -EXTRA_DIST = viterbi_sse_common.h +EXTRA_DIST = viterbi/viterbi_sse_common.h if ENABLE_PLUGIN libosmocore_la_SOURCES += plugin.c diff --git a/src/viterbi.c b/src/viterbi/viterbi.c similarity index 100% rename from src/viterbi.c rename to src/viterbi/viterbi.c diff --git a/src/viterbi_generic.c b/src/viterbi/viterbi_generic.c similarity index 100% rename from src/viterbi_generic.c rename to src/viterbi/viterbi_generic.c diff --git a/src/viterbi_sse.c b/src/viterbi/viterbi_sse.c similarity index 98% rename from src/viterbi_sse.c rename to src/viterbi/viterbi_sse.c index f389085..412a18c 100644 --- a/src/viterbi_sse.c +++ b/src/viterbi/viterbi_sse.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_avx.c b/src/viterbi/viterbi_sse_avx.c similarity index 98% rename from src/viterbi_sse_avx.c rename to src/viterbi/viterbi_sse_avx.c index b4c45a6..6181ba5 100644 --- a/src/viterbi_sse_avx.c +++ b/src/viterbi/viterbi_sse_avx.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_common.h b/src/viterbi/viterbi_sse_common.h similarity index 100% rename from src/viterbi_sse_common.h rename to src/viterbi/viterbi_sse_common.h -- To view, visit https://gerrit.osmocom.org/2782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifbcb020c1302e49de2a9afe8567f851a16a023e6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From admin at opensuse.org Sun Jun 4 19:54:31 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 04 Jun 2017 19:54:31 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <593465a334c1d_3e01740f7c298019@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: [ 260s] -[..] Encoding / Decoding cycle : OK [ 260s] -[..] Encoding / Decoding cycle : OK [ 260s] -[..] Encoding / Decoding cycle : OK [ 260s] - [ 260s] -[+] Testing: gsm0503_mcs9 [ 260s] -[.] Input length : ret = 606 exp = 606 -> OK [ 260s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 260s] -[.] Random vector checks: [ 260s] -[..] Encoding / Decoding cycle : OK [ 260s] -[..] Encoding / Decoding cycle : OK [ 260s] -[..] Encoding / Decoding cycle : OK [ 260s] - [ 260s] ./testsuite.at:57: exit code was 132, expected 0 [ 260s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 260s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 260s] make[1]: *** [override_dh_auto_test] Error 1 [ 260s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 260s] debian/rules:15: recipe for target 'build' failed [ 260s] make: *** [build] Error 2 [ 260s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 260s] [ 260s] build31 failed "build libosmocore_0.9.6.20170604.dsc" at Sun Jun 4 19:54:12 UTC 2017. [ 260s] [ 260s] ### VM INTERACTION START ### [ 263s] [ 246.245565] reboot: Power down [ 263s] ### VM INTERACTION END ### [ 263s] [ 263s] build31 failed "build libosmocore_0.9.6.20170604.dsc" at Sun Jun 4 19:54:17 UTC 2017. [ 263s] -- 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 Jun 4 19:57:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 4 Jun 2017 19:57:47 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 6: (5 comments) https://gerrit.osmocom.org/#/c/2779/6/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 414: if self.mcc is None or self.mnc is None: > I assume that mcc_mnc is either set, i.e. a tuple of two number strings, or ACK, will consider only either None or a complete tuple without None elements. Line 427: self.log('Already registered with the network') > I'd prefer: have one separate function to return true when we are already c I'll have a look at the API what's the best way of checking that and come with a new version using that. Line 454: self.mcc, self.mnc = mcc_mnc > IMHO store it as mcc_mnc everywhere. If you need to check separately, do th ACK https://gerrit.osmocom.org/#/c/2779/6/suites/debug/interactive.py File suites/debug/interactive.py: Line 30: wait(m.is_connected) > we wait until both are true, so the order doesn't matter much semantically. As I said I still think it makes more sense from time-sequence point of view to check as it's done in here and having some extra packets in the pcap file is not a big issue for me, but OK, I'll swap them. https://gerrit.osmocom.org/#/c/2779/6/suites/netreg/register_default.py File suites/netreg/register_default.py: Line 18: print(ms.properties()) > (rather use ms.info() I guess, properties() are bloated) ACK -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 6 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: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 5 04:05:19 2017 From: gerrit-no-reply at lists.osmocom.org (Gerard) Date: Mon, 5 Jun 2017 04:05:19 +0000 Subject: [PATCH] mncc-python[master]: Bearer capability not provided during MO call using mncc-pyt... Message-ID: Review at https://gerrit.osmocom.org/2841 Bearer capability not provided during MO call using mncc-python, which results in GSM IE error (96) invalid mandatory information sent by Network -> MS (mncc-python) Verified this error by GSMTAP using mncc-python interface OsmocomBB to network Proposed Changes: In case of MO call (_onmncc_setup_req) caller needs to provide bearer_cap speech version Added mncc.bearer_cap in mncc_sock.py based on codecs = GSM48.AllCodecs Added new field mncc.MNCC_F_BEARER_CAP in mncc.MNCC_SETUP_REQ, when call is initiated (MO) from MS -> network Change-Id: If77851b86111d62d82221a886ed2391179080cca --- M gsm_call_fsm.py M mncc_sock.py 2 files changed, 16 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/41/2841/1 diff --git a/gsm_call_fsm.py b/gsm_call_fsm.py index fa15940..167a805 100644 --- a/gsm_call_fsm.py +++ b/gsm_call_fsm.py @@ -14,7 +14,7 @@ import pykka from fysom import Fysom -from mncc_sock import mncc_msg, mncc_number, mncc_rtp_msg, mncc_bridge_msg +from mncc_sock import mncc_msg, mncc_number, mncc_rtp_msg, mncc_bridge_msg, mncc_bearer_cap Uint32Array2 = mncc.uint32_t * 2 @@ -82,9 +82,10 @@ def _onmncc_setup_req(self, e): msg = mncc_msg(msg_type = mncc.MNCC_SETUP_REQ, callref = self.callref, - fields = mncc.MNCC_F_CALLED | mncc.MNCC_F_CALLING, + fields = mncc.MNCC_F_CALLED | mncc.MNCC_F_CALLING | mncc.MNCC_F_BEARER_CAP, calling = mncc_number(self.calling), - called = mncc_number(self.called)) + called = mncc_number(self.called), + bearer_cap = mncc_bearer_cap(self.codecs_permitted)) self.mncc_ref.tell({'type': 'send', 'msg': msg}) def find_matching_codec(self, ms_codecs): diff --git a/mncc_sock.py b/mncc_sock.py index 3d29691..3cc1ba1 100644 --- a/mncc_sock.py +++ b/mncc_sock.py @@ -52,6 +52,18 @@ plan = num_plan, present = num_present, screen = num_screen) +def mncc_bearer_cap(codecs_permitted): + speech_ver = ctypes.c_int * 8 + speech_types = speech_ver() + index = 0 + + for codec in codecs_permitted: + speech_types[index] = codec + index = index + 1 + + speech_types[index] = -1 + return mncc.gsm_mncc_bearer_cap(coding = 0, speech_ctm=0, radio = 1, speech_ver = speech_types, transfer = 0, mode = 0) + class MnccSocketBase(object): def send(self, msg): return self.sock.sendall(msg.send()) -- To view, visit https://gerrit.osmocom.org/2841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If77851b86111d62d82221a886ed2391179080cca Gerrit-PatchSet: 1 Gerrit-Project: mncc-python Gerrit-Branch: master Gerrit-Owner: Gerard From gerrit-no-reply at lists.osmocom.org Mon Jun 5 06:25:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:25:48 +0000 Subject: [PATCH] osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs 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/2745 to look at the new patch set (#5). trx: Allow BTS and TRX to be on different IPs Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 --- M doc/examples/trx/osmo-bts.cfg M include/osmo-bts/phy_link.h M src/osmo-bts-trx/main.c M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 6 files changed, 49 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/2745/5 diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg index 29d5655..e455540 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -23,6 +23,8 @@ phy 0 instance 0 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 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4d1dadb..4c7ff34 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -37,7 +37,8 @@ struct { } sysmobts; struct { - char *transceiver_ip; + char *local_ip; + char *remote_ip; uint16_t base_port_local; uint16_t base_port_remote; struct osmo_fd trx_ofd_clk; diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 0148e5b..b2cbb39 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -113,7 +113,8 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.local_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.remote_ip = talloc_strdup(plink, "127.0.0.1"); plink->u.osmotrx.base_port_local = 5800; plink->u.osmotrx.base_port_remote = 5700; plink->u.osmotrx.clock_advance = 20; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 989e77a..c676d11 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -57,14 +57,10 @@ */ /* open socket */ -static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host, - uint16_t port_local, uint16_t port_remote, +static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, + uint16_t port_local, const char *host_remote, uint16_t port_remote, int (*cb)(struct osmo_fd *fd, unsigned int what)) { - struct sockaddr_storage sas; - struct sockaddr *sa = (struct sockaddr *)&sas; - socklen_t sa_len; - int rc; /* Init */ @@ -72,30 +68,10 @@ ofd->cb = cb; ofd->data = priv; - /* Listen / Binds */ - rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, host, - port_local, OSMO_SOCK_F_BIND); + /* Listen / Binds + Connect */ + rc = osmo_sock_init2_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, host_local, port_local, + host_remote, port_remote, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); if (rc < 0) - return rc; - - /* Connect */ - sa_len = sizeof(sas); - rc = getsockname(ofd->fd, sa, &sa_len); - if (rc) - return rc; - - if (sa->sa_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - sin->sin_port = htons(port_remote); - } else if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - sin6->sin6_port = htons(port_remote); - } else { - return -EINVAL; - } - - rc = connect(ofd->fd, sa, sa_len); - if (rc) return rc; return 0; @@ -528,8 +504,9 @@ /* open the shared/common clock socket */ rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, plink->u.osmotrx.base_port_remote, trx_clk_read_cb); if (rc < 0) { @@ -588,14 +565,16 @@ /* open sockets */ rc = trx_udp_open(l1h, &l1h->trx_ofd_ctrl, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 0), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 0), trx_ctrl_read_cb); if (rc < 0) goto err; rc = trx_udp_open(l1h, &l1h->trx_ofd_data, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 1), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 1), trx_data_read_cb); if (rc < 0) goto err; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index fdc8a8d..05e8bff 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,7 +2,8 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *transceiver_ip; +extern const char *local_ip; +extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3822b0f..123ca80 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -459,14 +460,31 @@ DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR - "Set remote IP address\n" - "IP address of OsmoTRX\n") + "Set local and remote IP address\n" + "IP address (for both OsmoBtsTrx and OsmoTRX)\n") { struct phy_link *plink = vty->index; - if (plink->u.osmotrx.transceiver_ip) - talloc_free(plink->u.osmotrx.transceiver_ip); - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_osmotrx_ip, cfg_phy_osmotrx_ip_cmd, + "osmotrx ip (local|remote) A.B.C.D", + OSMOTRX_STR + "Set IP address\n" "Local IP address (BTS)\n" + "Remote IP address (OsmoTRX)\n" "IP address\n") +{ + struct phy_link *plink = vty->index; + + if (!strcmp(argv[0], "local")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[1]); + else if (!strcmp(argv[0], "remote")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[1]); + else + return CMD_WARNING; return CMD_SUCCESS; } @@ -488,9 +506,12 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { - if (plink->u.osmotrx.transceiver_ip) - vty_out(vty, " osmotrx ip %s%s", - plink->u.osmotrx.transceiver_ip, VTY_NEWLINE); + if (plink->u.osmotrx.local_ip) + vty_out(vty, " osmotrx ip local %s%s", + plink->u.osmotrx.local_ip, VTY_NEWLINE); + if (plink->u.osmotrx.remote_ip) + vty_out(vty, " osmotrx ip remote %s%s", + plink->u.osmotrx.remote_ip, VTY_NEWLINE); vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); @@ -568,6 +589,7 @@ install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); + install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 5 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 Jun 5 06:25:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:25:57 +0000 Subject: osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 5 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 Jun 5 06:29:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:29:56 +0000 Subject: openbsc[master]: Get TRX attributes In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/2783/5/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 487: LOGP(DNM, LOGL_NOTICE, "Get Attributes Response: BTS%u/TRX%u nominal power is %u\n", we have gsm_trx_name() and should probably use it. Or, if we want to print this even for non-existing TRX, we should use the same format as gsm_trx_name() to ensure existing regular expressions/grep will catch this in the same manner like all other messages for that trx. -- To view, visit https://gerrit.osmocom.org/2783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Gerrit-PatchSet: 5 Gerrit-Project: openbsc 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 Jun 5 06:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:30:13 +0000 Subject: [MERGED] openbsc[master]: Adjust BTS model feature check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Adjust BTS model feature check ...................................................................... Adjust BTS model feature check Rename gsm_bts_has_feature() -> gsm_btsmodel_has_feature() and adjust type signature to match gsm_btsmodel_set_feature() function and avoid confusion with upcoming functions to check/set BTS features reported over OML. Change-Id: I97abdedbef568e0c2fbd37c110f7d658cf20e100 Related: OS#1614 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libcommon/gsm_data.c 3 files changed, 9 insertions(+), 9 deletions(-) Approvals: 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 6d814c8..05d834e 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -562,7 +562,7 @@ uint8_t e1_ts, uint8_t e1_ts_ss); void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); -int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat); +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); int gsm_bts_set_system_infos(struct gsm_bts *bts); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index f17bde6..0ee2390 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3607,7 +3607,7 @@ { struct gsm_bts_trx_ts *ts = vty->index; - if (!gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_MULTI_TSC)) { + if (!gsm_btsmodel_has_feature(ts->trx->bts->model, BTS_FEAT_MULTI_TSC)) { vty_out(vty, "%% This BTS does not support a TSC != BCC, " "falling back to BCC%s", VTY_NEWLINE); ts->tsc = -1; @@ -3630,7 +3630,7 @@ struct gsm_bts_trx_ts *ts = vty->index; int enabled = atoi(argv[0]); - if (enabled && !gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_HOPPING)) { + if (enabled && !gsm_btsmodel_has_feature(ts->trx->bts->model, BTS_FEAT_HOPPING)) { vty_out(vty, "BTS model does not support hopping%s", VTY_NEWLINE); return CMD_WARNING; diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 8ec0be5..2c7ea0a 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -199,11 +199,11 @@ int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) { if (mode != BTS_GPRS_NONE && - !gsm_bts_has_feature(bts, BTS_FEAT_GPRS)) { + !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { return 0; } if (mode == BTS_GPRS_EGPRS && - !gsm_bts_has_feature(bts, BTS_FEAT_EGPRS)) { + !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { return 0; } @@ -223,14 +223,14 @@ return meas_rep; } -int gsm_btsmodel_set_feature(struct gsm_bts_model *bts, enum gsm_bts_features feat) +int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { - return bitvec_set_bit_pos(&bts->features, feat, 1); + return bitvec_set_bit_pos(&model->features, feat, 1); } -int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat) +bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { - return bitvec_get_bit_pos(&bts->model->features, feat); + return bitvec_get_bit_pos(&model->features, feat); } int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -- To view, visit https://gerrit.osmocom.org/2794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97abdedbef568e0c2fbd37c110f7d658cf20e100 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 5 06:30:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:30:20 +0000 Subject: openbsc[master]: Add remote BTS feature storage and helpers In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02bd317097ba66585c50ebd4e8fc348f6dc3dad9 Gerrit-PatchSet: 3 Gerrit-Project: openbsc 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 Jun 5 06:30:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:30:23 +0000 Subject: [MERGED] openbsc[master]: Add remote BTS feature storage and helpers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add remote BTS feature storage and helpers ...................................................................... Add remote BTS feature storage and helpers In addition to compile-time defined BTS model features we also need run-time BTS features reported by BTS via OML. This should be shared by BSC and BTS. To accommodate for this, add following: * features bitvec to gsm_bts struct * features descriptions * comments to avoid confusion between 2 feature sets * helper functions to set/query particular feature * upper boundary on number of supported features and assertion for it Change-Id: I02bd317097ba66585c50ebd4e8fc348f6dc3dad9 Related: OS#1614 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data.c M openbsc/src/libcommon/gsm_data_shared.c 3 files changed, 39 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 1380a6c..b920e3b 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -535,10 +535,13 @@ 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, @@ -549,7 +552,10 @@ 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 @@ -681,6 +687,10 @@ 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]; @@ -911,6 +921,18 @@ 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 * diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 2c7ea0a..8830ce1 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -225,11 +225,13 @@ int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); return bitvec_set_bit_pos(&model->features, feat, 1); } bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); return bitvec_get_bit_pos(&model->features, feat); } diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index f404363..7743b69 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -106,6 +106,19 @@ 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" }, @@ -343,6 +356,8 @@ 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; -- To view, visit https://gerrit.osmocom.org/2797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02bd317097ba66585c50ebd4e8fc348f6dc3dad9 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 5 06:31:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:31:34 +0000 Subject: openbsc[master]: Request and parse BTS feature list via OML In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2800/2/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 488: LOGP(DNM, LOGL_NOTICE, "Get Attributes Response: BTS%u feature vector is truncated to %u bytes\n", log messages should have formatting as consistent as possible. Sometimes you start with BTS%u, in other cases it's in the middle of the line. Is that really necessary? -- To view, visit https://gerrit.osmocom.org/2800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Jun 5 06:41:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 5 Jun 2017 06:41:24 +0000 Subject: osmo-bts[master]: Extend Get Attribute responder In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/2786/3/src/common/oml.c File src/common/oml.c: Line 178: if (power <= 0) a negative or zero dBm value might be a bit unusual but well within the capabilities of most hardware and used in the context of e.g. testing or direct wired/cabled connections. get_p_max_out_mdBm() should be used in this context, with no fall-back. If it results in invalid values, it's a bug by osmo-bts. OML will reduce that power by max_pwr_red, but applying it prematurely here doesn't make sense. The terminology in the specs is unfortunately not always consistent. Line 187: msgb_tv_put(msg, NM_ATT_MANUF_STATE, power); why are we encoding the power in an IE that is called STATE ?!? Line 191: static inline int cleanup_attr_msg(struct msgb *msg, int length, uint8_t *out) * we generally have the output argument as first, just like memcpy() * we generlaly use 'const *' for input arguments * 'length' normally implies the length of the output buffer. If you mean an offset into the buffer, call it accordingly Also, an honest question: why do we pass attr_out_index+1 into the function, only to remove that byte here in the function body? -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 3 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 Mon Jun 5 11:56:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 5 Jun 2017 11:56:33 +0000 Subject: osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs In-Reply-To: References: Message-ID: Patch Set 5: Just curious, why the change from HOST to A.B.C.D? -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 5 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-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 5 13:19:01 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 5 Jun 2017 13:19:01 +0000 Subject: [PATCH] osmo-bts[master]: scheduler_trx.c: strip unused variable Message-ID: Review at https://gerrit.osmocom.org/2842 scheduler_trx.c: strip unused variable Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/2842/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 8531d5c..cbcde8c 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1428,8 +1428,6 @@ /* check if transceiver is still alive */ if (transceiver_lost++ == TRX_LOSS_FRAMES) { - struct gsm_bts_trx *trx; - LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); no_clock: -- To view, visit https://gerrit.osmocom.org/2842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 5 14:35:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 5 Jun 2017 14:35:27 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 unless someone thinks we should rather require py3, I agree. Also because otherwise py3 would be required on NITB hardware. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 5 16:05:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 5 Jun 2017 16:05:01 +0000 Subject: [PATCH] osmo-gsm-tester[master]: add cmdline arg to set conf dir Message-ID: Review at https://gerrit.osmocom.org/2843 add cmdline arg to set conf dir Add -c cmdline option to do the same as In addition to the OSMO_GSM_TESTER_CONF var, because setting the var is cumbersome in daily development. Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 --- M src/osmo-gsm-tester.py M src/osmo_gsm_tester/config.py 2 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/43/2843/1 diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 5854836..0402802 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -117,6 +117,9 @@ help='Set logging level for all categories (on stdout)') parser.add_argument('-T', '--traceback', dest='trace', action='store_true', help='Enable logging of tracebacks') + parser.add_argument('-c', '--conf-dir', dest='conf_dir', + help='''Specify configuration dir (overrides +OSMO_GSM_TESTER_CONF env and default locations)''') args = parser.parse_args() if args.version: @@ -135,6 +138,8 @@ log.set_all_levels(log.LEVEL_STRS.get(args.log_level)) if args.trace: log.style_change(trace=True) + if args.conf_dir: + config.override_conf = args.conf_dir combination_strs = list(args.suite_scenario or []) # for series in args.series: diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index deb872f..38d8e2f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -59,6 +59,8 @@ ENV_PREFIX = 'OSMO_GSM_TESTER_' ENV_CONF = os.getenv(ENV_PREFIX + 'CONF') +override_conf = None + DEFAULT_CONFIG_LOCATIONS = [ '.', os.path.join(os.getenv('HOME'), '.config', 'osmo-gsm-tester'), @@ -82,7 +84,9 @@ PATHS = None def _get_config_file(basename, fail_if_missing=True): - if ENV_CONF: + if override_conf: + locations = [ override_conf ] + elif ENV_CONF: locations = [ ENV_CONF ] else: locations = DEFAULT_CONFIG_LOCATIONS -- To view, visit https://gerrit.osmocom.org/2843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 08:05:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 08:05:30 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 3: > otherwise py3 would be required on NITB hardware Why is that? NITB hardware uses Debian? I think we should just install python3 on buildslave - it should be just 1 command and eventually we'll have to migrate to it anyway. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 3 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel 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 Tue Jun 6 08:06:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 08:06:01 +0000 Subject: osmo-bts[master]: scheduler_trx.c: strip unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 6 08:09:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 08:09:08 +0000 Subject: mncc-python[master]: Bearer capability not provided during MO call using mncc-pyt... In-Reply-To: References: Message-ID: Patch Set 1: Purely cosmetic note so it shouldn't prevent from merging this: it's better to use common convention for commit messages where short topic line is followed by empty line and than detailed explanation. -- To view, visit https://gerrit.osmocom.org/2841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If77851b86111d62d82221a886ed2391179080cca Gerrit-PatchSet: 1 Gerrit-Project: mncc-python Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 6 13:53:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 6 Jun 2017 13:53:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() 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/2779 to look at the new patch set (#7). ofono_client: Implement network registration during connect() Also add a new simple test to check network registration is working Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c --- M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M suites/aoip_debug/interactive.py M suites/aoip_sms/mo_mt_sms.py M suites/debug/interactive.py A suites/netreg/register.py A suites/netreg/register_default.py A suites/netreg/suite.conf M suites/sms/mo_mt_sms.py 10 files changed, 223 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/79/2779/7 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 46300ec..394220f 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -22,6 +22,7 @@ from pydbus import SystemBus, Variant import time import pprint +import sys from gi.repository import GLib glib_main_loop = GLib.MainLoop() @@ -31,6 +32,12 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' + +# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 +NETREG_ST_REGISTERED = 'registered' +NETREG_ST_ROAMING = 'roaming' + +NETREG_MAX_REGISTER_ATTEMPTS = 3 class DeferredHandling: defer_queue = [] @@ -72,6 +79,55 @@ def list_modems(): root = systembus_get('/') return sorted(root.GetModems()) + +def _async_result_handler(obj, result, user_data): + '''Generic callback dispatcher called from glib loop when an async method + call has returned. This callback is set up by method dbus_async_call.''' + (result_callback, error_callback, real_user_data) = user_data + try: + ret = obj.call_finish(result) + except Exception: + etype, e = sys.exc_info()[:2] + # return exception as value + if error_callback: + error_callback(obj, e, real_user_data) + else: + result_callback(obj, e, real_user_data) + return + + ret = ret.unpack() + # to be compatible with standard Python behaviour, unbox + # single-element tuples and return None for empty result tuples + if len(ret) == 1: + ret = ret[0] + elif len(ret) == 0: + ret = None + result_callback(obj, ret, real_user_data) + +def dbus_async_call(proxymethod, instance, + *proxymethod_args, + result_handler=None, error_handler=None, + user_data=None, timeout=30, + **proxymethod_kwargs): + +#def dbus_async_call(proxymethod, instance, *args, **kwargs): + '''pydbus doesn't support asynchronous methods. This method adds support for + it until pydbus implements it''' + argdiff = len(proxymethod_args) - len(proxymethod._inargs) + if argdiff < 0: + raise TypeError(proxymethod.__qualname__ + " missing {} required positional argument(s)".format(-argdiff)) + elif argdiff > 0: + raise TypeError(proxymethod.__qualname__ + " takes {} positional argument(s) but {} was/were given".format(len(proxymethod._inargs), len(proxymethod_args))) + + timeout = timeout * 1000 + user_data = (result_handler, error_handler, user_data) + + ret = instance._bus.con.call( + instance._bus_name, instance._path, + proxymethod._iface_name, proxymethod.__name__, + GLib.Variant(proxymethod._sinargs, proxymethod_args), GLib.VariantType.new(proxymethod._soutargs), + 0, timeout, None, + _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. @@ -255,8 +311,10 @@ self.path = conf.get('path') self.set_name(self.path) self.set_log_category(log.C_TST) + self.mcc_mnc = None self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) + self.register_attempts = 0 self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), @@ -323,9 +381,71 @@ def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) - def connect(self, nitb): - 'set the modem up to connect to MCC+MNC from NITB config' - self.log('connect to', nitb) + def is_connected(self, mcc_mnc=None): + nr = self.dbus.interface(I_NETREG) + prop = nr.GetProperties() + status = prop.get('Status') + if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): + return False + if mcc_mnc is None: # Any network is fine and we are registered. + return True + mcc = prop.get('MobileCountryCode') + mnc = prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + return True + return False + + def schedule_scan_register(self): + if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: + self.raise_exn('Failed to find Network Operator', mcc_mnc=self.mcc_mnc, attempts=self.register_attempts) + self.register_attempts += 1 + nr = self.dbus.interface(I_NETREG) + self.dbg('Scanning for operators...') + # Scan method can take several seconds, and we don't want to block + # waiting for that. Make it async and try to register when the scan is + # finished. + dbus_async_call(nr.Scan, nr, timeout=30, result_handler=self.scan_result_cb, + error_handler=self.scan_error_cb, user_data=None) + + def scan_error_cb(self, obj, e, user_data): + self.raise_exn('Scan() failed:', e) + + def scan_result_cb(self, obj, result, user_data): + self.register(result) + + def register(self, scanned_operators): + if self.mcc_mnc is None: + if not self.is_connected(): + self.log('Registering with the default network...') + nr = self.dbus.interface(I_NETREG) + nr.Register() + else: + self.log('Already registered with the network') + return + self.dbg('scanned operators: ', scanned_operators); + myop = None + for op in scanned_operators: + op_path, op_prop = op + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + if (mcc, mnc) == self.mcc_mnc: + if op_prop.get('Status') == 'current': + self.log('Already registered with the network') + # return and not try to re-connect, otherwise dbus method returns a fail + return + myop = op_path + break + if myop is None: + self.dbg('Failed to find Network Operator', mcc_mnc=self.mcc_mnc, attempts=self.register_attempts) + self.schedule_scan_register() + return + dbus_op = systembus_get(myop) + self.log('Registering with operator', myop) + dbus_op.Register() + + def power_cycle(self): + 'Power the modem and put it online' + self.dbg('Powering on') if self.is_powered(): self.dbg('is powered') self.set_online(False) @@ -335,6 +455,19 @@ self.set_online() event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10) + def connect(self, mcc_mnc=None): + 'Connect to MCC+MNC from NITB config' + if mcc_mnc is not None and (len(mcc_mnc) != 2 or None in mcc_mnc): + self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + self.mcc_mnc = mcc_mnc + self.power_cycle() + self.log('connect to', self.mcc_mnc if self.mcc_mnc else 'default network') + self.register_attempts = 0 + if self.is_connected(self.mcc_mnc): + self.log('Already registered with the network') + else: + self.schedule_scan_register() + def sms_send(self, to_msisdn_or_modem, *tokens): if isinstance(to_msisdn_or_modem, Modem): to_msisdn = to_msisdn_or_modem.msisdn diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ca0e246..b2507c8 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -37,6 +37,7 @@ self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw + self.config = None def start(self): self.log('Starting osmo-msc') @@ -72,6 +73,7 @@ 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()) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -83,6 +85,15 @@ def addr(self): return self.ip_address.get('addr') + def mcc(self): + return self.config['msc']['net']['mcc'] + + def mnc(self): + return self.config['msc']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..b4bf247 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -76,6 +76,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -91,6 +92,15 @@ self.bts.append(bts) bts.set_bsc(self) + def mcc(self): + return self.config['nitb']['net']['mcc'] + + def mnc(self): + return self.config['nitb']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_add(self, modem, msisdn=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 7cc1b76..cfedd3a 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -18,7 +18,7 @@ for m in modems: hlr.subscriber_add(m) - m.connect(bsc) + m.connect(msc.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -30,6 +30,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index b9383ea..8eba842 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -21,13 +21,15 @@ hlr.subscriber_add(ms_mo) hlr.subscriber_add(ms_mt) -ms_mo.connect(bsc) -ms_mt.connect(bsc) +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) sms = ms_mo.sms_send(ms_mt) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 603e395..37076dc 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -13,7 +13,7 @@ for m in modems: nitb.subscriber_add(m) - m.connect(nitb) + m.connect(nitb.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -25,6 +25,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/netreg/register.py b/suites/netreg/register.py new file mode 100755 index 0000000..9141986 --- /dev/null +++ b/suites/netreg/register.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +print(ms.info()) + +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/register_default.py b/suites/netreg/register_default.py new file mode 100755 index 0000000..d15b3f5 --- /dev/null +++ b/suites/netreg/register_default.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect() + +print(ms.info()) + +wait(ms.is_connected) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/suite.conf b/suites/netreg/suite.conf new file mode 100644 index 0000000..1bb1dbb --- /dev/null +++ b/suites/netreg/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 40s diff --git a/suites/sms/mo_mt_sms.py b/suites/sms/mo_mt_sms.py index 860f5e7..4e0ba08 100755 --- a/suites/sms/mo_mt_sms.py +++ b/suites/sms/mo_mt_sms.py @@ -14,13 +14,15 @@ nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) ms_mo.log_info() ms_mt.log_info() print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) sms = ms_mo.sms_send(ms_mt) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 7 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 Jun 6 14:11:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 14:11:06 +0000 Subject: [PATCH] openbsc[master]: Request and parse BTS feature list via OML 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/2800 to look at the new patch set (#3). Request and parse BTS feature list via OML Request features supported by BTS when getting attributes over OML. Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Related: OS#1614 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/2800/3 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 38c47a3..551c0bf 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -473,6 +473,45 @@ return ari + num_unreported + 1; /* we have to account for 1st byte with number of unreported attributes */ } +/* Parse Attribute Response Info content for 3GPP TS 52.021 ?9.4.30 Manufacturer Id */ +static inline uint8_t *parse_attr_resp_info_manuf_id(struct gsm_bts *bts, uint8_t *data, uint16_t *data_len) +{ + struct tlv_parsed tp; + uint16_t m_id_len = 0; + uint8_t adjust = 0, i; + + abis_nm_tlv_parse(&tp, bts, data, *data_len); + if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_ID, 2)) { + m_id_len = TLVP_LEN(&tp, NM_ATT_MANUF_ID); + + if (m_id_len > MAX_BTS_FEATURES/8 + 1) { + LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n", + bts->nr, MAX_BTS_FEATURES/8); + m_id_len = MAX_BTS_FEATURES/8; + } + + if (m_id_len > _NUM_BTS_FEAT/8 + 1) + LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " + "feature vector - most likely it was compiled against newer BSC headers. " + "Consider upgrading your BSC to later version.\n", + bts->nr, m_id_len); + + memcpy(bts->_features_data, TLVP_VAL(&tp, NM_ATT_MANUF_ID), m_id_len); + adjust = m_id_len + 3; /* adjust for parsed TL16V struct */ + + for (i = 0; i < _NUM_BTS_FEAT; i++) + if (gsm_bts_has_feature(bts, i) != gsm_btsmodel_has_feature(bts->model, i)) + LOGP(DNM, LOGL_NOTICE, "BTS%u feature '%s' reported via OML does not match statically " + "set feature: %u != %u. Please fix.\n", bts->nr, + get_value_string(gsm_bts_features_descs, i), + gsm_bts_has_feature(bts, i), gsm_btsmodel_has_feature(bts->model, i)); + } + + *data_len -= adjust; + + return data + adjust; +} + /* Parse Attribute Response Info content for 3GPP TS 52.021 ?9.4.28 Manufacturer Dependent State */ static inline uint8_t *parse_attr_resp_info_manuf_state(const struct gsm_bts_trx *trx, uint8_t *data, uint16_t *data_len) { @@ -522,6 +561,7 @@ &data_len); data = parse_attr_resp_info_manuf_state(trx, data, &data_len); + data = parse_attr_resp_info_manuf_id(bts, data, &data_len); /* after parsing manufacturer-specific attributes there's list of replies in form of sw-conf structure: */ rc = abis_nm_get_sw_conf(data, data_len, &sw_descr[0], ARRAY_SIZE(sw_descr)); -- To view, visit https://gerrit.osmocom.org/2800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 14:11:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 14:11:06 +0000 Subject: [PATCH] openbsc[master]: Get TRX attributes 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/2783 to look at the new patch set (#6). Get TRX attributes Request per-TRX attributes in addition to BTS attributes. Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Related: OS#1614 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/libcommon/gsm_data_shared.c 4 files changed, 77 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/2783/6 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index b920e3b..b72ed2d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -512,6 +512,7 @@ enum bts_attribute { BTS_TYPE_VARIANT, BTS_SUB_MODEL, + TRX_PHY_VERSION, }; struct vty; diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index ec1e478..38c47a3 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -439,14 +439,14 @@ return res; } -static inline bool handle_attr(struct gsm_bts *bts, enum bts_attribute id, uint8_t *val, uint8_t len) +static inline bool handle_attr(const struct gsm_bts *bts, enum bts_attribute id, uint8_t *val, uint8_t len) { switch (id) { case BTS_TYPE_VARIANT: - LOGP(DNM, LOGL_ERROR, "BTS reported variant: %s\n", val); + LOGP(DNM, LOGL_NOTICE, "BTS%u reported variant: %s\n", bts->nr, val); break; case BTS_SUB_MODEL: - LOGP(DNM, LOGL_ERROR, "BTS reported submodel: %s\n", val); + LOGP(DNM, LOGL_NOTICE, "BTS%u reported submodel: %s\n", bts->nr, val); break; default: return false; @@ -454,55 +454,87 @@ return true; } +/* Parse Attribute Response Info - return pointer to the actual content */ +static inline uint8_t *parse_attr_resp_info_unreported(uint8_t bts_nr, uint8_t *ari, uint16_t ari_len, uint16_t *out_len) +{ + uint8_t num_unreported = ari[0], i; + + DEBUGP(DNM, "BTS%u Get Attributes Response Info: %u bytes total with %u unreported attributes\n", + bts_nr, ari_len, num_unreported); + + /* +1 because we have to account for number of unreported attributes, prefixing the list: */ + for (i = 0; i < num_unreported; i++) + LOGP(DNM, LOGL_ERROR, "BTS%u Attribute %s is unreported\n", + bts_nr, get_value_string(abis_nm_att_names, ari[i + 1])); + + /* the data starts right after the list of unreported attributes + space for length of that list */ + *out_len = ari_len - (num_unreported + 2); + + return ari + num_unreported + 1; /* we have to account for 1st byte with number of unreported attributes */ +} + +/* Parse Attribute Response Info content for 3GPP TS 52.021 ?9.4.28 Manufacturer Dependent State */ +static inline uint8_t *parse_attr_resp_info_manuf_state(const struct gsm_bts_trx *trx, uint8_t *data, uint16_t *data_len) +{ + struct tlv_parsed tp; + const uint8_t *power; + uint8_t adjust = 0; + + if (!trx) /* this attribute does not make sense on BTS level, only on TRX level */ + return data; + + abis_nm_tlv_parse(&tp, trx->bts, data, *data_len); + if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_STATE, 1)) { + power = TLVP_VAL(&tp, NM_ATT_MANUF_STATE); + LOGP(DNM, LOGL_NOTICE, "%s Get Attributes Response: nominal power is %u\n", gsm_trx_name(trx), *power); + adjust = 2; /* adjust for parsed TV struct */ + } + + *data_len -= adjust; + + return data + adjust; +} + /* Handle 3GPP TS 52.021 ?9.4.64 Get Attribute Response Info */ -static int abis_nm_rx_get_attr_resp(struct msgb *mb, struct gsm_bts *bts) +static int abis_nm_rx_get_attr_resp(struct msgb *mb, const struct gsm_bts_trx *trx) { struct abis_om_hdr *oh = msgb_l2(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb); struct e1inp_sign_link *sign_link = mb->dst; + struct gsm_bts *bts = trx ? trx->bts : sign_link->trx->bts; struct tlv_parsed tp; - const uint8_t *ari; - uint8_t unreported, i; - uint16_t ari_len; + uint8_t *data, i; + uint16_t data_len; int rc; struct abis_nm_sw_desc sw_descr[MAX_BTS_ATTR]; abis_nm_debugp_foh(DNM, foh); - DEBUGPC(DNM, "Get Attributes Response\n"); + DEBUGPC(DNM, "Get Attributes Response for BTS%u\n", bts->nr); - abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh)); - - if (!TLVP_PRESENT(&tp, NM_ATT_GET_ARI)) { - LOGP(DNM, LOGL_ERROR, "Get Attributes Response without Response Info?!\n"); + abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); + if (!TLVP_PRES_LEN(&tp, NM_ATT_GET_ARI, 1)) { + LOGP(DNM, LOGL_ERROR, "BTS%u: Get Attributes Response without Response Info?!\n", bts->nr); return -EINVAL; } - ari = TLVP_VAL(&tp, NM_ATT_GET_ARI); - ari_len = TLVP_LEN(&tp, NM_ATT_GET_ARI); - /* Attributes Response Info has peculiar structure - first the number of unreported attributes */ - unreported = ari[0]; - DEBUGP(DNM, "Found Get Attributes Response Info: %u bytes total with %u unreported attributes\n", - ari_len, unreported); + data = parse_attr_resp_info_unreported(bts->nr, TLVP_VAL(&tp, NM_ATT_GET_ARI), TLVP_LEN(&tp, NM_ATT_GET_ARI), + &data_len); - /* than the list of unreported attributes */ - for (i = 0; i < unreported; i++) - LOGP(DNM, LOGL_ERROR, "Attribute %s is unreported\n", /* +1 because we have to account for number of */ - get_value_string(abis_nm_att_names, ari[i + 1])); /* unreported attributes, prefixing the list. */ + data = parse_attr_resp_info_manuf_state(trx, data, &data_len); - /* after that there's finally list of replies in form of sw-conf structure: - it starts right after the list of unreported attributes + space for length of that list */ - rc = abis_nm_get_sw_conf(ari + unreported + 1, ari_len - (unreported + 2), &sw_descr[0], ARRAY_SIZE(sw_descr)); + /* after parsing manufacturer-specific attributes there's list of replies in form of sw-conf structure: */ + rc = abis_nm_get_sw_conf(data, data_len, &sw_descr[0], ARRAY_SIZE(sw_descr)); if (rc > 0) { for (i = 0; i < rc; i++) { - if (!handle_attr(bts, str2btsattr((const char *)sw_descr[i].file_id), sw_descr[i].file_version, - sw_descr[i].file_version_len)) - LOGP(DNM, LOGL_NOTICE, "ARI reported sw[%d/%d]: %s is %s\n", - i, rc, sw_descr[i].file_id, sw_descr[i].file_version); + if (!handle_attr(bts, str2btsattr((const char *)sw_descr[i].file_id), + sw_descr[i].file_version, sw_descr[i].file_version_len)) + LOGP(DNM, LOGL_NOTICE, "BTS%u: ARI reported sw[%d/%d]: %s is %s\n", + bts->nr, i, rc, sw_descr[i].file_id, sw_descr[i].file_version); } } else - LOGP(DNM, LOGL_ERROR, "Failed to parse SW-Config part of Get Attribute Response Info: %s\n", - strerror(-rc)); + LOGP(DNM, LOGL_ERROR, "BTS%u: failed to parse SW-Config part of Get Attribute Response Info: %s\n", + bts->nr, strerror(-rc)); return 0; } @@ -720,7 +752,7 @@ case NM_MT_SET_BTS_ATTR_ACK: break; case NM_MT_GET_ATTR_RESP: - ret = abis_nm_rx_get_attr_resp(mb, bts); + ret = abis_nm_rx_get_attr_resp(mb, gsm_bts_trx_num(bts, (foh)->obj_inst.trx_nr)); break; default: abis_nm_debugp_foh(DNM, foh); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index caec800..e5226a9 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -316,10 +316,13 @@ struct input_signal_data *isd = signal_data; struct gsm_bts_trx *trx = isd->trx; int ts_no, lchan_no; - const uint8_t attr[] = { NM_ATT_SW_CONFIG, }; + /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ + const uint8_t bts_attr[] = { NM_ATT_MANUF_ID, NM_ATT_SW_CONFIG, }; + const uint8_t trx_attr[] = { NM_ATT_MANUF_STATE, NM_ATT_SW_CONFIG, }; /* we should not request more attributes than we're ready to handle */ - OSMO_ASSERT(sizeof(attr) < MAX_BTS_ATTR); + OSMO_ASSERT(sizeof(bts_attr) < MAX_BTS_ATTR); + OSMO_ASSERT(sizeof(trx_attr) < MAX_BTS_ATTR); if (subsys != SS_L_INPUT) return -EINVAL; @@ -339,14 +342,17 @@ set bts->si_common.cell_alloc */ generate_cell_chan_list(ca, trx->bts); + /* Request generic BTS-level attributes */ + abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - + /* Request TRX-level attributes */ + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); } - - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, attr, sizeof(attr)); } if (isd->link_type == E1INP_SIGN_RSL) bootstrap_rsl(trx); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 7743b69..8992636 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -54,6 +54,7 @@ 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 } }; -- To view, visit https://gerrit.osmocom.org/2783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 14:51:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 14:51:28 +0000 Subject: [PATCH] osmo-bts[master]: Extend Get Attribute responder 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/2786 to look at the new patch set (#4). Extend Get Attribute responder * detect if attributes are requested for BTS or TRX and act accordingly * report TRX phy version * report TRX nominal power Note: including phy_link.h to oml.c somehow breaks the tests so we have to add stub functions to unbreak them. Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Related: OS#1614 --- M src/common/oml.c M tests/agch/agch_test.c M tests/cipher/cipher_test.c M tests/handover/handover_test.c M tests/paging/paging_test.c 5 files changed, 89 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/2786/4 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..0067645 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include #include #include +#include static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg); @@ -153,37 +154,98 @@ return mo_buf; } -static inline struct msgb *add_bts_attr(const struct gsm_bts *bts) +static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - struct msgb *a = oml_msgb_alloc(); - - if (!a) - return NULL; - - abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); - abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + abis_nm_put_sw_file(msg, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); + abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); if (strlen(bts->sub_model)) - abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); - - return a; + abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } -static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len, uint8_t *out) +static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + + abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown", + true); +} + +/* Add nominal TRX power (if available) as 3GPP TS 52.021 ?9.4.28 Manufacturer Dependent State */ +static inline void add_trx_power(struct msgb *msg, struct gsm_bts_trx *trx) +{ + int power = get_p_max_out_mdBm(trx); + + if (power > UINT8_MAX) { + LOGP(DOML, LOGL_ERROR, "%s failed to report unexpectedly big nominal power value of %d\n", + gsm_trx_name(trx), power); + return; + } + + if (power < 0) { + LOGP(DOML, LOGL_ERROR, "%s failed to determine nominal power for report (got %d value)\n", + gsm_trx_name(trx), power); + return; + } + + msgb_tv_put(msg, NM_ATT_MANUF_STATE, power); +} + +/* copy all the attributes accumulated in msg to out and return the total length of out buffer */ +static inline int cleanup_attr_msg(uint8_t *out, int out_offset, struct msgb *msg) +{ + int len = 0; + + if (msg) { + memcpy(out + out_offset, msgb_data(msg), msg->len); + len = msg->len; + msgb_free(msg); + } + + return len + out_offset + 1; +} + +/* assemble values of supported attributes and list of unsupported ones */ +static inline int handle_attrs(const struct gsm_bts *bts, const struct gsm_abis_mo *mo, + const uint8_t *attr, uint16_t attr_len, uint8_t *out) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *ba = NULL; - int length; + struct msgb *attr_buf = oml_msgb_alloc(); + + if (!attr_buf) + return -ENOMEM; for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: switch (mo->obj_class) { case NM_OC_BTS: - ba = add_bts_attr(mo->bts); + add_bts_attrs(attr_buf, mo->bts); + break; + case NM_OC_BASEB_TRANSC: + add_trx_attr(attr_buf, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr)); break; default: - LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute " + "Response(NM_ATT_SW_CONFIG)\n", + get_value_string(abis_nm_obj_class_names, mo->obj_class)); + return -EINVAL; + } + break; + case NM_ATT_MANUF_STATE: + switch (mo->obj_class) { + case NM_OC_BTS: + LOGP(DOML, LOGL_NOTICE, "BTS does not support NM_ATT_MANUF_STATE in Get Attribute " + "Response\n"); + out[attr_out_index] = attr[i]; + attr_out_index++; + break; + case NM_OC_BASEB_TRANSC: + add_trx_power(attr_buf, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr)); + break; + default: + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute " + "Response(NM_ATT_MANUF_STATE)\n", get_value_string(abis_nm_obj_class_names, mo->obj_class)); return -EINVAL; } @@ -204,19 +266,11 @@ } else out[0] = attr_out_index - 1; /* Count number of unhandled attributes */ - length = attr_out_index + 1; - - if (ba) { - memcpy(out + attr_out_index, msgb_data(ba), ba->len); - length += ba->len; - msgb_free(ba); - } - - return length; + return cleanup_attr_msg(out, attr_out_index, attr_buf); } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ @@ -227,7 +281,7 @@ if (!nmsg) return -ENOMEM; - len = handle_attr(mo, attr, attr_len, resp); + len = handle_attrs(bts, mo, attr, attr_len, resp); if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); msgb_free(nmsg); @@ -489,7 +543,7 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c index e275c64..cf05a8d 100644 --- a/tests/agch/agch_test.c +++ b/tests/agch/agch_test.c @@ -35,6 +35,8 @@ 0x08, 0x59, 0x51, 0x30, 0x99, 0x00, 0x00, 0x00, 0x19 }; +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { return 0; } + static int count_imm_ass_rej_refs(struct gsm48_imm_ass_rej *rej) { int count = 0; diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c index c913925..957dbca 100644 --- a/tests/cipher/cipher_test.c +++ b/tests/cipher/cipher_test.c @@ -37,6 +37,8 @@ abort(); \ } +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { return 0; } + static void test_cipher_parsing(void) { int i; diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 611c441..3ca595a 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -270,6 +270,7 @@ int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) { return 0; } int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { return 0; } int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) { return 0; } +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { return 0; } int bts_model_init(struct gsm_bts *bts) { return 0; } int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) { return 0; } int bts_model_trx_close(struct gsm_bts_trx *trx) { return 0; } diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index 1d5f216..32bf484 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -41,6 +41,8 @@ abort(); \ } +int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm) { return 0; } + static void test_paging_smoke(void) { int rc; -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 14:51:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 14:51:29 +0000 Subject: [PATCH] osmo-bts[master]: Re-add version to phy_instance Message-ID: Review at https://gerrit.osmocom.org/2844 Re-add version to phy_instance This is resubmission of 9eeb0b1a136fc8c24a86cb4d832c264674c10db0 with errorneous use of talloc_asprintf() removed which should fix OS#2316. Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Related: OS#1614 --- M include/osmo-bts/phy_link.h M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/2844/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index e8fd7eb..4d1dadb 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -75,7 +75,7 @@ struct llist_head list; int num; char *description; - + char version[MAX_VERSION_LENGTH]; /* pointer to the PHY link to which we belong */ struct phy_link *phy_link; diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 4652e10..ccef231 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1140,14 +1140,14 @@ LOGP(DL1C, LOGL_INFO, "Tx APP-INFO-SYSTEM.req\n"); - return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, 0); + return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, pinst); } static int app_info_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp, void *data) { char ver_hdr[32]; - + struct phy_instance *pinst = data; tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *air = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *) resp->l2h; @@ -1171,6 +1171,7 @@ talloc_replace(fl1h->info.app.name, fl1h, air->szName); talloc_replace(fl1h->info.app.description, fl1h, air->szDescription); talloc_replace(fl1h->info.app.version, fl1h, air->szVersion); + osmo_strlcpy(pinst->version, ver_hdr, sizeof(pinst->version)); /* in a completion call-back, we take msgb ownership and must * release it before returning */ diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 60638e1..9d74c5e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1875,6 +1875,9 @@ hdl = pinst->u.sysmobts.hdl; osmo_strlcpy(bts->sub_model, sysmobts_model(hdl->hw_info.model_nr, hdl->hw_info.trx_nr), sizeof(bts->sub_model)); + osmo_strlcpy(pinst->version, "%u.%u dsp %u.%u.%u fpga %u.%u.%u", hdl->hw_info.ver_major, hdl->hw_info.ver_minor, + hdl->hw_info.dsp_version[0], hdl->hw_info.dsp_version[1], hdl->hw_info.dsp_version[2], + hdl->hw_info.fpga_version[0], hdl->hw_info.fpga_version[1], hdl->hw_info.fpga_version[2]); phy_link_state_set(plink, PHY_LINK_CONNECTED); -- To view, visit https://gerrit.osmocom.org/2844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 6 14:56:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 14:56:50 +0000 Subject: osmo-bts[master]: Extend Get Attribute responder In-Reply-To: References: Message-ID: Patch Set 3: > get_p_max_out_mdBm() should be used in this context, with no fall-back See updated revision, not sure if I'm doing it right - is there some limit on returned value? > why are we encoding the power in an IE that is called STATE ?!? Because I was unable to find any other suitable attribute among the 3GPP TS 52.021 ?9.4 so I've used manufacturer-depended attribute. Which one would be better to use in this case? > why do we pass attr_out_index+1 into the function Well, we either pass +1 or return +1 - see updated version. -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 6 15:03:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 15:03:51 +0000 Subject: [PATCH] osmo-bts[master]: Re-add version to phy_instance In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2844 to look at the new patch set (#2). Re-add version to phy_instance This is resubmission of 9eeb0b1a136fc8c24a86cb4d832c264674c10db0 with errorneous use of talloc_asprintf() removed which should fix OS#2316. Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Related: OS#1614 --- M include/osmo-bts/phy_link.h M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/2844/2 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index e8fd7eb..4d1dadb 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -75,7 +75,7 @@ struct llist_head list; int num; char *description; - + char version[MAX_VERSION_LENGTH]; /* pointer to the PHY link to which we belong */ struct phy_link *phy_link; diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 4652e10..ccef231 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1140,14 +1140,14 @@ LOGP(DL1C, LOGL_INFO, "Tx APP-INFO-SYSTEM.req\n"); - return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, 0); + return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, pinst); } static int app_info_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp, void *data) { char ver_hdr[32]; - + struct phy_instance *pinst = data; tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *air = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *) resp->l2h; @@ -1171,6 +1171,7 @@ talloc_replace(fl1h->info.app.name, fl1h, air->szName); talloc_replace(fl1h->info.app.description, fl1h, air->szDescription); talloc_replace(fl1h->info.app.version, fl1h, air->szVersion); + osmo_strlcpy(pinst->version, ver_hdr, sizeof(pinst->version)); /* in a completion call-back, we take msgb ownership and must * release it before returning */ diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 60638e1..79fccd9 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1875,6 +1875,10 @@ hdl = pinst->u.sysmobts.hdl; osmo_strlcpy(bts->sub_model, sysmobts_model(hdl->hw_info.model_nr, hdl->hw_info.trx_nr), sizeof(bts->sub_model)); + snprintf(pinst->version, sizeof(pinst->version), "%u.%u dsp %u.%u.%u fpga %u.%u.%u", + hdl->hw_info.ver_major, hdl->hw_info.ver_minor, + hdl->hw_info.dsp_version[0], hdl->hw_info.dsp_version[1], hdl->hw_info.dsp_version[2], + hdl->hw_info.fpga_version[0], hdl->hw_info.fpga_version[1], hdl->hw_info.fpga_version[2]); phy_link_state_set(plink, PHY_LINK_CONNECTED); -- To view, visit https://gerrit.osmocom.org/2844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb 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 Tue Jun 6 15:21:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 6 Jun 2017 15:21:12 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: Fix typo in sccp_types.h Message-ID: Review at https://gerrit.osmocom.org/2845 cosmetic: Fix typo in sccp_types.h change SCCP_RETURN_CAUSE_SEGMENTATION_FAOLURE to SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE Change-Id: I34f767234f677307bb04891b40f03109901c0f1b --- M include/sccp/sccp_types.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/45/2845/1 diff --git a/include/sccp/sccp_types.h b/include/sccp/sccp_types.h index e1dcfe7..4e99723 100644 --- a/include/sccp/sccp_types.h +++ b/include/sccp/sccp_types.h @@ -219,7 +219,7 @@ SCCP_RETURN_CAUSE_SCCP_FAILURE = 11, SCCP_RETURN_CAUSE_HOP_COUNTER_VIOLATION = 12, SCCP_RETURN_CAUSE_SEGMENTATION_NOT_SUPPORTED= 13, - SCCP_RETURN_CAUSE_SEGMENTATION_FAOLURE = 14 + SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE = 14 }; enum sccp_reset_cause { -- To view, visit https://gerrit.osmocom.org/2845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34f767234f677307bb04891b40f03109901c0f1b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jun 6 15:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 6 Jun 2017 15:27:32 +0000 Subject: [PATCH] osmo-bts[master]: Remove incorrect BTS number check Message-ID: Review at https://gerrit.osmocom.org/2846 Remove incorrect BTS number check According to log messages this is a range check but only lowest and highest values are checked so the error will be triggered for any BTS other than 0 configured in OpenBSC. Moreover, even if implemented as actual range check it will not make sense with the given range values because it's enforced by bts_nr type which is uint8_t. Hence, removing it altogether. Fixes: OS#2317 Change-Id: Ia3d5078ed1239d553c7200ceb5b08b638df33a15 --- M src/common/oml.c 1 file changed, 0 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/2846/1 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..61eb659 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -999,21 +999,6 @@ return -EIO; } - if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); - trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); - if (trx) { - trx->mo.obj_inst.bts_nr = 0; - trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; - trx->mo.obj_inst.ts_nr = 0xff; - oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, - "Formatted O&M with BTS %d out" - " of range (0:0xFF)", - foh->obj_inst.bts_nr); - } - return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); - } - switch (foh->msg_type) { case NM_MT_SET_BTS_ATTR: ret = oml_rx_set_bts_attr(bts, msg); @@ -1301,11 +1286,6 @@ msg->l3h = oh->data + 1 + idstrlen; foh = (struct abis_om_fom_hdr *) msg->l3h; - - if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Manufacturer O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); - return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); - } ret = oml_tlv_parse(&tp, foh->data, oh->length - sizeof(*foh)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/2846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3d5078ed1239d553c7200ceb5b08b638df33a15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 6 18:01:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 18:01:35 +0000 Subject: [PATCH] osmo-gsm-tester[master]: add cmdline arg to set conf dir In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2843 to look at the new patch set (#2). add cmdline arg to set conf dir Add -c cmdline option to do the same as / in addition to the OSMO_GSM_TESTER_CONF var, because setting the var is cumbersome in daily development. Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 --- M src/osmo-gsm-tester.py M src/osmo_gsm_tester/config.py 2 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/43/2843/2 diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 5854836..0402802 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -117,6 +117,9 @@ help='Set logging level for all categories (on stdout)') parser.add_argument('-T', '--traceback', dest='trace', action='store_true', help='Enable logging of tracebacks') + parser.add_argument('-c', '--conf-dir', dest='conf_dir', + help='''Specify configuration dir (overrides +OSMO_GSM_TESTER_CONF env and default locations)''') args = parser.parse_args() if args.version: @@ -135,6 +138,8 @@ log.set_all_levels(log.LEVEL_STRS.get(args.log_level)) if args.trace: log.style_change(trace=True) + if args.conf_dir: + config.override_conf = args.conf_dir combination_strs = list(args.suite_scenario or []) # for series in args.series: diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index deb872f..38d8e2f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -59,6 +59,8 @@ ENV_PREFIX = 'OSMO_GSM_TESTER_' ENV_CONF = os.getenv(ENV_PREFIX + 'CONF') +override_conf = None + DEFAULT_CONFIG_LOCATIONS = [ '.', os.path.join(os.getenv('HOME'), '.config', 'osmo-gsm-tester'), @@ -82,7 +84,9 @@ PATHS = None def _get_config_file(basename, fail_if_missing=True): - if ENV_CONF: + if override_conf: + locations = [ override_conf ] + elif ENV_CONF: locations = [ ENV_CONF ] else: locations = DEFAULT_CONFIG_LOCATIONS -- To view, visit https://gerrit.osmocom.org/2843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 18:02:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 18:02:16 +0000 Subject: osmo-gsm-tester[master]: add cmdline arg to set conf dir In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 trivial, fast tracking -- To view, visit https://gerrit.osmocom.org/2843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Jun 6 18:02:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 18:02:18 +0000 Subject: [MERGED] osmo-gsm-tester[master]: add cmdline arg to set conf dir In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add cmdline arg to set conf dir ...................................................................... add cmdline arg to set conf dir Add -c cmdline option to do the same as / in addition to the OSMO_GSM_TESTER_CONF var, because setting the var is cumbersome in daily development. Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 --- M src/osmo-gsm-tester.py M src/osmo_gsm_tester/config.py 2 files changed, 10 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 5854836..0402802 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -117,6 +117,9 @@ help='Set logging level for all categories (on stdout)') parser.add_argument('-T', '--traceback', dest='trace', action='store_true', help='Enable logging of tracebacks') + parser.add_argument('-c', '--conf-dir', dest='conf_dir', + help='''Specify configuration dir (overrides +OSMO_GSM_TESTER_CONF env and default locations)''') args = parser.parse_args() if args.version: @@ -135,6 +138,8 @@ log.set_all_levels(log.LEVEL_STRS.get(args.log_level)) if args.trace: log.style_change(trace=True) + if args.conf_dir: + config.override_conf = args.conf_dir combination_strs = list(args.suite_scenario or []) # for series in args.series: diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index deb872f..38d8e2f 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -59,6 +59,8 @@ ENV_PREFIX = 'OSMO_GSM_TESTER_' ENV_CONF = os.getenv(ENV_PREFIX + 'CONF') +override_conf = None + DEFAULT_CONFIG_LOCATIONS = [ '.', os.path.join(os.getenv('HOME'), '.config', 'osmo-gsm-tester'), @@ -82,7 +84,9 @@ PATHS = None def _get_config_file(basename, fail_if_missing=True): - if ENV_CONF: + if override_conf: + locations = [ override_conf ] + elif ENV_CONF: locations = [ ENV_CONF ] else: locations = DEFAULT_CONFIG_LOCATIONS -- To view, visit https://gerrit.osmocom.org/2843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c3b482f31f638047ab3f3d785d294b28d244b80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 18:02:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 18:02:44 +0000 Subject: [PATCH] osmo-gsm-tester[master]: stdout logging options Message-ID: Review at https://gerrit.osmocom.org/2847 stdout logging options Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f --- M src/osmo-gsm-tester.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/47/2847/1 diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..3a042a9 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -116,7 +116,9 @@ default=None, help='Set logging level for all categories (on stdout)') parser.add_argument('-T', '--traceback', dest='trace', action='store_true', - help='Enable logging of tracebacks') + help='Enable stdout logging of tracebacks') + parser.add_argument('-R', '--source', dest='source', action='store_true', + help='Enable stdout logging of source file') parser.add_argument('-c', '--conf-dir', dest='conf_dir', help='''Specify configuration dir (overrides OSMO_GSM_TESTER_CONF env and default locations)''') @@ -138,6 +140,8 @@ log.set_all_levels(log.LEVEL_STRS.get(args.log_level)) if args.trace: log.style_change(trace=True) + if args.source: + log.style_change(src=True) if args.conf_dir: config.override_conf = args.conf_dir -- To view, visit https://gerrit.osmocom.org/2847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 18:03:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 18:03:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: add cmdline option -R to add src file log to stdout In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2847 to look at the new patch set (#2). add cmdline option -R to add src file log to stdout Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f --- M src/osmo-gsm-tester.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/47/2847/2 diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..3a042a9 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -116,7 +116,9 @@ default=None, help='Set logging level for all categories (on stdout)') parser.add_argument('-T', '--traceback', dest='trace', action='store_true', - help='Enable logging of tracebacks') + help='Enable stdout logging of tracebacks') + parser.add_argument('-R', '--source', dest='source', action='store_true', + help='Enable stdout logging of source file') parser.add_argument('-c', '--conf-dir', dest='conf_dir', help='''Specify configuration dir (overrides OSMO_GSM_TESTER_CONF env and default locations)''') @@ -138,6 +140,8 @@ log.set_all_levels(log.LEVEL_STRS.get(args.log_level)) if args.trace: log.style_change(trace=True) + if args.source: + log.style_change(src=True) if args.conf_dir: config.override_conf = args.conf_dir -- To view, visit https://gerrit.osmocom.org/2847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 19:48:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 6 Jun 2017 19:48:26 +0000 Subject: [MERGED] osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: trx: Allow BTS and TRX to be on different IPs ...................................................................... trx: Allow BTS and TRX to be on different IPs Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 --- M doc/examples/trx/osmo-bts.cfg M include/osmo-bts/phy_link.h M src/osmo-bts-trx/main.c M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 6 files changed, 49 insertions(+), 43 deletions(-) Approvals: Harald Welte: 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 29d5655..e455540 100644 --- a/doc/examples/trx/osmo-bts.cfg +++ b/doc/examples/trx/osmo-bts.cfg @@ -23,6 +23,8 @@ phy 0 instance 0 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 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index e8fd7eb..2164dfa 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -37,7 +37,8 @@ struct { } sysmobts; struct { - char *transceiver_ip; + char *local_ip; + char *remote_ip; uint16_t base_port_local; uint16_t base_port_remote; struct osmo_fd trx_ofd_clk; diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 0148e5b..b2cbb39 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -113,7 +113,8 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink) { - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.local_ip = talloc_strdup(plink, "127.0.0.1"); + plink->u.osmotrx.remote_ip = talloc_strdup(plink, "127.0.0.1"); plink->u.osmotrx.base_port_local = 5800; plink->u.osmotrx.base_port_remote = 5700; plink->u.osmotrx.clock_advance = 20; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 989e77a..c676d11 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -57,14 +57,10 @@ */ /* open socket */ -static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host, - uint16_t port_local, uint16_t port_remote, +static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, + uint16_t port_local, const char *host_remote, uint16_t port_remote, int (*cb)(struct osmo_fd *fd, unsigned int what)) { - struct sockaddr_storage sas; - struct sockaddr *sa = (struct sockaddr *)&sas; - socklen_t sa_len; - int rc; /* Init */ @@ -72,30 +68,10 @@ ofd->cb = cb; ofd->data = priv; - /* Listen / Binds */ - rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, host, - port_local, OSMO_SOCK_F_BIND); + /* Listen / Binds + Connect */ + rc = osmo_sock_init2_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, host_local, port_local, + host_remote, port_remote, OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); if (rc < 0) - return rc; - - /* Connect */ - sa_len = sizeof(sas); - rc = getsockname(ofd->fd, sa, &sa_len); - if (rc) - return rc; - - if (sa->sa_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - sin->sin_port = htons(port_remote); - } else if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - sin6->sin6_port = htons(port_remote); - } else { - return -EINVAL; - } - - rc = connect(ofd->fd, sa, sa_len); - if (rc) return rc; return 0; @@ -528,8 +504,9 @@ /* open the shared/common clock socket */ rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, plink->u.osmotrx.base_port_remote, trx_clk_read_cb); if (rc < 0) { @@ -588,14 +565,16 @@ /* open sockets */ rc = trx_udp_open(l1h, &l1h->trx_ofd_ctrl, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 0), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 0), trx_ctrl_read_cb); if (rc < 0) goto err; rc = trx_udp_open(l1h, &l1h->trx_ofd_data, - plink->u.osmotrx.transceiver_ip, + plink->u.osmotrx.local_ip, compute_port(pinst, 0, 1), + plink->u.osmotrx.remote_ip, compute_port(pinst, 1, 1), trx_data_read_cb); if (rc < 0) goto err; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index fdc8a8d..05e8bff 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,7 +2,8 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *transceiver_ip; +extern const char *local_ip; +extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3822b0f..123ca80 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -459,14 +460,31 @@ DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR - "Set remote IP address\n" - "IP address of OsmoTRX\n") + "Set local and remote IP address\n" + "IP address (for both OsmoBtsTrx and OsmoTRX)\n") { struct phy_link *plink = vty->index; - if (plink->u.osmotrx.transceiver_ip) - talloc_free(plink->u.osmotrx.transceiver_ip); - plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[0]); + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_osmotrx_ip, cfg_phy_osmotrx_ip_cmd, + "osmotrx ip (local|remote) A.B.C.D", + OSMOTRX_STR + "Set IP address\n" "Local IP address (BTS)\n" + "Remote IP address (OsmoTRX)\n" "IP address\n") +{ + struct phy_link *plink = vty->index; + + if (!strcmp(argv[0], "local")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.local_ip, argv[1]); + else if (!strcmp(argv[0], "remote")) + osmo_talloc_replace_string(plink, &plink->u.osmotrx.remote_ip, argv[1]); + else + return CMD_WARNING; return CMD_SUCCESS; } @@ -488,9 +506,12 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { - if (plink->u.osmotrx.transceiver_ip) - vty_out(vty, " osmotrx ip %s%s", - plink->u.osmotrx.transceiver_ip, VTY_NEWLINE); + if (plink->u.osmotrx.local_ip) + vty_out(vty, " osmotrx ip local %s%s", + plink->u.osmotrx.local_ip, VTY_NEWLINE); + if (plink->u.osmotrx.remote_ip) + vty_out(vty, " osmotrx ip remote %s%s", + plink->u.osmotrx.remote_ip, VTY_NEWLINE); vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); @@ -568,6 +589,7 @@ install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); + install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/2745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Gerrit-PatchSet: 6 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-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jun 6 19:52:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 6 Jun 2017 19:52:48 +0000 Subject: [MERGED] osmo-bts[master]: trx: Save osmotrx base-port vty properties In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: trx: Save osmotrx base-port vty properties ...................................................................... trx: Save osmotrx base-port vty properties Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 123ca80..4f74c44 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -513,6 +513,13 @@ vty_out(vty, " osmotrx ip remote %s%s", plink->u.osmotrx.remote_ip, VTY_NEWLINE); + if (plink->u.osmotrx.base_port_local) + vty_out(vty, " osmotrx base-port local %"PRIu16"%s", + plink->u.osmotrx.base_port_local, VTY_NEWLINE); + if (plink->u.osmotrx.base_port_remote) + vty_out(vty, " osmotrx base-port remote %"PRIu16"%s", + plink->u.osmotrx.base_port_remote, VTY_NEWLINE); + vty_out(vty, " osmotrx fn-advance %d%s", plink->u.osmotrx.clock_advance, VTY_NEWLINE); vty_out(vty, " osmotrx rts-advance %d%s", -- To view, visit https://gerrit.osmocom.org/2746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6 Gerrit-PatchSet: 6 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-Reviewer: Pau Espin Pedrol From admin at opensuse.org Tue Jun 6 19:54:07 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 06 Jun 2017 19:54:07 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5937088a58fe9_3ac11050f7c594899@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: [ 220s] -[..] Encoding / Decoding cycle : OK [ 220s] -[..] Encoding / Decoding cycle : OK [ 220s] -[..] Encoding / Decoding cycle : OK [ 220s] - [ 220s] -[+] Testing: gsm0503_mcs9 [ 220s] -[.] Input length : ret = 606 exp = 606 -> OK [ 220s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 220s] -[.] Random vector checks: [ 220s] -[..] Encoding / Decoding cycle : OK [ 220s] -[..] Encoding / Decoding cycle : OK [ 220s] -[..] Encoding / Decoding cycle : OK [ 220s] - [ 220s] ./testsuite.at:57: exit code was 132, expected 0 [ 220s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 220s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 220s] make[1]: *** [override_dh_auto_test] Error 1 [ 220s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 220s] debian/rules:15: recipe for target 'build' failed [ 220s] make: *** [build] Error 2 [ 220s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 220s] [ 220s] cumulus2 failed "build libosmocore_0.9.6.20170606.dsc" at Tue Jun 6 19:54:00 UTC 2017. [ 220s] [ 220s] ### VM INTERACTION START ### [ 223s] [ 206.953696] reboot: Power down [ 223s] ### VM INTERACTION END ### [ 223s] [ 223s] cumulus2 failed "build libosmocore_0.9.6.20170606.dsc" at Tue Jun 6 19:54:03 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 Tue Jun 6 21:29:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:29:10 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cosmetic: add whitespace in Origins class def Message-ID: Review at https://gerrit.osmocom.org/2848 cosmetic: add whitespace in Origins class def Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc --- M src/osmo_gsm_tester/log.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/48/2848/1 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index d662400..0ecd157 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -482,6 +482,7 @@ def __init__(self, origin=None): if origin is not None: self.add(origin) + def add(self, origin): if hasattr(origin, 'name'): origin_str = origin.name() @@ -490,6 +491,7 @@ if origin_str is None: raise RuntimeError('origin_str is None for %r' % origin) self.insert(0, origin_str) + def __str__(self): return '?'.join(self) -- To view, visit https://gerrit.osmocom.org/2848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 21:29:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:29:10 +0000 Subject: [PATCH] osmo-gsm-tester[master]: test API: allow passing resource requirements Message-ID: Review at https://gerrit.osmocom.org/2849 test API: allow passing resource requirements For all those API functions that directly use reserved_resources.get(), add a 'specifics' argument to be able to pick specific resources. For example, this allows to pick a suite.bts(specifics={'type': 'osmo-bts-sysmo'}) I needed this to test error reporting for over-using resources, but will most probably make sense in the future. Change-Id: If6f175f4bb53dec5306fb3c6479202a7bf1c7116 --- M src/osmo_gsm_tester/suite.py 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/49/2849/1 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..fb6cf36 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -286,8 +286,8 @@ return self.reserved_resources.free() - def ip_address(self): - return self.reserved_resources.get(resource.R_IP_ADDRESS) + def ip_address(self, specifics=None): + return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) def nitb(self, ip_address=None): if ip_address is None: @@ -314,11 +314,11 @@ ip_address = self.ip_address() return osmo_bsc.OsmoBsc(self, msc, ip_address) - def bts(self): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS)) + def bts(self, specifics=None): + return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) - def modem(self): - conf = self.reserved_resources.get(resource.R_MODEM) + def modem(self, specifics=None): + conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) self.dbg('create Modem object', conf=conf) modem = ofono_client.Modem(conf) self.register_for_cleanup(modem) -- To view, visit https://gerrit.osmocom.org/2849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6f175f4bb53dec5306fb3c6479202a7bf1c7116 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 21:55:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:55:45 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix problem in origin ancestry: don't add self twice Message-ID: Review at https://gerrit.osmocom.org/2850 fix problem in origin ancestry: don't add self twice Also add various comments to illustrate what is going on during origin resolution. In the regression tests' expectations, some duplicate entries in the origins are removed, and hence no list of deeper origin ancestry is printed anymore. Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 --- M selftest/process_test.ok M selftest/suite_test.ok M src/osmo_gsm_tester/log.py 3 files changed, 20 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/50/2850/1 diff --git a/selftest/process_test.ok b/selftest/process_test.ok index 4245eeb..f168ee3 100644 --- a/selftest/process_test.ok +++ b/selftest/process_test.ok @@ -1,7 +1,7 @@ -run foo: DBG: cd '[TMP]'; PATH=[$PATH] foo.py arg1 arg2 [foo?foo] -run foo: DBG: [TMP]/stdout [foo?foo] -run foo: DBG: [TMP]/stderr [foo?foo] -run foo(pid=[PID]): Launched [foo(pid=[PID])?foo(pid=[PID])] +run foo: DBG: cd '[TMP]'; PATH=[$PATH] foo.py arg1 arg2 +run foo: DBG: [TMP]/stdout +run foo: DBG: [TMP]/stderr +run foo(pid=[PID]): Launched stdout: (launched: [DATETIME]) foo stdout diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index b9a8fb3..fd4d743 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -6,11 +6,11 @@ --- -: ERR: RuntimeError: Suite not found: 'does_not_exist' in [PATH]/selftest/suite_test - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test -cnf empty_dir: DBG: reading suite.conf [empty_dir?empty_dir] +cnf empty_dir: DBG: reading suite.conf --- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test -cnf test_suite: DBG: reading suite.conf [test_suite?test_suite] +cnf test_suite: DBG: reading suite.conf defaults: timeout: 60s resources: @@ -26,21 +26,19 @@ cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir tst test_suite: Suite run start tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... -tst test_suite: DBG: {combining='resources'} [test_suite?test_suite] +tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] -tst test_suite: Reserving 1 x bts (candidates: 3) [test_suite?test_suite] +tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo - [test_suite?test_suite] -tst test_suite: Reserving 1 x ip_address (candidates: 3) [test_suite?test_suite] +tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 - [test_suite?test_suite] -tst test_suite: Reserving 2 x modem (candidates: 16) [test_suite?test_suite] +tst test_suite: Reserving 2 x modem (candidates: 16) tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f imsi: '901700000007801' ki: D620F48487B1B782DA55DF6717F08FF9 @@ -51,7 +49,6 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 - [test_suite?test_suite] tst hello_world.py:[LINENR] START [test_suite?hello_world.py] tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index d662400..416094f 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -352,10 +352,20 @@ def gather_origins(self): origins = Origins() + # this object shall always be seen as the immediate origin of the log message. origins.add(self) + # now go through the parents of this object. origin = self._parent_origin + # but if this object is "loose" and not set up with cascaded 'with' statements, + # take the last seen 'with' statement's object as next parent: if origin is None and Origin._global_current_origin is not None: origin = Origin._global_current_origin + # if this object is self is currently the _global_current_origin, + # we don't need to add it twice. + if origin is self: + origin = origin._parent_origin + # whichever we determined to be the parent above, go up through all its + # ancestors. while origin is not None: origins.add(origin) origin = origin._parent_origin -- To view, visit https://gerrit.osmocom.org/2850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 21:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:55:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: error log: clarify for reserving more resources than available Message-ID: Review at https://gerrit.osmocom.org/2851 error log: clarify for reserving more resources than available When trying to reserve more resources than available in the resources.conf, actually print an intelligible error message: catch the nameless error from solve() and fill in what was requested for solution. Change-Id: Iba3707f1aaeb40a58c616c33af52a60c9a2e7e1f --- M selftest/resource_test.py M src/osmo_gsm_tester/resource.py 2 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/51/2851/1 diff --git a/selftest/resource_test.py b/selftest/resource_test.py index 08f1fbf..c78485e 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -39,7 +39,7 @@ [2], [0, 2] ]) assert False -except resource.NoResourceExn as e: +except resource.NotSolvable as e: print(e) print('- test removing a Resources list from itself') diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 3e8924a..52b23c7 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -337,7 +337,13 @@ continue # figure out who gets what - solution = solve(all_matches) + try: + solution = solve(all_matches) + except NotSolvable: + # instead of a cryptic error message, raise an exception that + # conveys meaning to the user. + raise NoResourceExn('Could not resolve request to reserve resources: ' + '%d x %s with requirements: %r' % (len(want_list), key, want_list)) picked = [ my_list[i] for i in solution if i is not None ] for_origin.dbg('Picked', config.tostr(picked)) matches[key] = picked @@ -364,6 +370,9 @@ for item in item_list: item[RESERVED_KEY] = origin_id + +class NotSolvable(Exception): + pass def solve(all_matches): ''' @@ -403,8 +412,8 @@ solution = search_in_permutations() if not solution: - raise NoResourceExn('The requested resource requirements are not solvable %r' - % all_matches) + raise NotSolvable('The requested resource requirements are not solvable %r' + % all_matches) return solution -- To view, visit https://gerrit.osmocom.org/2851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba3707f1aaeb40a58c616c33af52a60c9a2e7e1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 21:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:55:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: error log: clarify for using more resources than reserved Message-ID: Review at https://gerrit.osmocom.org/2852 error log: clarify for using more resources than reserved Figure out how many resources were reserved, how many of those match the requirements, and how many are used, and log one of three matching error messages for that situation. For that purpose, allow find()ing reserved resources without logging anything, using a log_label=None arg. Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 --- M src/osmo_gsm_tester/resource.py 1 file changed, 17 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/52/2852/1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 52b23c7..7cc32bb 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -301,7 +301,8 @@ # list item contains specifics for the particular BTS. my_list = self.get(key, []) - for_origin.log(log_label, len(want_list), 'x', key, '(candidates: %d)'%len(my_list)) + if log_label: + for_origin.log(log_label, len(want_list), 'x', key, '(candidates: %d)'%len(my_list)) # Try to avoid a less constrained item snatching away a resource # from a more detailed constrained requirement. @@ -472,11 +473,21 @@ available = available_dict.get(kind) self.dbg(available=len(available)) if not available: - raise NoResourceExn('When trying to reserve %r nr %d: No unused resource found%s' % - (kind, - self.count(kind) + 1, - (' matching %r' % specifics) if specifics else '') - ) + # cook up a detailed error message for the current situation + kind_reserved = self.reserved.get(kind, []) + used_count = len([r for r in kind_reserved if USED_KEY in r]) + matching = self.reserved.find(self.origin, want, raise_if_missing=False, log_label=None).get(kind, []) + if not matching: + msg = 'none of the reserved resources matches requirements %r' % specifics + elif not (used_count < len(kind_reserved)): + msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) + else: + msg = ('No unused resource left that matches the requirements;' + ' Of reserved %d x %r, %d match the requirements, but all are already in use;' + ' Requirements: %r' + % (len(kind_reserved), kind, len(matching), specifics)) + raise NoResourceExn('When trying to use instance nr %d of %r: %s' % (used_count + 1, kind, msg)) + pick = available[0] self.dbg(using=pick) assert not pick.get(USED_KEY) -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 21:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:55:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial Message-ID: Review at https://gerrit.osmocom.org/2853 refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should never do 'with self'. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. I tested to verify that: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 305 insertions(+), 230 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2853/1 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..2a92f47 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,8 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) @@ -29,26 +30,17 @@ print('\n- a test with an error') results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..38969bc 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,63 +157,40 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + exit(1) if __name__ == '__main__': try: diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index 416094f..4430db1 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..638f0a4 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,36 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition + def run(self): try: with self: + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) if self.status == Test.UNKNOWN: self.set_pass() except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() + if hasattr(e, 'msg'): + msg = e.msg else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + msg = str(e) + if isinstance(e, AssertionError): + # find the line where the code asserted + msg += log.get_src_from_tb(sys.exc_info()[2]) + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + self.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +127,23 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + self.fail_tb = tb_str + log.garble = True + self.err('%s: %s' % (self.fail_type, self.fail_message)) + log.garble = False + if (self.fail_tb): + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +155,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +163,19 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +188,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,42 +220,56 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') - try: - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.definition.tests: - if names and not test.name() in names: - test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) - continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) - finally: - # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit - # base exception is raised. Make sure to stop processes in this - # finally section. Resources are automatically freed with 'atexit'. - self.stop_processes() - self.objects_cleanup() - self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + with self: + try: + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + st = test.run() + finally: + # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit + # base exception is raised. Make sure to stop processes in this + # finally section. Resources are automatically freed with 'atexit'. + self.stop_processes() + self.objects_cleanup() + self.free_resources() + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + return self.status + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..a238e2f 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,14 +79,20 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') + if exc_info[0] is None: + self.status = Trial.PASS + else: + self.status = Trial.FAIL + + self.log_report() for lt in self.log_targets: lt.remove() @@ -182,18 +188,26 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED.') + raise + finally: + if suite_run.status == suite.SuiteRun.FAIL: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS self.log(self.status) junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) @@ -201,6 +215,7 @@ return self.status def log_report(self): + log.large_separator('%s Results' % self.name()) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 21:55:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 21:55:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: junit result: also write for aborted runs Message-ID: Review at https://gerrit.osmocom.org/2854 junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 29 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/2854/1 diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..f68f30b 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + else: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 638f0a4..d6f3db4 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -156,6 +156,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -169,6 +171,7 @@ self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) + self.status = SuiteRun.UNKNOWN self.resources_pool = resource.ResourcesPool() self.load_tests() diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index a238e2f..b4d10c0 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -193,26 +193,26 @@ self.suites.append(suite_run) def run_suites(self, names=None): - self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - suite_run.run_tests(names) - except Exception: - self.log_exn() - except: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TEST RUN ABORTED.') - raise - finally: - if suite_run.status == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) - return self.status + try: + self.status = Trial.UNKNOWN + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status == suite.SuiteRun.FAIL: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + report.trial_to_junit_write(self, junit_path) + self.log('Wrote JUnit report to', junit_path) def log_report(self): log.large_separator('%s Results' % self.name()) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 6 22:39:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 22:39:52 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (21 comments) Despite the numerous comments and the -1 I really like this. Let's resolve the async question, that's the important part; and if you like resolve some of the cosmetics, most of which are no show-stoppers. https://gerrit.osmocom.org/#/c/2779/7//COMMIT_MSG Commit Message: Line 10: you could elaborate a bit on what is going on in this commit. Some say to have one comment for each patch chunk, which may be a bit overboard, but it would be good if the commit log explanations roughly match the complexity of the patch. https://gerrit.osmocom.org/#/c/2779/7/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 90: etype, e = sys.exc_info()[:2] are you using etype? why not except Exception as e: Line 108: *proxymethod_args, indent? Line 113: #def dbus_async_call(proxymethod, instance, *args, **kwargs): cruft? Line 128: GLib.Variant(proxymethod._sinargs, proxymethod_args), GLib.VariantType.new(proxymethod._soutargs), (cosmetic: each GLib.* call on its own line?) Line 402: nr = self.dbus.interface(I_NETREG) (cosmetic: I read 'nr' as 'number'. netreg?) Line 410: def scan_error_cb(self, obj, e, user_data): interesting question here: is scan_error_cb() called asyncly? Should it rather have a defer() shim? so that we are doing the actual handling in our main thread and are sure to catch exceptions etc Line 413: def scan_result_cb(self, obj, result, user_data): same async question Line 418: if not self.is_connected(): is_connected() again checks "self.mcc_mnc is None" and so forth. Does it make sense to do this above for both code paths: if self.is_connected(): # already on desired operator return And I think you said it before ... but from reading the code it is unclear: there was an is_connected() check when starting to scan, here is another one. I would welcome a code comment stating why it has to be checked again. Line 423: self.log('Already registered with the network') Osmo style: always early-exit instead of if-cascade: if not_needed_condition: return otherwise_needed_action() Line 426: myop = None (cosmetic: 'matching_op_path') Line 433: self.log('Already registered with the network') seems to me to duplicate the is_connected() semantics ... follows above comment. Line 434: # return and not try to re-connect, otherwise dbus method returns a fail "otherwise" meaning what? not return?? :) It seems obvious that we don't try to re-connect when already registered with desired operator, only this comment confuses me, is it trying to say more than that? Line 447: 'Power the modem and put it online' ', power cycle it if it was already on' Line 448: self.dbg('Powering on') (this dbg is a bit confusing. If it is already powered, we will in fact power it off, not on. Powering on will happen later.) Line 450: self.dbg('is powered') (log says "Powering on", "is powered" -- but instead the facts are: modem was powered before, now powering off; this here could say "Power cycling") Line 453: event_loop.wait(self, lambda: not self.dbus.has_interface(I_NETREG, I_SMS), timeout=10) and here maybe else: self.dbg('Powering on') Line 459: 'Connect to MCC+MNC from NITB config' rather don't mention the NITB config at all. Line 460: if mcc_mnc is not None and (len(mcc_mnc) != 2 or None in mcc_mnc): (personal preference: braces around each sub-condition) Line 464: self.log('connect to', self.mcc_mnc if self.mcc_mnc else 'default network') this log could go in the 'else:' below? In the sense of unbloating the log: instead of logging two lines, log one per code path (each with all the info) https://gerrit.osmocom.org/#/c/2779/7/src/osmo_gsm_tester/osmo_msc.py File src/osmo_gsm_tester/osmo_msc.py: Line 40: self.config = None for things that are None I generally put them above in the, what is it called, "static" section, like hlr = None. (Got to be careful there with things like lists, dicts or objects which could suddenly be shared between all instances of the class, but with None there is no such problem) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 7 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: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 6 22:42:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 22:42:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cosmetic: whitespace in log.py In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2848 to look at the new patch set (#2). cosmetic: whitespace in log.py Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc --- M src/osmo_gsm_tester/log.py 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/48/2848/2 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index d662400..ede3b16 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -445,8 +445,6 @@ exception.origins.add(origin) return False - - def log_exn(origin=None, category=None, exc_info=None): if not (exc_info is not None and len(exc_info) == 3): exc_info = sys.exc_info() @@ -482,6 +480,7 @@ def __init__(self, origin=None): if origin is not None: self.add(origin) + def add(self, origin): if hasattr(origin, 'name'): origin_str = origin.name() @@ -490,9 +489,9 @@ if origin_str is None: raise RuntimeError('origin_str is None for %r' % origin) self.insert(0, origin_str) + def __str__(self): return '?'.join(self) - def set_all_levels(level): -- To view, visit https://gerrit.osmocom.org/2848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 22:48:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 22:48:12 +0000 Subject: [PATCH] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2853 to look at the new patch set (#2). refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should never do 'with self'. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. I tested to verify that: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 305 insertions(+), 230 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2853/2 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..2a92f47 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,8 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) @@ -29,26 +30,17 @@ print('\n- a test with an error') results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..38969bc 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,63 +157,40 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + exit(1) if __name__ == '__main__': try: diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index 416094f..4430db1 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..638f0a4 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,36 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition + def run(self): try: with self: + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) if self.status == Test.UNKNOWN: self.set_pass() except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() + if hasattr(e, 'msg'): + msg = e.msg else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + msg = str(e) + if isinstance(e, AssertionError): + # find the line where the code asserted + msg += log.get_src_from_tb(sys.exc_info()[2]) + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + self.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +127,23 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + self.fail_tb = tb_str + log.garble = True + self.err('%s: %s' % (self.fail_type, self.fail_message)) + log.garble = False + if (self.fail_tb): + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +155,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +163,19 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +188,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,42 +220,56 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') - try: - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.definition.tests: - if names and not test.name() in names: - test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) - continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) - finally: - # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit - # base exception is raised. Make sure to stop processes in this - # finally section. Resources are automatically freed with 'atexit'. - self.stop_processes() - self.objects_cleanup() - self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + with self: + try: + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + st = test.run() + finally: + # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit + # base exception is raised. Make sure to stop processes in this + # finally section. Resources are automatically freed with 'atexit'. + self.stop_processes() + self.objects_cleanup() + self.free_resources() + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + return self.status + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..9ea6729 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,14 +79,20 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') + if exc_info[0] is None: + self.status = Trial.PASS + else: + self.status = Trial.FAIL + + self.log_report() for lt in self.log_targets: lt.remove() @@ -182,18 +188,26 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status == suite.SuiteRun.FAIL: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS self.log(self.status) junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) @@ -201,6 +215,7 @@ return self.status def log_report(self): + log.large_separator('%s Results' % self.name()) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 6 22:48:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 6 Jun 2017 22:48:12 +0000 Subject: [PATCH] osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2854 to look at the new patch set (#2). junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 29 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/2854/2 diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..f68f30b 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + else: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 638f0a4..d6f3db4 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -156,6 +156,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -169,6 +171,7 @@ self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) + self.status = SuiteRun.UNKNOWN self.resources_pool = resource.ResourcesPool() self.load_tests() diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 9ea6729..b4d10c0 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -193,26 +193,26 @@ self.suites.append(suite_run) def run_suites(self, names=None): - self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - suite_run.run_tests(names) - except Exception: - self.log_exn() - except BaseException as e: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) - raise - finally: - if suite_run.status == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) - return self.status + try: + self.status = Trial.UNKNOWN + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status == suite.SuiteRun.FAIL: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + report.trial_to_junit_write(self, junit_path) + self.log('Wrote JUnit report to', junit_path) def log_report(self): log.large_separator('%s Results' % self.name()) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 7 05:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Gerard) Date: Wed, 7 Jun 2017 05:29:21 +0000 Subject: mncc-python[master]: Bearer capability not provided during MO call using mncc-pyt... In-Reply-To: References: Message-ID: Patch Set 1: > Purely cosmetic note so it shouldn't prevent from merging this: > it's better to use common convention for commit messages where > short topic line is followed by empty line and than detailed > explanation. Yes, Max I did realize it (new to gerrit). Thanks! for the advice. -- To view, visit https://gerrit.osmocom.org/2841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If77851b86111d62d82221a886ed2391179080cca Gerrit-PatchSet: 1 Gerrit-Project: mncc-python Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Gerard Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 7 08:12:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 08:12:13 +0000 Subject: osmo-gsm-tester[master]: test API: allow passing resource requirements In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6f175f4bb53dec5306fb3c6479202a7bf1c7116 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 7 08:18:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 08:18:45 +0000 Subject: osmo-gsm-tester[master]: fix problem in origin ancestry: don't add self twice In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) Fix the small issue in the comment and you can merge. https://gerrit.osmocom.org/#/c/2850/1/src/osmo_gsm_tester/log.py File src/osmo_gsm_tester/log.py: Line 363: # if this object is self is currently the _global_current_origin, if this object is self then it is currently [...] Had to read several times to understand :) -- To view, visit https://gerrit.osmocom.org/2850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 08:22:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 08:22:28 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for reserving more resources than available In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/2851/1/selftest/resource_test.py File selftest/resource_test.py: Line 42: except resource.NotSolvable as e: Perhaps "NoSolution" sounds better? no strong opinion though. -- To view, visit https://gerrit.osmocom.org/2851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3707f1aaeb40a58c616c33af52a60c9a2e7e1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 08:35:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 08:35:19 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2852/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 483: msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) Can this case happen? can we end up using more resources than the ones we reserved beforehand? As far as I can see used_count is always a subset of kind_reserved. -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 08:37:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 08:37:19 +0000 Subject: osmo-gsm-tester[master]: cosmetic: whitespace in log.py In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 7 08:37:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 08:37:21 +0000 Subject: [MERGED] osmo-gsm-tester[master]: cosmetic: whitespace in log.py In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: cosmetic: whitespace in log.py ...................................................................... cosmetic: whitespace in log.py Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc --- M src/osmo_gsm_tester/log.py 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index d662400..ede3b16 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -445,8 +445,6 @@ exception.origins.add(origin) return False - - def log_exn(origin=None, category=None, exc_info=None): if not (exc_info is not None and len(exc_info) == 3): exc_info = sys.exc_info() @@ -482,6 +480,7 @@ def __init__(self, origin=None): if origin is not None: self.add(origin) + def add(self, origin): if hasattr(origin, 'name'): origin_str = origin.name() @@ -490,9 +489,9 @@ if origin_str is None: raise RuntimeError('origin_str is None for %r' % origin) self.insert(0, origin_str) + def __str__(self): return '?'.join(self) - def set_all_levels(level): -- To view, visit https://gerrit.osmocom.org/2848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I356725ba7d874d3d41afb5e4c89dac188c8d7dcc Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 7 09:11:48 2017 From: gerrit-no-reply at lists.osmocom.org (blobb) Date: Wed, 7 Jun 2017 09:11:48 +0000 Subject: [PATCH] osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2465 to look at the new patch set (#11). Introduce artifacts holding dependencies to speed up builds. Basically, osmo-build.sh holds logic to check whether the necessary artifact is available. If so it fetches artifact, unpacks it and triggers the actual build. In case the necessary artifact is not available osmo-build.sh simply builds all dependencies from source by using osmo-build-dep.sh and archives deps to the ARTIFACT_STORE afterwards. The necessary functions to determine the artifact name from remote and local repositories as well as the handling of artifact files live in osmo-artifacts.sh, which is sourced by osmo-build.sh. osmo-build.sh will be sourced by the contrib/jenkins.sh build script inside each git repository and invoked via 'build'. See jenkins-openBsc.sh [1] for more details. Artifacts will be stored as follows: $ARTIFACT_STORE/$JOB_NAME/.._... ..._...tar.gz Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. The JOB_NAME variables is injected to each jenkins job by jenkins. [1] https://github.com/blobbsen/diy-artifacts/blob/master/jenkins-openBSC.sh Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 --- A scripts/osmo-build.sh 1 file changed, 225 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/2465/11 diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh new file mode 100644 index 0000000..d528848 --- /dev/null +++ b/scripts/osmo-build.sh @@ -0,0 +1,225 @@ +#!/bin/bash +# +# This script enables artifacts holding dependencies on a jenkins job level to +# speed up builds. Basically, it holds logic to check whether the necessary artifact +# is available. If so it fetches artifact, unpacks it and if cp/tar succeeded +# it triggers the actual build. +# +# Otherwise it simply builds all dependencies from source by using osmo-build-dep.sh +# and archives deps to the ARTIFACT_STORE afterwards. Revisions of locally built +# dependencies are detrmined after dependencies are built to ensure catching new +# changes in dep_n+1 meanwhile building dep_n. +# +# Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. +# The JOB_NAME variable will be injected to each jenkins' job by jenkins itself. +# When using script within a docker container one must inject jenkins' JOB_NAME variable +# to the container and ensure that ARTIFACT_STORE is mounted to the container's +# internal ARTIFACT_STORE. +# +# Artifacts will be stored as follows: +# +# $ARTIFACT_STORE/$JOB_NAME/.._... +# ..._..tar.gz +# +# Note: each matrix-build has its own directory inside ARTIFACT_STORE. +# +# In order to make use of osmo-build.sh one needs to source it, e.g. from +# ./contrib/jenkins.sh. Furthermore, jenkins should check out the git tree of +# the project to be built in the workspace root. Following functions needs to be +# declared within a build script that sources osmo-build.sh: +# +# - generic_deps() +# - build_project() +# +# This is an example for building "libosmo-netif" which depends on "libosmocore" +# and "libosmo-abis". +# +# #!/bin/bash +# +# # osmo-build.sh needs to be in PATH +# source osmo-build.sh +# +# generic_deps() { +# # Holds all required dependencies in the following form: +# # +# # x="$( $1 )" +# # +# # $1 will be one of these script/functions: +# # - osmo-build-dep.sh: build a source tree +# # - artifact_name_by_local_repos() +# # - artifact_name_by_remote_repos() +# # +# # The arguments are: +# # +# # - PARALLEL_MAKE: override global PARALLEL_MAKE used for make, +# # (e.g. PARALLEL_MAKE="-j1" to disable mutlithreading) +# # - arg 1: dep_project = the git repository name, gets places in a git.osmocom.org URL. +# # - arg 2: branch of dep_project (optional: default = master) +# # - arg 3: configuration (optional: $cfg used in osmo-build-dep.sh) +# +# x="$($1 libosmocore master ac_cv_path_DOXYGEN=false)" +# "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +# x="${x}_$($1 libosmo-abis)" +# +# echo "${x}.tar.gz" +# } +# +# build_project() { +# # Necessary commands to build the project, expecting all dependencies have +# # been build or fetched. Commands within build_project() will be executed +# # in jenkins' $WORKSPACE. +# +# autoreconf --install --force +# ./configure --enable-sanitize +# $MAKE $PARALLEL_MAKE +# $MAKE distcheck || cat-testlogs.sh +# } +# +# # call build function inside sourced osmo-build.sh +# build + +log() { + set +x + echo -e "\n[INFO] $1 \n" + set -x +} + +# BUILD FUNCTIONS +init_build() { + + if [ -z "$JOB_NAME" ]; then + log "[ERROR] JOB_NAME variable is not set, running in Jenkins?" + exit 1 + fi + + if [ -z "$ARTIFACT_STORE" ]; then + log "[ERROR] ARTIFACT_STORE variable is not set on this build slave" + exit 1 + fi + + base="$(pwd)" + deps="$base/deps" + inst="$deps/install" + + # obtain the project name from the git clone found in the workspace root + project=$(git config --get --local remote.origin.url \ + | cut -d '/' -f4 | cut -d '.' -f1) + + # replace invalid char for dirs in jenkins variable + # ( '/' separates job name and matrix-axis) + job_name="${JOB_NAME//\//_}" + + export base deps inst project job_name + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" + export LD_LIBRARY_PATH="$inst/lib" + + log "$project build initialized" +} + +build_deps() { + log "Compile $project dependencies from source." + + mkdir -p "$deps" + rm -rf "$inst" + + set +x + generic_deps "osmo-build-dep.sh" + set -x +} + +build() { + + init_build + + needed_artifact="$(artifact_name_by_remote_repos)" + + if [ -f "$ARTIFACT_STORE/$job_name/$needed_artifact" ]; then + fetch_artifact "$ARTIFACT_STORE/$job_name" "$needed_artifact" + else + build_deps + archive_artifact + fi + + log "building $project" + build_project +} + +# ARTIFACT FUNCTIONS +artifact_name_by_local_repos() { + generic_deps "branch_and_rev_of_local_repo" + cd "$base" +} + +artifact_name_by_remote_repos() { + generic_deps "branch_and_rev_of_remote_repo" +} + +branch_and_rev_of_local_repo() { + cd "$deps/$1" + rev="$(git rev-parse --short HEAD)" + branch="$(git rev-parse --abbrev-ref HEAD)" + + # check whether it is a tag + if [ "$branch" = "HEAD" ]; then + tag="$(git describe --tags HEAD)" + echo "$1.${tag//\//_}" + else + echo "$1.${branch//\//_}.${rev}" + fi +} + +branch_and_rev_of_remote_repo() { + if [ -z "${2+x}" ]; then branch="master"; else branch="$2"; fi + rev="$(git ls-remote "https://git.osmocom.org/$1" "refs/heads/$branch")" + + # check whether branch is a tag + if [ "$rev" = "" ]; then + echo "$1.${branch//\//_}" + else + echo "$1.${branch//\//_}.${rev:0:7}" + fi +} + +archive_artifact() { + log "Archiving artifact to artifactStore." + + cd "$base" + artifact="$(artifact_name_by_local_repos)" + # temp_job_store is necessary to atomically move it to production. + temp_job_store="$ARTIFACT_STORE/tmp/$job_name/" + job_store="$ARTIFACT_STORE/$job_name/" + + if [ ! -f "$temp_job_store/$artifact" ]; then + mkdir -p "$job_store" "$temp_job_store" + # remove outdated artifact first to avoid temporarily + # doubling of artifact storage consumption + rm -f "$job_store/*" + tar czf "$temp_job_store/$artifact" "deps" + mv -n "$temp_job_store/$artifact" "$job_store/$artifact" + rm -rf "$temp_job_store" + + log_artifact_hash "$job_store/$artifact" + fi +} + +fetch_artifact() { + log "Fetching artifact from artifactStore." + + log_artifact_hash "$1/$2" + cp "$1/$2" . + log_artifact_hash "$2" + tar xzf "$2" + + if [ $? -gt 0 ]; then + log "Artifact could not be fetched, triggering build_deps()" + build_deps + else + log "Artifact successfully fetched, triggering $project compilation" + fi +} + +# checksum is not used by script itself, +# but might be handy in logs when debugging. +log_artifact_hash() { + log "name: $1 \n sha256: $(sha256sum "$1" | cut -d ' ' -f1)" +} -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 11 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Wed Jun 7 09:27:30 2017 From: gerrit-no-reply at lists.osmocom.org (blobb) Date: Wed, 7 Jun 2017 09:27:30 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 11: Thanks Neels! Now it works [1] and saves around 9 minutes [2] [1] https://jenkins.blobb.me/job/openBSC_multi-configuration_withArtifacts_testRefactoring/104/ [2] https://jenkins.blobb.me/job/openBSC_multi-configuration_withArtifacts_testRefactoring/buildTimeTrend -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 11 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 7 13:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 13:34:57 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (7 comments) https://gerrit.osmocom.org/#/c/2853/2/selftest/suite_test.py File selftest/suite_test.py: Line 33: print(output) You are not checking anymore expected output. https://gerrit.osmocom.org/#/c/2853/2/src/osmo-gsm-tester.py File src/osmo-gsm-tester.py: Line 192: if current_trial.status != trial.Trial.PASS: better return status in run_suites instead ofchecking the property afterwards. https://gerrit.osmocom.org/#/c/2853/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 95: with self: This "with self" should not be here according to commit mesage. grep for "with self" to make sure there are no others still hanging there. Line 135: self.fail_tb = tb_str I think it still makes sense to use the following in case tb_str is None, for th euse case in which the test running calls set_fail(): if self.fail_tb is None: self.fail_tb = ''.join(traceback.format_stack()[:-1]).rstrip() Line 139: if (self.fail_tb): () not needed here Line 226: with self: this "with self" should not be here acording to the commit message. https://gerrit.osmocom.org/#/c/2853/2/src/osmo_gsm_tester/trial.py File src/osmo_gsm_tester/trial.py: Line 90: if exc_info[0] is None: what's going on in these lines? Trial is PASS if there is no exception? That means if an exception (failure) happens in a test but it's catched there, then the Trial still passess? Please add a comment in the code here. -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 13:43:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 13:43:23 +0000 Subject: osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2854/2/src/osmo_gsm_tester/report.py File src/osmo_gsm_tester/report.py: Line 64: else: what if test is Test.PASS ? it falls here right? which is wrong I guess. You probably want to check for UNKNOWN. Line 65: error = et.SubElement(testcase, 'error') I think I preferred how the output was done before these changes. If the suite run failed in the middle of running tests, then the remaining tests simply didn't show in the xml, and the 'tests' counter in the 'testsuite' node was smaller. When showing that in the graph in jenkins, you easily see less tests were run at that time, which is different than failing. -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 14:24:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 14:24:19 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 7: (16 comments) https://gerrit.osmocom.org/#/c/2779/7//COMMIT_MSG Commit Message: Line 10: > you could elaborate a bit on what is going on in this commit. Some say to h ACK https://gerrit.osmocom.org/#/c/2779/7/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 90: etype, e = sys.exc_info()[:2] > are you using etype? why not ACK Line 108: *proxymethod_args, > indent? ACK Line 113: #def dbus_async_call(proxymethod, instance, *args, **kwargs): > cruft? oops, my bad, didn't see it. Line 402: nr = self.dbus.interface(I_NETREG) > (cosmetic: I read 'nr' as 'number'. netreg?) ACK Line 410: def scan_error_cb(self, obj, e, user_data): > interesting question here: is scan_error_cb() called asyncly? Should it rat AFAIK it's called by the glib mainloop, which means it's on the same thread and will be called by wait()->poll_glib()->glib_main_ctx.iteration() Line 418: if not self.is_connected(): > is_connected() again checks "self.mcc_mnc is None" and so forth. Does it ma I could check for both by doing self.is_connected(self.mcc_mnc) but I still need all the code afterwards for the 2nd case (manual register), and in there I can do the same check without doing any dbus call, just by doing the following check: if op_prop.get('Status') == 'current': self.log('Already registered with the network') For the manual register, as I already have the scanned_operators and I can do the same check with those, there is no sense in querying again all the operators to check this here. I will add a comment saying it's checked afterwards. Line 423: self.log('Already registered with the network') > Osmo style: always early-exit instead of if-cascade: ACK Line 433: self.log('Already registered with the network') > seems to me to duplicate the is_connected() semantics ... follows above com As I said, I prefer having different code paths for both cases. I could even move the automatic code path to a sub-method register_automatic(), but not needed. Line 434: # return and not try to re-connect, otherwise dbus method returns a fail > "otherwise" meaning what? not return?? :) It only tries to say that, but one could expect in the future when looking/modifying the code that it should be OK calling register if we are already regsitered resulting in a NO-OP, but it's not true, so I think it's still important to give some hint here. Line 448: self.dbg('Powering on') > (this dbg is a bit confusing. If it is already powered, we will in fact pow I'll move it afterwards with an else: Line 450: self.dbg('is powered') > (log says "Powering on", "is powered" -- but instead the facts are: modem w ACK Line 459: 'Connect to MCC+MNC from NITB config' > rather don't mention the NITB config at all. ACK Line 460: if mcc_mnc is not None and (len(mcc_mnc) != 2 or None in mcc_mnc): > (personal preference: braces around each sub-condition) ACK Line 464: self.log('connect to', self.mcc_mnc if self.mcc_mnc else 'default network') > this log could go in the 'else:' below? In the sense of unbloating the log: ACK https://gerrit.osmocom.org/#/c/2779/7/src/osmo_gsm_tester/osmo_msc.py File src/osmo_gsm_tester/osmo_msc.py: Line 40: self.config = None > for things that are None I generally put them above in the, what is it call ACK -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 7 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: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 15:38:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 15:38:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() 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/2779 to look at the new patch set (#8). ofono_client: Implement network registration during connect() A new mncc_mnc parameter is now optionally passed to connect() in order to manually register to a specific network with a given MCC+MNC pair. If no parameter is passed (or None), then the modem will be instructed to attempt an automatic registration with any available network which permits it. We get the MNC+MCC parameter from the MSC/NITB and we pass it to the modem object at connect time as shown in the modified tests. Two new simple tests to check network registration is working are added in this commit. Ofono modems seem to be automatically registering at some point after they are set Online=true, and we were actually using that 'feature' before this patch. Thus, it is possible that a modem quickly becomes registered, and we then check so before starting the scan+registration process, which can take a few seconds. The scanning method can take a few seconds to complete. To avoid blocking in the dbus ofono Scan() method, this commit adds some code to make use of glib/gdbus async methods, which are not yet supported directly by pydbus. This way, we can continue polling while waiting for the scan process to complete. When it completes, a callback is run which attempts to register. If no MNC+MCC was passed, as we just finished scanning the modem should have enough fresh operator information to take good and quick decisions on where to connect. If we have an MNC+MCC, then we check the operator list received by Scan() method. If operator with desired MCC+MNC is there, we register with it. If it's not there, we start scanning() again asynchronously hoping the operator will show up in next scan.i As scanning() and registration is done in the background, tests are expected to call connect(), and then later on wait for the modem to register by waiting/polling the method "modem.is_connected()" Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c --- M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M suites/aoip_debug/interactive.py M suites/aoip_sms/mo_mt_sms.py M suites/debug/interactive.py A suites/netreg/register.py A suites/netreg/register_default.py A suites/netreg/suite.conf M suites/sms/mo_mt_sms.py 10 files changed, 228 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/79/2779/8 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 46300ec..58ee6dc 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -22,6 +22,7 @@ from pydbus import SystemBus, Variant import time import pprint +import sys from gi.repository import GLib glib_main_loop = GLib.MainLoop() @@ -31,6 +32,12 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' + +# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 +NETREG_ST_REGISTERED = 'registered' +NETREG_ST_ROAMING = 'roaming' + +NETREG_MAX_REGISTER_ATTEMPTS = 3 class DeferredHandling: defer_queue = [] @@ -72,6 +79,53 @@ def list_modems(): root = systembus_get('/') return sorted(root.GetModems()) + +def _async_result_handler(obj, result, user_data): + '''Generic callback dispatcher called from glib loop when an async method + call has returned. This callback is set up by method dbus_async_call.''' + (result_callback, error_callback, real_user_data) = user_data + try: + ret = obj.call_finish(result) + except Exception as e: + # return exception as value + if error_callback: + error_callback(obj, e, real_user_data) + else: + result_callback(obj, e, real_user_data) + return + + ret = ret.unpack() + # to be compatible with standard Python behaviour, unbox + # single-element tuples and return None for empty result tuples + if len(ret) == 1: + ret = ret[0] + elif len(ret) == 0: + ret = None + result_callback(obj, ret, real_user_data) + +def dbus_async_call(instance, proxymethod, *proxymethod_args, + result_handler=None, error_handler=None, + user_data=None, timeout=30, + **proxymethod_kwargs): + '''pydbus doesn't support asynchronous methods. This method adds support for + it until pydbus implements it''' + + argdiff = len(proxymethod_args) - len(proxymethod._inargs) + if argdiff < 0: + raise TypeError(proxymethod.__qualname__ + " missing {} required positional argument(s)".format(-argdiff)) + elif argdiff > 0: + raise TypeError(proxymethod.__qualname__ + " takes {} positional argument(s) but {} was/were given".format(len(proxymethod._inargs), len(proxymethod_args))) + + timeout = timeout * 1000 + user_data = (result_handler, error_handler, user_data) + + ret = instance._bus.con.call( + instance._bus_name, instance._path, + proxymethod._iface_name, proxymethod.__name__, + GLib.Variant(proxymethod._sinargs, proxymethod_args), + GLib.VariantType.new(proxymethod._soutargs), + 0, timeout, None, + _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. @@ -255,8 +309,10 @@ self.path = conf.get('path') self.set_name(self.path) self.set_log_category(log.C_TST) + self.mcc_mnc = None self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) + self.register_attempts = 0 self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), @@ -323,18 +379,99 @@ def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) - def connect(self, nitb): - 'set the modem up to connect to MCC+MNC from NITB config' - self.log('connect to', nitb) + def is_connected(self, mcc_mnc=None): + netreg = self.dbus.interface(I_NETREG) + prop = netreg.GetProperties() + status = prop.get('Status') + if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): + return False + if mcc_mnc is None: # Any network is fine and we are registered. + return True + mcc = prop.get('MobileCountryCode') + mnc = prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + return True + return False + + def schedule_scan_register(self): + if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: + self.raise_exn('Failed to find Network Operator', mcc_mnc=self.mcc_mnc, attempts=self.register_attempts) + self.register_attempts += 1 + netreg = self.dbus.interface(I_NETREG) + self.dbg('Scanning for operators...') + # Scan method can take several seconds, and we don't want to block + # waiting for that. Make it async and try to register when the scan is + # finished. + dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=self.scan_result_cb, + error_handler=self.scan_error_cb, user_data=None) + + def scan_error_cb(self, obj, e, user_data): + self.raise_exn('Scan() failed:', e) + + def scan_result_cb(self, obj, result, user_data): + self.register(result) + + def register_automatic(self): + if self.is_connected(): + self.log('Already registered with a network') + return + self.log('Registering with the default network') + netreg = self.dbus.interface(I_NETREG) + netreg.Register() + + def register(self, scanned_operators): + if self.mcc_mnc is None: + self.register_automatic() + return + self.dbg('scanned operators: ', scanned_operators); + matching_op_path = None + for op in scanned_operators: + op_path, op_prop = op + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + if (mcc, mnc) == self.mcc_mnc: + if op_prop.get('Status') == 'current': + self.log('Already registered with network', self.mcc_mnc) + # We discovered the network and we are already registered + # with it. Avoid calling op.Register() in this case (it + # won't act as a NO-OP, it actually returns an error). + return + matching_op_path = op_path + break + if matching_op_path is None: + self.dbg('Failed to find Network Operator', mcc_mnc=self.mcc_mnc, attempts=self.register_attempts) + self.schedule_scan_register() + return + dbus_op = systembus_get(matching_op_path) + self.log('Registering with operator', matching_op_path, self.mcc_mnc) + dbus_op.Register() + + def power_cycle(self): + 'Power the modem and put it online, power cycle it if it was already on' if self.is_powered(): - self.dbg('is powered') + self.dbg('Power cycling') self.set_online(False) self.set_powered(False) event_loop.wait(self, lambda: not self.dbus.has_interface(I_NETREG, I_SMS), timeout=10) + else: + self.dbg('Powering on') self.set_powered() self.set_online() event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10) + def connect(self, mcc_mnc=None): + 'Connect to MCC+MNC' + if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): + self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + self.mcc_mnc = mcc_mnc + self.power_cycle() + self.register_attempts = 0 + if self.is_connected(self.mcc_mnc): + self.log('Already registered with', self.mcc_mnc if self.mcc_mnc else 'default network') + else: + self.log('Connect to', self.mcc_mnc if self.mcc_mnc else 'default network') + self.schedule_scan_register() + def sms_send(self, to_msisdn_or_modem, *tokens): if isinstance(to_msisdn_or_modem, Modem): to_msisdn = to_msisdn_or_modem.msisdn diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ca0e246..d53735b 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -29,6 +29,7 @@ config_file = None process = None hlr = None + config = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): self.suite_run = suite_run @@ -72,6 +73,7 @@ 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()) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -83,6 +85,15 @@ def addr(self): return self.ip_address.get('addr') + def mcc(self): + return self.config['msc']['net']['mcc'] + + def mnc(self): + return self.config['msc']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..b4bf247 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -76,6 +76,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -91,6 +92,15 @@ self.bts.append(bts) bts.set_bsc(self) + def mcc(self): + return self.config['nitb']['net']['mcc'] + + def mnc(self): + return self.config['nitb']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_add(self, modem, msisdn=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 7cc1b76..cfedd3a 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -18,7 +18,7 @@ for m in modems: hlr.subscriber_add(m) - m.connect(bsc) + m.connect(msc.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -30,6 +30,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index b9383ea..8eba842 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -21,13 +21,15 @@ hlr.subscriber_add(ms_mo) hlr.subscriber_add(ms_mt) -ms_mo.connect(bsc) -ms_mt.connect(bsc) +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) sms = ms_mo.sms_send(ms_mt) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 603e395..37076dc 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -13,7 +13,7 @@ for m in modems: nitb.subscriber_add(m) - m.connect(nitb) + m.connect(nitb.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -25,6 +25,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/netreg/register.py b/suites/netreg/register.py new file mode 100755 index 0000000..9141986 --- /dev/null +++ b/suites/netreg/register.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +print(ms.info()) + +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/register_default.py b/suites/netreg/register_default.py new file mode 100755 index 0000000..d15b3f5 --- /dev/null +++ b/suites/netreg/register_default.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect() + +print(ms.info()) + +wait(ms.is_connected) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/suite.conf b/suites/netreg/suite.conf new file mode 100644 index 0000000..1bb1dbb --- /dev/null +++ b/suites/netreg/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 40s diff --git a/suites/sms/mo_mt_sms.py b/suites/sms/mo_mt_sms.py index 860f5e7..4e0ba08 100755 --- a/suites/sms/mo_mt_sms.py +++ b/suites/sms/mo_mt_sms.py @@ -14,13 +14,15 @@ nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) ms_mo.log_info() ms_mt.log_info() print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) sms = ms_mo.sms_send(ms_mt) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 8 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 Wed Jun 7 16:35:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 7 Jun 2017 16:35:49 +0000 Subject: [PATCH] libosmo-abis[master]: src: use osmo_timer_setup() Message-ID: Review at https://gerrit.osmocom.org/2855 src: use osmo_timer_setup() Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: I4ca4950e49a09c63b608b13ac7561ebbd351889a --- M src/input/dahdi.c M src/input/ipaccess.c M src/input/misdn.c M src/input/unixsocket.c 4 files changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/55/2855/1 diff --git a/src/input/dahdi.c b/src/input/dahdi.c index 0945daa..911f862 100644 --- a/src/input/dahdi.c +++ b/src/input/dahdi.c @@ -252,8 +252,7 @@ sign_link->sapi, msg); /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, 50000); return 0; diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index ac84ffc..63ee167 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -354,8 +354,7 @@ } /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); /* Reducing this might break the nanoBTS 900 init. */ osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); diff --git a/src/input/misdn.c b/src/input/misdn.c index 98a836f..347b7bf 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -283,8 +283,7 @@ /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); return ret; diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c index 4f287ae..63bd796 100644 --- a/src/input/unixsocket.c +++ b/src/input/unixsocket.c @@ -160,8 +160,7 @@ } /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); -- To view, visit https://gerrit.osmocom.org/2855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ca4950e49a09c63b608b13ac7561ebbd351889a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Jun 7 16:42:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 7 Jun 2017 16:42:50 +0000 Subject: [PATCH] libosmo-netif[master]: src: use osmo_timer_setup() Message-ID: Review at https://gerrit.osmocom.org/2856 src: use osmo_timer_setup() Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a --- M src/osmux.c M src/rs232.c M src/stream.c 3 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/56/2856/1 diff --git a/src/osmux.c b/src/osmux.c index 91054f1..23a6440 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -721,8 +721,7 @@ INIT_LLIST_HEAD(&batch->circuit_list); batch->remaining_bytes = h->batch_size; - batch->timer.cb = osmux_batch_timer_expired; - batch->timer.data = h; + osmo_timer_setup(&batch->timer, osmux_batch_timer_expired, h); h->internal_data = (void *)batch; @@ -803,8 +802,7 @@ h->msg = msg; h->tx_cb = tx_cb; h->data = data; - h->timer.cb = osmux_tx_cb; - h->timer.data = h; + osmo_timer_setup(&h->timer, osmux_tx_cb, h); #ifdef DEBUG_TIMING osmo_gettimeofday(&h->start, NULL); diff --git a/src/rs232.c b/src/rs232.c index c05a693..49520d8 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -234,10 +234,9 @@ return rc; } - if (r->cfg.delay_us) { - r->tx_timer.cb = rs232_tx_timer_cb; - r->tx_timer.data = r; - } + if (r->cfg.delay_us) + osmo_timer_setup(&r->tx_timer, rs232_tx_timer_cb, r); + return 0; } diff --git a/src/stream.c b/src/stream.c index b96293e..a80d842 100644 --- a/src/stream.c +++ b/src/stream.c @@ -281,8 +281,7 @@ cli->ofd.cb = osmo_stream_cli_fd_cb; cli->ofd.data = cli; cli->state = STREAM_CLI_STATE_CONNECTING; - cli->timer.cb = cli_timer_cb; - cli->timer.data = cli; + osmo_timer_setup(&cli->timer, cli_timer_cb, cli); cli->reconnect_timeout = 5; /* default is 5 seconds. */ INIT_LLIST_HEAD(&cli->tx_queue); -- To view, visit https://gerrit.osmocom.org/2856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:36:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:36:07 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 2: (6 comments) some replies here, more in form of the next patch set https://gerrit.osmocom.org/#/c/2853/2/selftest/suite_test.py File selftest/suite_test.py: Line 33: print(output) > You are not checking anymore expected output. by printing the output, all of it is verified in the suite_test.ok file https://gerrit.osmocom.org/#/c/2853/2/src/osmo-gsm-tester.py File src/osmo-gsm-tester.py: Line 192: if current_trial.status != trial.Trial.PASS: > better return status in run_suites instead ofchecking the property afterwar why? I want the trial's status property to reflect the result in all cases; no need to add a separate way to return the result. https://gerrit.osmocom.org/#/c/2853/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 135: self.fail_tb = tb_str > I think it still makes sense to use the following in case tb_str is None, f ok, nice idea (why the rstrip() though?) Line 136: log.garble = True oops, here is a debug nonsense that leaked into the patch Line 139: if (self.fail_tb): > () not needed here indeed https://gerrit.osmocom.org/#/c/2853/2/src/osmo_gsm_tester/trial.py File src/osmo_gsm_tester/trial.py: Line 90: if exc_info[0] is None: > what's going on in these lines? Trial is PASS if there is no exception? Ah I notice that none of this is actually needed. We have already evaluated the results before Trial.__exit__(), all we will catch here is the SystemExit from the exit(1) call. I cleaned up some more... -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 2 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:45:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 17:45:03 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2853/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 135: self.fail_tb = tb_str > ok, nice idea (why the rstrip() though?) afair I had to add rstrip() to make the output cleaner because it was adding several empty lines at the end (with some spaces too?). -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 2 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:51:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:51:00 +0000 Subject: [PATCH] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial 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/2853 to look at the new patch set (#3). refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should not do 'with' on a central object. The structure needed is, in pseudo code: try: with trial: try: with suite_run: try: with test: test_actions() The 'with' needs to be inside the 'try', so that the exception can be handled in __exit__ before it reaches the exception logging. To clarify this, move the 'with' one level up, i.e. do 'with test' in SuiteRun.run_tests(), not in Test.run(). Move test exception handling to suite_run.run_tests() for that purpose. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. Minor tweak: pass the return code that the program exit should return further outward, so that the exit(1) call does not cause a SystemExit exception to be logged. The aims of this patch are: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 303 insertions(+), 229 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2853/3 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..2a92f47 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,8 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) @@ -29,26 +30,17 @@ print('\n- a test with an error') results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..e481281 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,72 +157,52 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + return 1 + return 0 if __name__ == '__main__': + rc = 2 try: - main() + rc = main() except: # Tell the log to show the exception, then terminate the program with the exception anyway. # Since exceptions within test runs should be caught and evaluated, this is basically about # exceptions during command line parsing and such, so it's appropriate to abort immediately. log.log_exn() raise + exit(rc) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index 2de3339..9375edc 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..166eb42 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,16 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition - try: - with self: - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() - except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() - else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + def run(self): + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +107,26 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + + if tb_str is None: + # populate an exception-less call to set_fail() with traceback info + tb_str = ''.join(traceback.format_stack()[:-1]) + + self.fail_tb = tb_str + self.err('%s: %s' % (self.fail_type, self.fail_message)) + if self.fail_tb: + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +138,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +146,19 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +171,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,27 +203,42 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') try: + log.large_separator(self.trial.name(), self.name(), sublevel=2) self.mark_start() event_loop.register_poll_func(self.poll) if not self.reserved_resources: self.reserve_resources() - for test in self.definition.tests: + for test in self.tests: if names and not test.name() in names: test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) + try: + with test: + test.run() + except Exception as e: + if hasattr(e, 'msg'): + msg = e.msg + else: + msg = str(e) + if isinstance(e, AssertionError): + # AssertionError lacks further information on what was + # asserted. Find the line where the code asserted: + msg += log.get_src_from_tb(sys.exc_info()[2]) + # add source file information to failure report + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + test.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise finally: # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit # base exception is raised. Make sure to stop processes in this @@ -261,14 +246,33 @@ self.stop_processes() self.objects_cleanup() self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..4be9c26 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,15 +79,15 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') - + self.log_report() for lt in self.log_targets: lt.remove() self.log_targets = None @@ -182,25 +182,33 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) + for suite_run in self.suites: + try: + with suite_run: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) report.trial_to_junit_write(self, junit_path) - return self.status def log_report(self): + log.large_separator(self.name(), self.status) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 3 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 Jun 7 17:51:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:51:00 +0000 Subject: [PATCH] osmo-gsm-tester[master]: junit result: also write for aborted runs 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/2854 to look at the new patch set (#3). junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 29 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/2854/3 diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..f68f30b 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + else: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 166eb42..4dda2ea 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -139,6 +139,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -152,6 +154,7 @@ self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) + self.status = SuiteRun.UNKNOWN self.resources_pool = resource.ResourcesPool() self.load_tests() diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 4be9c26..10872ee 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -188,24 +188,26 @@ def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - with suite_run: - suite_run.run_tests(names) - except Exception: - self.log_exn() - except BaseException as e: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) - raise - finally: - if suite_run.status != suite.SuiteRun.PASS: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) + try: + for suite_run in self.suites: + try: + with suite_run: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + self.log('Storing JUnit report in', junit_path) + report.trial_to_junit_write(self, junit_path) def log_report(self): log.large_separator(self.name(), self.status) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:56:01 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2852/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 483: msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) > Can this case happen? can we end up using more resources than the ones we r yes. If we reserved 4 modems in suite.conf, we can call suite.modem() four times. At that point used_count becomes == len(kind_reserved). If then we call suite.modem() a fifth time, this code path hits. I tested it manually. -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:56:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:56:09 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix problem in origin ancestry: don't add self twice 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/2850 to look at the new patch set (#3). fix problem in origin ancestry: don't add self twice Also add various comments to illustrate what is going on during origin resolution. In the regression tests' expectations, some duplicate entries in the origins are removed, and hence no list of deeper origin ancestry is printed anymore. Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 --- M selftest/process_test.ok M selftest/suite_test.ok M src/osmo_gsm_tester/log.py 3 files changed, 20 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/50/2850/3 diff --git a/selftest/process_test.ok b/selftest/process_test.ok index 4245eeb..f168ee3 100644 --- a/selftest/process_test.ok +++ b/selftest/process_test.ok @@ -1,7 +1,7 @@ -run foo: DBG: cd '[TMP]'; PATH=[$PATH] foo.py arg1 arg2 [foo?foo] -run foo: DBG: [TMP]/stdout [foo?foo] -run foo: DBG: [TMP]/stderr [foo?foo] -run foo(pid=[PID]): Launched [foo(pid=[PID])?foo(pid=[PID])] +run foo: DBG: cd '[TMP]'; PATH=[$PATH] foo.py arg1 arg2 +run foo: DBG: [TMP]/stdout +run foo: DBG: [TMP]/stderr +run foo(pid=[PID]): Launched stdout: (launched: [DATETIME]) foo stdout diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index b9a8fb3..fd4d743 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -6,11 +6,11 @@ --- -: ERR: RuntimeError: Suite not found: 'does_not_exist' in [PATH]/selftest/suite_test - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test -cnf empty_dir: DBG: reading suite.conf [empty_dir?empty_dir] +cnf empty_dir: DBG: reading suite.conf --- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test -cnf test_suite: DBG: reading suite.conf [test_suite?test_suite] +cnf test_suite: DBG: reading suite.conf defaults: timeout: 60s resources: @@ -26,21 +26,19 @@ cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir tst test_suite: Suite run start tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... -tst test_suite: DBG: {combining='resources'} [test_suite?test_suite] +tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] -tst test_suite: Reserving 1 x bts (candidates: 3) [test_suite?test_suite] +tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo - [test_suite?test_suite] -tst test_suite: Reserving 1 x ip_address (candidates: 3) [test_suite?test_suite] +tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 - [test_suite?test_suite] -tst test_suite: Reserving 2 x modem (candidates: 16) [test_suite?test_suite] +tst test_suite: Reserving 2 x modem (candidates: 16) tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f imsi: '901700000007801' ki: D620F48487B1B782DA55DF6717F08FF9 @@ -51,7 +49,6 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 - [test_suite?test_suite] tst hello_world.py:[LINENR] START [test_suite?hello_world.py] tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index ede3b16..fb6d55b 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -352,10 +352,20 @@ def gather_origins(self): origins = Origins() + # this object shall always be seen as the immediate origin of the log message. origins.add(self) + # now go through the parents of this object. origin = self._parent_origin + # but if this object is "loose" and not set up with cascaded 'with' statements, + # take the last seen 'with' statement's object as next parent: if origin is None and Origin._global_current_origin is not None: origin = Origin._global_current_origin + # if this object is currently the _global_current_origin, we don't + # need to add it twice. + if origin is self: + origin = origin._parent_origin + # whichever we determined to be the parent above, go up through all its + # ancestors. while origin is not None: origins.add(origin) origin = origin._parent_origin -- To view, visit https://gerrit.osmocom.org/2850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:57:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:57:21 +0000 Subject: osmo-gsm-tester[master]: fix problem in origin ancestry: don't add self twice In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 Gerrit-PatchSet: 3 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:57:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:57:23 +0000 Subject: [MERGED] osmo-gsm-tester[master]: fix problem in origin ancestry: don't add self twice In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix problem in origin ancestry: don't add self twice ...................................................................... fix problem in origin ancestry: don't add self twice Also add various comments to illustrate what is going on during origin resolution. In the regression tests' expectations, some duplicate entries in the origins are removed, and hence no list of deeper origin ancestry is printed anymore. Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 --- M selftest/process_test.ok M selftest/suite_test.ok M src/osmo_gsm_tester/log.py 3 files changed, 20 insertions(+), 13 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/process_test.ok b/selftest/process_test.ok index 4245eeb..f168ee3 100644 --- a/selftest/process_test.ok +++ b/selftest/process_test.ok @@ -1,7 +1,7 @@ -run foo: DBG: cd '[TMP]'; PATH=[$PATH] foo.py arg1 arg2 [foo?foo] -run foo: DBG: [TMP]/stdout [foo?foo] -run foo: DBG: [TMP]/stderr [foo?foo] -run foo(pid=[PID]): Launched [foo(pid=[PID])?foo(pid=[PID])] +run foo: DBG: cd '[TMP]'; PATH=[$PATH] foo.py arg1 arg2 +run foo: DBG: [TMP]/stdout +run foo: DBG: [TMP]/stderr +run foo(pid=[PID]): Launched stdout: (launched: [DATETIME]) foo stdout diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index b9a8fb3..fd4d743 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -6,11 +6,11 @@ --- -: ERR: RuntimeError: Suite not found: 'does_not_exist' in [PATH]/selftest/suite_test - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test -cnf empty_dir: DBG: reading suite.conf [empty_dir?empty_dir] +cnf empty_dir: DBG: reading suite.conf --- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test -cnf test_suite: DBG: reading suite.conf [test_suite?test_suite] +cnf test_suite: DBG: reading suite.conf defaults: timeout: 60s resources: @@ -26,21 +26,19 @@ cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir tst test_suite: Suite run start tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... -tst test_suite: DBG: {combining='resources'} [test_suite?test_suite] +tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] -tst test_suite: Reserving 1 x bts (candidates: 3) [test_suite?test_suite] +tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 band: GSM-1800 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo - [test_suite?test_suite] -tst test_suite: Reserving 1 x ip_address (candidates: 3) [test_suite?test_suite] +tst test_suite: Reserving 1 x ip_address (candidates: 3) tst test_suite: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 addr: 10.42.42.1 - [test_suite?test_suite] -tst test_suite: Reserving 2 x modem (candidates: 16) [test_suite?test_suite] +tst test_suite: Reserving 2 x modem (candidates: 16) tst test_suite: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f imsi: '901700000007801' ki: D620F48487B1B782DA55DF6717F08FF9 @@ -51,7 +49,6 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 - [test_suite?test_suite] tst hello_world.py:[LINENR] START [test_suite?hello_world.py] tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index ede3b16..fb6d55b 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -352,10 +352,20 @@ def gather_origins(self): origins = Origins() + # this object shall always be seen as the immediate origin of the log message. origins.add(self) + # now go through the parents of this object. origin = self._parent_origin + # but if this object is "loose" and not set up with cascaded 'with' statements, + # take the last seen 'with' statement's object as next parent: if origin is None and Origin._global_current_origin is not None: origin = Origin._global_current_origin + # if this object is currently the _global_current_origin, we don't + # need to add it twice. + if origin is self: + origin = origin._parent_origin + # whichever we determined to be the parent above, go up through all its + # ancestors. while origin is not None: origins.add(origin) origin = origin._parent_origin -- To view, visit https://gerrit.osmocom.org/2850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42c3b8635b54c31c27699140e200c1f75a6ada29 Gerrit-PatchSet: 3 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 Jun 7 17:58:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:58:19 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for reserving more resources than available In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2851/1/selftest/resource_test.py File selftest/resource_test.py: Line 42: except resource.NotSolvable as e: > Perhaps "NoSolution" sounds better? no strong opinion though. it is special to the function called 'solve()', so my choice is NotSolvable. -- To view, visit https://gerrit.osmocom.org/2851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3707f1aaeb40a58c616c33af52a60c9a2e7e1f 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 17:58:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 17:58:40 +0000 Subject: [MERGED] osmo-gsm-tester[master]: error log: clarify for reserving more resources than available In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: error log: clarify for reserving more resources than available ...................................................................... error log: clarify for reserving more resources than available When trying to reserve more resources than available in the resources.conf, actually print an intelligible error message: catch the nameless error from solve() and fill in what was requested for solution. Change-Id: Iba3707f1aaeb40a58c616c33af52a60c9a2e7e1f --- M selftest/resource_test.py M src/osmo_gsm_tester/resource.py 2 files changed, 13 insertions(+), 4 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/resource_test.py b/selftest/resource_test.py index 08f1fbf..c78485e 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -39,7 +39,7 @@ [2], [0, 2] ]) assert False -except resource.NoResourceExn as e: +except resource.NotSolvable as e: print(e) print('- test removing a Resources list from itself') diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 3e8924a..52b23c7 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -337,7 +337,13 @@ continue # figure out who gets what - solution = solve(all_matches) + try: + solution = solve(all_matches) + except NotSolvable: + # instead of a cryptic error message, raise an exception that + # conveys meaning to the user. + raise NoResourceExn('Could not resolve request to reserve resources: ' + '%d x %s with requirements: %r' % (len(want_list), key, want_list)) picked = [ my_list[i] for i in solution if i is not None ] for_origin.dbg('Picked', config.tostr(picked)) matches[key] = picked @@ -364,6 +370,9 @@ for item in item_list: item[RESERVED_KEY] = origin_id + +class NotSolvable(Exception): + pass def solve(all_matches): ''' @@ -403,8 +412,8 @@ solution = search_in_permutations() if not solution: - raise NoResourceExn('The requested resource requirements are not solvable %r' - % all_matches) + raise NotSolvable('The requested resource requirements are not solvable %r' + % all_matches) return solution -- To view, visit https://gerrit.osmocom.org/2851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba3707f1aaeb40a58c616c33af52a60c9a2e7e1f Gerrit-PatchSet: 3 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 Jun 7 18:03:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 18:03:07 +0000 Subject: [PATCH] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial 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/2853 to look at the new patch set (#5). refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should not do 'with' on a central object. The structure needed is, in pseudo code: try: with trial: try: with suite_run: try: with test: test_actions() The 'with' needs to be inside the 'try', so that the exception can be handled in __exit__ before it reaches the exception logging. To clarify this, move the 'with' one level up, i.e. do 'with test' in SuiteRun.run_tests(), not in Test.run(). Move test exception handling to suite_run.run_tests() for that purpose. To keep the same output in suite_test.py, some 'with' need to be added there. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. Minor tweak: pass the return code that the program exit should return further outward, so that the exit(1) call does not cause a SystemExit exception to be logged. The aims of this patch are: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 311 insertions(+), 233 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2853/5 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..8764379 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,35 +20,31 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) -results = s.run_tests('hello_world.py') +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) +with s: + results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) log.style_change(src=True) #log.style_change(trace=True) print('\n- a test with an error') -results = s.run_tests('test_error.py') +with s: + results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') -results = s.run_tests('test_fail.py') +with s: + results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') -results = s.run_tests('test_fail_raise.py') +with s: + results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..e481281 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,72 +157,52 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + return 1 + return 0 if __name__ == '__main__': + rc = 2 try: - main() + rc = main() except: # Tell the log to show the exception, then terminate the program with the exception anyway. # Since exceptions within test runs should be caught and evaluated, this is basically about # exceptions during command line parsing and such, so it's appropriate to abort immediately. log.log_exn() raise + exit(rc) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index fb6d55b..f098f2b 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..166eb42 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,16 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition - try: - with self: - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() - except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() - else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + def run(self): + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +107,26 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + + if tb_str is None: + # populate an exception-less call to set_fail() with traceback info + tb_str = ''.join(traceback.format_stack()[:-1]) + + self.fail_tb = tb_str + self.err('%s: %s' % (self.fail_type, self.fail_message)) + if self.fail_tb: + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +138,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +146,19 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +171,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,27 +203,42 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') try: + log.large_separator(self.trial.name(), self.name(), sublevel=2) self.mark_start() event_loop.register_poll_func(self.poll) if not self.reserved_resources: self.reserve_resources() - for test in self.definition.tests: + for test in self.tests: if names and not test.name() in names: test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) + try: + with test: + test.run() + except Exception as e: + if hasattr(e, 'msg'): + msg = e.msg + else: + msg = str(e) + if isinstance(e, AssertionError): + # AssertionError lacks further information on what was + # asserted. Find the line where the code asserted: + msg += log.get_src_from_tb(sys.exc_info()[2]) + # add source file information to failure report + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + test.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise finally: # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit # base exception is raised. Make sure to stop processes in this @@ -261,14 +246,33 @@ self.stop_processes() self.objects_cleanup() self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..4be9c26 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,15 +79,15 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') - + self.log_report() for lt in self.log_targets: lt.remove() self.log_targets = None @@ -182,25 +182,33 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) + for suite_run in self.suites: + try: + with suite_run: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) report.trial_to_junit_write(self, junit_path) - return self.status def log_report(self): + log.large_separator(self.name(), self.status) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 5 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 Jun 7 18:05:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 18:05:00 +0000 Subject: [MERGED] osmo-gsm-tester[master]: test API: allow passing resource requirements In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: test API: allow passing resource requirements ...................................................................... test API: allow passing resource requirements For all those API functions that directly use reserved_resources.get(), add a 'specifics' argument to be able to pick specific resources. For example, this allows to pick a suite.bts(specifics={'type': 'osmo-bts-sysmo'}) I needed this to test error reporting for over-using resources, but will most probably make sense in the future. Change-Id: If6f175f4bb53dec5306fb3c6479202a7bf1c7116 --- M src/osmo_gsm_tester/suite.py 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..fb6cf36 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -286,8 +286,8 @@ return self.reserved_resources.free() - def ip_address(self): - return self.reserved_resources.get(resource.R_IP_ADDRESS) + def ip_address(self, specifics=None): + return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) def nitb(self, ip_address=None): if ip_address is None: @@ -314,11 +314,11 @@ ip_address = self.ip_address() return osmo_bsc.OsmoBsc(self, msc, ip_address) - def bts(self): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS)) + def bts(self, specifics=None): + return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) - def modem(self): - conf = self.reserved_resources.get(resource.R_MODEM) + def modem(self, specifics=None): + conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) self.dbg('create Modem object', conf=conf) modem = ofono_client.Modem(conf) self.register_for_cleanup(modem) -- To view, visit https://gerrit.osmocom.org/2849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6f175f4bb53dec5306fb3c6479202a7bf1c7116 Gerrit-PatchSet: 2 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 Jun 7 18:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 18:27:21 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 7: (6 comments) almost done here. https://gerrit.osmocom.org/#/c/2779/8//COMMIT_MSG Commit Message: Line 15 MCC+MNC, country code is higher level than network code (same below) Line 29 the most important point here IMHO is that we can scan and register several modems in parallel, without waiting for each of them sequentially. Line 42 maybe mention why we wait for the modem first and then check with the MSC https://gerrit.osmocom.org/#/c/2779/7/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 410: def scan_error_cb(self, obj, e, user_data): > AFAIK it's called by the glib mainloop, which means it's on the same thread We have to get out of the glib main loop before we can start raising exceptions. We do the defer() stuff to avoid calling more things from inside the glib main loop, this is needed here as well. Line 413: def scan_result_cb(self, obj, result, user_data): > same async question also here: we should not initiate DBus actions while still in the glib main loop. Line 418: if not self.is_connected(): > I could check for both by doing self.is_connected(self.mcc_mnc) but I still I still find it weird: in this function we get passed a list of scanned_operators, if we are attached to one of them it says 'Status' == 'current'. For the mcc_mnc == None case this just ignores those and asks for more properties. Can't we have a loop over the scanned_operators for both code paths, and if we find any 'current' one just succeed if mcc_mnc is None? On a different note, if we have mcc_mnc == None, do we even need to scan in the first place? (I don't want to drag this out and make your life difficult, but this feels like an irregularity in the code) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 7 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: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 18:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 7 Jun 2017 18:35:02 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 8: (4 comments) again marked in the new patch set ... earlier was in old patch set, sorry. Also added another spin on the register() thing. https://gerrit.osmocom.org/#/c/2779/8/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 408: def scan_error_cb(self, obj, e, user_data): defer Line 411: def scan_result_cb(self, obj, result, user_data): defer Line 422: def register(self, scanned_operators): is a test script allowed to call register() directly? Is it only called from schedule_scan_register()? I guess this should be the scan_result_cb() instead of a separate function, and schedule_scan_register() should be called register() to be called by tests? Then from earlier comment: use the scanned_operators instead of ignoring and getting more properties from DBus in register_automatic(). Line 437: # won't act as a NO-OP, it actually returns an error). (nice) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 8 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: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 21:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 21:01:20 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 8: (6 comments) https://gerrit.osmocom.org/#/c/2779/8//COMMIT_MSG Commit Message: Line 15: We get the MNC+MCC parameter from the MSC/NITB and we pass it to the > MCC+MNC, country code is higher level than network code (same below) ACK Line 29: directly by pydbus. This way, we can continue polling while waiting for > the most important point here IMHO is that we can scan and register several ACK, will add at the end of the sentence: "and we can register several modems in parallel." Line 42: > maybe mention why we wait for the modem first and then check with the MSC ACK. Can I also write there that I don't agree and that I presonally prefer to put them in the inverse order? :P https://gerrit.osmocom.org/#/c/2779/8/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 408: def scan_error_cb(self, obj, e, user_data): > defer You wrote: "We have to get out of the glib main loop before we can start raising exceptions. We do the defer() stuff to avoid calling more things from inside the glib main loop, this is needed here as well." We cannot raise exceptions inside the glib mainloop? what's the reason behind that? I don't remember it. I'll use defer then, but not sure if it's really needed here tbh. Line 411: def scan_result_cb(self, obj, result, user_data): > defer same Line 422: def register(self, scanned_operators): > is a test script allowed to call register() directly? Is it only called fro schedule_scan_register should not be called for tests, at least for now, only connect() should be used. If that's used, then at some point we can move the poweroff+poweron from inside connect somewhere else. for register_automatic, I'll iterate over scanned_operators and checking if any of them is marked with Status==current. Regarding your question: "On a different note, if we have mcc_mnc == None, do we even need to scan in the first place?" Well, my intuition says that to be able to select and connect automatically to any operator, you first need to find which operators are there so the modem can choose how to register right? -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 8 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: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 7 21:02:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 7 Jun 2017 21:02:03 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 8: (1 comment) https://gerrit.osmocom.org/#/c/2779/8//COMMIT_MSG Commit Message: Line 37: up in next scan.i Just saw there's an extra "i" here. -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 8 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 08:52:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 8 Jun 2017 08:52:22 +0000 Subject: osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Patch Set 5: (2 comments) https://gerrit.osmocom.org/#/c/2854/5/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 212: try: As we are no longer returning the status from here, I think it would be a good idea to state in the method documentation that the result of the method can be found in the "status" property of the instance. Line 222: try: Did you move all this code from Test.run to here to avoid having issues with order of "try" and "with"? Let's say this is at least ugly. Unless you have a good reason for doing this here, I think it should be inside test.run(). -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 09:15:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 8 Jun 2017 09:15:12 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2852/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 483: msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) > yes. If we reserved 4 modems in suite.conf, we can call suite.modem() four Are you perhaps checking the wrong way or I am missing something here? I'm not saying the context you describe cannot happen, it's just that something looks weird to me in these lines: > kind_reserved = self.reserved.get(kind, []) > used_count = len([r for r in kind_reserved if USED_KEY in r]) > elif not (used_count < len(kind_reserved)): used_count is a subset of kind_reserved because you iterate over kind_reserved and only take the ones with USED_KEY defined, which means user_count is always <= len(kind_reserved). So, in the elif case actually the only case which can happen is: elif used_count >= len(kind_reserved) --> used_count == len(kind_reserved). So at least it can be clarified/simplified like that I think, but I'm still not sure that's the logic you intend to do here. -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 09:26:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 8 Jun 2017 09:26:35 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 (2 comments) If you can find a way to move back the exception code inside test.run() please do, otherwise you can merge. https://gerrit.osmocom.org/#/c/2853/2/selftest/suite_test.py File selftest/suite_test.py: Line 33: results = s.run_tests('test_error.py') > by printing the output, all of it is verified in the suite_test.ok file Good point thanks https://gerrit.osmocom.org/#/c/2853/5/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 222: except Exception as e: As I said on the other patch, moving this here seems ugly, but if there's not better way we can keep it here for now. -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 5 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 10:21:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 8 Jun 2017 10:21:22 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() 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/2779 to look at the new patch set (#9). ofono_client: Implement network registration during connect() A new mcc_mnc parameter is now optionally passed to connect() in order to manually register to a specific network with a given MCC+MNC pair. If no parameter is passed (or None), then the modem will be instructed to attempt an automatic registration with any available network which permits it. We get the MCC+MNC parameter from the MSC/NITB and we pass it to the modem object at connect time as shown in the modified tests. Two new simple tests to check network registration is working are added in this commit. Ofono modems seem to be automatically registering at some point after they are set Online=true, and we were actually using that 'feature' before this patch. Thus, it is possible that a modem quickly becomes registered, and we then check so before starting the scan+registration process, which can take a few seconds. The scanning method can take a few seconds to complete. To avoid blocking in the dbus ofono Scan() method, this commit adds some code to make use of glib/gdbus async methods, which are not yet supported directly by pydbus. This way, we can continue polling while waiting for the scan process to complete and we can register several modems in parallel. When scan completes, a callback is run which attempts to register. If no MCC+MNC was passed, as we just finished scanning the modem should have enough fresh operator information to take good and quick decisions on where to connect. If we have an MCC+MNC, then we check the operator list received by Scan() method. If operator with desired MCC+MNC is there, we register with it. If it's not there, we start scanning() again asynchronously hoping the operator will show up in next scan. As scanning() and registration is done in the background, tests are expected to call connect(), and then later on wait for the modem to register by waiting/polling the method "modem.is_connected()". Tests first check for the modem being connected and after with MSC subscriber_attached(). The order is intentional because the later has to poll through network and adds unneeded garbage to the pcap files bein recorded. Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c --- M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M suites/aoip_debug/interactive.py M suites/aoip_sms/mo_mt_sms.py M suites/debug/interactive.py A suites/netreg/register.py A suites/netreg/register_default.py A suites/netreg/suite.conf M suites/sms/mo_mt_sms.py 10 files changed, 226 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/79/2779/9 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 46300ec..fc9bba4 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -22,6 +22,7 @@ from pydbus import SystemBus, Variant import time import pprint +import sys from gi.repository import GLib glib_main_loop = GLib.MainLoop() @@ -31,6 +32,12 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' + +# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 +NETREG_ST_REGISTERED = 'registered' +NETREG_ST_ROAMING = 'roaming' + +NETREG_MAX_REGISTER_ATTEMPTS = 3 class DeferredHandling: defer_queue = [] @@ -47,6 +54,9 @@ while DeferredHandling.defer_queue: handler, args, kwargs = DeferredHandling.defer_queue.pop(0) handler(*args, **kwargs) + +def defer(handler, *args, **kwargs): + DeferredHandling.defer_queue.append((handler, args, kwargs)) def dbus_connect(dbus_iface, handler): '''This function shall be used instead of directly connecting DBus signals. @@ -72,6 +82,53 @@ def list_modems(): root = systembus_get('/') return sorted(root.GetModems()) + +def _async_result_handler(obj, result, user_data): + '''Generic callback dispatcher called from glib loop when an async method + call has returned. This callback is set up by method dbus_async_call.''' + (result_callback, error_callback, real_user_data) = user_data + try: + ret = obj.call_finish(result) + except Exception as e: + # return exception as value + if error_callback: + error_callback(obj, e, real_user_data) + else: + result_callback(obj, e, real_user_data) + return + + ret = ret.unpack() + # to be compatible with standard Python behaviour, unbox + # single-element tuples and return None for empty result tuples + if len(ret) == 1: + ret = ret[0] + elif len(ret) == 0: + ret = None + result_callback(obj, ret, real_user_data) + +def dbus_async_call(instance, proxymethod, *proxymethod_args, + result_handler=None, error_handler=None, + user_data=None, timeout=30, + **proxymethod_kwargs): + '''pydbus doesn't support asynchronous methods. This method adds support for + it until pydbus implements it''' + + argdiff = len(proxymethod_args) - len(proxymethod._inargs) + if argdiff < 0: + raise TypeError(proxymethod.__qualname__ + " missing {} required positional argument(s)".format(-argdiff)) + elif argdiff > 0: + raise TypeError(proxymethod.__qualname__ + " takes {} positional argument(s) but {} was/were given".format(len(proxymethod._inargs), len(proxymethod_args))) + + timeout = timeout * 1000 + user_data = (result_handler, error_handler, user_data) + + ret = instance._bus.con.call( + instance._bus_name, instance._path, + proxymethod._iface_name, proxymethod.__name__, + GLib.Variant(proxymethod._sinargs, proxymethod_args), + GLib.VariantType.new(proxymethod._soutargs), + 0, timeout, None, + _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. @@ -257,6 +314,7 @@ self.set_log_category(log.C_TST) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) + self.register_attempts = 0 self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), @@ -323,18 +381,95 @@ def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) - def connect(self, nitb): - 'set the modem up to connect to MCC+MNC from NITB config' - self.log('connect to', nitb) + def is_connected(self, mcc_mnc=None): + netreg = self.dbus.interface(I_NETREG) + prop = netreg.GetProperties() + status = prop.get('Status') + if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): + return False + if mcc_mnc is None: # Any network is fine and we are registered. + return True + mcc = prop.get('MobileCountryCode') + mnc = prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + return True + return False + + def schedule_scan_register(self, mcc_mnc): + if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: + self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + self.register_attempts += 1 + netreg = self.dbus.interface(I_NETREG) + self.dbg('Scanning for operators...') + # Scan method can take several seconds, and we don't want to block + # waiting for that. Make it async and try to register when the scan is + # finished. + register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register + result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) + error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) + dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, + error_handler=error_handler, user_data=mcc_mnc) + + def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): + self.dbg('scanned operators: ', scanned_operators); + for op_path, op_prop in scanned_operators: + if op_prop.get('Status') == 'current': + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + self.log('Already registered with network', (mcc, mnc)) + return + self.log('Registering with the default network') + netreg = self.dbus.interface(I_NETREG) + netreg.Register() + + def scan_cb_register(self, scanned_operators, mcc_mnc): + self.dbg('scanned operators: ', scanned_operators); + matching_op_path = None + for op_path, op_prop in scanned_operators: + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + if op_prop.get('Status') == 'current': + self.log('Already registered with network', mcc_mnc) + # We discovered the network and we are already registered + # with it. Avoid calling op.Register() in this case (it + # won't act as a NO-OP, it actually returns an error). + return + matching_op_path = op_path + break + if matching_op_path is None: + self.dbg('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + self.schedule_scan_register(mcc_mnc) + return + dbus_op = systembus_get(matching_op_path) + self.log('Registering with operator', matching_op_path, mcc_mnc) + dbus_op.Register() + + def power_cycle(self): + 'Power the modem and put it online, power cycle it if it was already on' if self.is_powered(): - self.dbg('is powered') + self.dbg('Power cycling') self.set_online(False) self.set_powered(False) event_loop.wait(self, lambda: not self.dbus.has_interface(I_NETREG, I_SMS), timeout=10) + else: + self.dbg('Powering on') self.set_powered() self.set_online() event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10) + def connect(self, mcc_mnc=None): + 'Connect to MCC+MNC' + if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): + self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + self.power_cycle() + self.register_attempts = 0 + if self.is_connected(mcc_mnc): + self.log('Already registered with', mcc_mnc if mcc_mnc else 'default network') + else: + self.log('Connect to', mcc_mnc if mcc_mnc else 'default network') + self.schedule_scan_register(mcc_mnc) + def sms_send(self, to_msisdn_or_modem, *tokens): if isinstance(to_msisdn_or_modem, Modem): to_msisdn = to_msisdn_or_modem.msisdn diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ca0e246..d53735b 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -29,6 +29,7 @@ config_file = None process = None hlr = None + config = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): self.suite_run = suite_run @@ -72,6 +73,7 @@ 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()) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -83,6 +85,15 @@ def addr(self): return self.ip_address.get('addr') + def mcc(self): + return self.config['msc']['net']['mcc'] + + def mnc(self): + return self.config['msc']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..b4bf247 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -76,6 +76,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -91,6 +92,15 @@ self.bts.append(bts) bts.set_bsc(self) + def mcc(self): + return self.config['nitb']['net']['mcc'] + + def mnc(self): + return self.config['nitb']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_add(self, modem, msisdn=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 7cc1b76..cfedd3a 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -18,7 +18,7 @@ for m in modems: hlr.subscriber_add(m) - m.connect(bsc) + m.connect(msc.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -30,6 +30,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index b9383ea..8eba842 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -21,13 +21,15 @@ hlr.subscriber_add(ms_mo) hlr.subscriber_add(ms_mt) -ms_mo.connect(bsc) -ms_mt.connect(bsc) +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) sms = ms_mo.sms_send(ms_mt) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 603e395..37076dc 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -13,7 +13,7 @@ for m in modems: nitb.subscriber_add(m) - m.connect(nitb) + m.connect(nitb.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -25,6 +25,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/netreg/register.py b/suites/netreg/register.py new file mode 100755 index 0000000..9141986 --- /dev/null +++ b/suites/netreg/register.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +print(ms.info()) + +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/register_default.py b/suites/netreg/register_default.py new file mode 100755 index 0000000..d15b3f5 --- /dev/null +++ b/suites/netreg/register_default.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect() + +print(ms.info()) + +wait(ms.is_connected) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/suite.conf b/suites/netreg/suite.conf new file mode 100644 index 0000000..1bb1dbb --- /dev/null +++ b/suites/netreg/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 40s diff --git a/suites/sms/mo_mt_sms.py b/suites/sms/mo_mt_sms.py index 860f5e7..4e0ba08 100755 --- a/suites/sms/mo_mt_sms.py +++ b/suites/sms/mo_mt_sms.py @@ -14,13 +14,15 @@ nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) ms_mo.log_info() ms_mt.log_info() print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) sms = ms_mo.sms_send(ms_mt) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 9 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 Thu Jun 8 10:37:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 8 Jun 2017 10:37:01 +0000 Subject: [PATCH] libosmocore[master]: Add macros to set/get/clear/toggle bit flags Message-ID: Review at https://gerrit.osmocom.org/2857 Add macros to set/get/clear/toggle bit flags We extensively use bit masks and flags but do not have any convenience wrappers for it which decrease code readability. Add macros which can set/get, clear and toggle bits with corresponding doxygen annotations and use them throughout the code to make sure they are covered by existing tests. Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f --- M include/osmocom/core/utils.h M src/bits.c M src/fsm.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c 5 files changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/2857/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..c79403d 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -20,6 +20,15 @@ /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Set flag bit in x */ +#define OSMO_SET(x, flag) ((x) |= 1 << (flag)) +/*! \brief Get flag bit in x */ +#define OSMO_GET(x, flag) ((x) & (1 << (flag))) +/*! \brief Clear flag bit in x */ +#define OSMO_CLEAR(x, flag) ((x) &= ~(1 << (flag))) +/*! \brief Toggle flag bit in x */ +#define OSMO_TOGGLE(x, flag) ((x) ^= (1 << (flag))) + #include #include diff --git a/src/bits.c b/src/bits.c index 0c77b27..747a189 100644 --- a/src/bits.c +++ b/src/bits.c @@ -23,6 +23,7 @@ #include #include +#include /*! \addtogroup bits * @{ @@ -193,9 +194,9 @@ op = out_ofs + i; bn = lsb_mode ? (op&7) : (7-(op&7)); if (in[in_ofs+i]) - out[op>>3] |= 1 << bn; + OSMO_SET(out[op>>3], bn); else - out[op>>3] &= ~(1 << bn); + OSMO_CLEAR(out[op>>3], bn); } return ((out_ofs + num_bits - 1) >> 3) + 1; } diff --git a/src/fsm.c b/src/fsm.c index 5e74482..4fb03ad 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -355,7 +355,7 @@ const struct osmo_fsm_state *st = &fsm->states[fi->state]; /* validate if new_state is a valid state */ - if (!(st->out_state_mask & (1 << new_state))) { + if (!OSMO_GET(st->out_state_mask, new_state)) { LOGPFSMLSRC(fi, LOGL_ERROR, file, line, "transition to state %s not permitted!\n", osmo_fsm_state_name(fsm, new_state)); @@ -423,12 +423,12 @@ LOGPFSMSRC(fi, file, line, "Received Event %s\n", osmo_fsm_event_name(fsm, event)); - if (((1 << event) & fsm->allstate_event_mask) && fsm->allstate_action) { + if (OSMO_GET(fsm->allstate_event_mask, event) && fsm->allstate_action) { fsm->allstate_action(fi, event, data); return 0; } - if (!((1 << event) & fs->in_event_mask)) { + if (!OSMO_GET(fs->in_event_mask, event)) { LOGPFSMLSRC(fi, LOGL_ERROR, file, line, "Event %s not permitted\n", osmo_fsm_event_name(fsm, event)); diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f3f354c..30dbb8e 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include #include #include @@ -47,7 +47,7 @@ struct bssgp_bvc_ctx *bctx) { if (bctx) { - target->filter_map |= (1 << LOG_FLT_GB_BVC); + OSMO_SET(target->filter_map, LOG_FLT_GB_BVC); target->filter_data[LOG_FLT_GB_BVC] = bctx; } else if (target->filter_data[LOG_FLT_GB_BVC]) { target->filter_map = ~(1 << LOG_FLT_GB_BVC); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index bdccb3f..fdcaf01 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include #include #include @@ -62,7 +62,7 @@ struct gprs_nsvc *nsvc) { if (nsvc) { - target->filter_map |= (1 << LOG_FLT_GB_NSVC); + OSMO_SET(target->filter_map, LOG_FLT_GB_NSVC); target->filter_data[LOG_FLT_GB_NSVC] = nsvc; } else if (target->filter_data[LOG_FLT_GB_NSVC]) { target->filter_map = ~(1 << LOG_FLT_GB_NSVC); -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 8 10:41:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 8 Jun 2017 10:41:29 +0000 Subject: libosmocore[master]: Add macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2857/1/include/osmocom/core/utils.h File include/osmocom/core/utils.h: Line 24: #define OSMO_SET(x, flag) ((x) |= 1 << (flag)) I'd add _BIT_ to all of them, otherwise seems a bit too generic and you don't know what's doing at first glance: OSMO_BIT_SET() -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 10:48:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 8 Jun 2017 10:48:57 +0000 Subject: [PATCH] libosmocore[master]: Add macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2857 to look at the new patch set (#2). Add macros to set/get/clear/toggle bit flags We extensively use bit masks and flags but do not have any convenience wrappers for it which decrease code readability. Add macros which can set/get, clear and toggle bits with corresponding doxygen annotations and use them throughout the code to make sure they are covered by existing tests. Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f --- M include/osmocom/core/utils.h M src/bits.c M src/fsm.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c 5 files changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/2857/2 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..3b1838e 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -20,6 +20,15 @@ /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Set flag bit in x */ +#define OSMO_BIT_SET(x, flag) ((x) |= 1 << (flag)) +/*! \brief Get flag bit in x */ +#define OSMO_BIT_GET(x, flag) ((x) & (1 << (flag))) +/*! \brief Clear flag bit in x */ +#define OSMO_BIT_CLEAR(x, flag) ((x) &= ~(1 << (flag))) +/*! \brief Toggle flag bit in x */ +#define OSMO_BIT_TOGGLE(x, flag) ((x) ^= (1 << (flag))) + #include #include diff --git a/src/bits.c b/src/bits.c index 0c77b27..37c98f0 100644 --- a/src/bits.c +++ b/src/bits.c @@ -23,6 +23,7 @@ #include #include +#include /*! \addtogroup bits * @{ @@ -193,9 +194,9 @@ op = out_ofs + i; bn = lsb_mode ? (op&7) : (7-(op&7)); if (in[in_ofs+i]) - out[op>>3] |= 1 << bn; + OSMO_BIT_SET(out[op>>3], bn); else - out[op>>3] &= ~(1 << bn); + OSMO_BIT_CLEAR(out[op>>3], bn); } return ((out_ofs + num_bits - 1) >> 3) + 1; } diff --git a/src/fsm.c b/src/fsm.c index 5e74482..333f9e9 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -355,7 +355,7 @@ const struct osmo_fsm_state *st = &fsm->states[fi->state]; /* validate if new_state is a valid state */ - if (!(st->out_state_mask & (1 << new_state))) { + if (!OSMO_BIT_GET(st->out_state_mask, new_state)) { LOGPFSMLSRC(fi, LOGL_ERROR, file, line, "transition to state %s not permitted!\n", osmo_fsm_state_name(fsm, new_state)); @@ -423,12 +423,12 @@ LOGPFSMSRC(fi, file, line, "Received Event %s\n", osmo_fsm_event_name(fsm, event)); - if (((1 << event) & fsm->allstate_event_mask) && fsm->allstate_action) { + if (OSMO_BIT_GET(fsm->allstate_event_mask, event) && fsm->allstate_action) { fsm->allstate_action(fi, event, data); return 0; } - if (!((1 << event) & fs->in_event_mask)) { + if (!OSMO_BIT_GET(fs->in_event_mask, event)) { LOGPFSMLSRC(fi, LOGL_ERROR, file, line, "Event %s not permitted\n", osmo_fsm_event_name(fsm, event)); diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f3f354c..7501b00 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include #include #include @@ -47,7 +47,7 @@ struct bssgp_bvc_ctx *bctx) { if (bctx) { - target->filter_map |= (1 << LOG_FLT_GB_BVC); + OSMO_BIT_SET(target->filter_map, LOG_FLT_GB_BVC); target->filter_data[LOG_FLT_GB_BVC] = bctx; } else if (target->filter_data[LOG_FLT_GB_BVC]) { target->filter_map = ~(1 << LOG_FLT_GB_BVC); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index bdccb3f..e8d7a1b 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include #include #include @@ -62,7 +62,7 @@ struct gprs_nsvc *nsvc) { if (nsvc) { - target->filter_map |= (1 << LOG_FLT_GB_NSVC); + OSMO_BIT_SET(target->filter_map, LOG_FLT_GB_NSVC); target->filter_data[LOG_FLT_GB_NSVC] = nsvc; } else if (target->filter_data[LOG_FLT_GB_NSVC]) { target->filter_map = ~(1 << LOG_FLT_GB_NSVC); -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 8 11:27:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 8 Jun 2017 11:27:50 +0000 Subject: [PATCH] osmo-pcu[master]: Cleanup TBF state handling Message-ID: Review at https://gerrit.osmocom.org/2858 Cleanup TBF state handling Use OSMO_BIT_* macros for manipulating TBF state flags to improve code readability and make state change tracking easier. Change-Id: Icca5ce3273799e0165adcc062db8a4b71dd9fb04 Related: OS#1524 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 5 files changed, 44 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/58/2858/1 diff --git a/src/bts.cpp b/src/bts.cpp index 1d27284..b805bf7 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -651,7 +651,7 @@ } else { tbf->set_ta(ta); tbf->set_state(GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH); tbf_timer_start(tbf, 3169, m_bts.t3169, 0); LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", tbf_name(tbf)); @@ -788,8 +788,8 @@ /* change state */ dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + if (!OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH)) + OSMO_BIT_SET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); /* start timer */ tbf_timer_start(dl_tbf, 0, Tassign_pacch); } else { @@ -797,7 +797,7 @@ dl_tbf->was_releasing = dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_SET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH); /* send immediate assignment */ dl_tbf->bts->snd_dl_ass(dl_tbf, 0, dl_tbf->imsi()); dl_tbf->m_wait_confirm = 1; @@ -1007,10 +1007,8 @@ if (tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [UPLINK] END %s\n", tbf_name(tbf)); tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; - if ((tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + if (OSMO_BIT_GET(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK)) { + OSMO_BIT_CLEAR(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " "ack for UL %s\n", tbf_name(tbf)); } @@ -1033,22 +1031,20 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (OSMO_BIT_GET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH)) { /* We now know that the PACCH really existed */ LOGP(DRLCMAC, LOGL_INFO, "The TBF has been confirmed on the PACCH, " "changed type from CCCH to PACCH for %s\n", tbf_name(new_tbf)); - new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + OSMO_BIT_CLEAR(new_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_SET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); } new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->stop_timer(); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + if (OSMO_BIT_GET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS)) { + OSMO_BIT_CLEAR(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink " "assignment for %s\n", tbf_name(new_tbf)); } @@ -1072,10 +1068,8 @@ tbf_free(tbf); new_tbf->set_state(GPRS_RLCMAC_FLOW); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + if (OSMO_BIT_GET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS)) { + OSMO_BIT_CLEAR(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " "assignment for UL %s\n", tbf_name(new_tbf)); } @@ -1175,9 +1169,9 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_DL_ACK); + if (OSMO_BIT_GET(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK)) { + OSMO_BIT_CLEAR(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack " "for %s\n", tbf_name(tbf)); } @@ -1263,9 +1257,9 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_DL_ACK); + if (OSMO_BIT_GET(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK)) { + OSMO_BIT_CLEAR(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack " "for %s\n", tbf_name(tbf)); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..5a38c49 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -393,7 +393,7 @@ } tbf->m_contention_resolution_done = 1; tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); tbf_timer_start(tbf, 3169, bts->t3169, 0); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -613,11 +613,11 @@ poll_state = GPRS_RLCMAC_POLL_NONE; if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { + if (!OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + OSMO_BIT_SET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK); } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); @@ -638,12 +638,12 @@ } } else if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { + if (!OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET CONTROL ACK for PACKET UPLINK " "ASSIGNMENT.\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + OSMO_BIT_SET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS); } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; @@ -660,12 +660,12 @@ /* reschedule UL assignment */ ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; } else if (dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { + if (!OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET CONTROL ACK for PACKET DOWNLINK " "ASSIGNMENT.\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + OSMO_BIT_SET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS); } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; @@ -684,11 +684,11 @@ } else if (direction == GPRS_RLCMAC_DL_TBF) { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(this); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { + if (!OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET DOWNLINK ACK.\n"); dl_tbf->rlcmac_diag(); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + OSMO_BIT_SET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) @@ -706,8 +706,8 @@ return; } /* resend IMM.ASS on CCCH on timeout */ - if ((dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)) - && !(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_DL_ACK))) { + if (OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH) + && !OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_DL_ACK)) { LOGP(DRLCMAC, LOGL_DEBUG, "Re-send dowlink assignment " "for %s on PCH (IMSI=%s)\n", tbf_name(dl_tbf), @@ -961,7 +961,7 @@ switch (T) { case 0: /* assignment */ - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) { + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_PACCH)) { if (state_is(GPRS_RLCMAC_ASSIGN)) { LOGP(DRLCMAC, LOGL_NOTICE, "%s releasing due to " "PACCH assignment timeout.\n", tbf_name(this)); @@ -971,7 +971,7 @@ LOGP(DRLCMAC, LOGL_ERROR, "Error: %s is not " "in assign state\n", tbf_name(this)); } - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)) { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(this); dl_tbf->m_wait_confirm = 0; if (dl_tbf->state_is(GPRS_RLCMAC_ASSIGN)) { @@ -1022,15 +1022,15 @@ int gprs_rlcmac_tbf::rlcmac_diag() { - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)) LOGP(DRLCMAC, LOGL_NOTICE, "- Assignment was on CCCH\n"); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_PACCH)) LOGP(DRLCMAC, LOGL_NOTICE, "- Assignment was on PACCH\n"); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_UL_DATA))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_UL_DATA)) LOGP(DRLCMAC, LOGL_NOTICE, "- Uplink data was received\n"); else if (direction == GPRS_RLCMAC_UL_TBF) LOGP(DRLCMAC, LOGL_NOTICE, "- No uplink data received yet\n"); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_DL_ACK))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_DL_ACK)) LOGP(DRLCMAC, LOGL_NOTICE, "- Downlink ACK was received\n"); else if (direction == GPRS_RLCMAC_DL_TBF) LOGP(DRLCMAC, LOGL_NOTICE, "- No downlink ACK received yet\n"); @@ -1427,7 +1427,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); - ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + OSMO_BIT_SET(ul_tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); diff --git a/src/tbf.h b/src/tbf.h index 09e3122..46c43a2 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,7 +377,7 @@ return state > GPRS_RLCMAC_ASSIGN || (direction == GPRS_RLCMAC_DL_TBF && state == GPRS_RLCMAC_ASSIGN && - (state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))); + OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)); } inline uint8_t gprs_rlcmac_tbf::tfi() const diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 24c6385..0efa893 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -777,7 +777,7 @@ if (m_last_dl_poll_fn < 0) m_last_dl_poll_fn = fn; - need_poll = state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + need_poll = OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); /* poll after POLL_ACK_AFTER_FRAMES frames, or when final block is tx. */ @@ -808,7 +808,7 @@ tbf_timer_start(this, 3191, bts_data()->t3191, 0); /* Clear poll timeout flag */ - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + OSMO_BIT_CLEAR(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); /* Clear request flag */ m_dl_ack_requested = false; @@ -1080,7 +1080,7 @@ /* keep to flags */ state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_CLEAR(state_flags, GPRS_RLCMAC_FLAG_CCCH); return 0; } @@ -1108,7 +1108,7 @@ /* keep to flags */ state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_CLEAR(state_flags, GPRS_RLCMAC_FLAG_CCCH); return 0; } @@ -1159,7 +1159,7 @@ if (poll_state != GPRS_RLCMAC_POLL_NONE) return false; - return state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK) || + return OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK) || m_tx_counter >= POLL_ACK_AFTER_FRAMES || m_dl_ack_requested; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..7c9f2f4 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -156,7 +156,7 @@ const uint16_t ws = m_window.ws(); - this->state_flags |= (1 << GPRS_RLCMAC_FLAG_UL_DATA); + OSMO_BIT_SET(this->state_flags, GPRS_RLCMAC_FLAG_UL_DATA); LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA TFI=%d received (V(Q)=%d .. " "V(R)=%d)\n", rlc->tfi, this->m_window.v_q(), -- To view, visit https://gerrit.osmocom.org/2858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icca5ce3273799e0165adcc062db8a4b71dd9fb04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 8 12:38:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 8 Jun 2017 12:38:18 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2747 to look at the new patch set (#3). OsmoBTS: Update osmotrx ip to diff between local and remote Change Id of the code implementation: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/47/2747/3 diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index 1c619d3..40a86e2 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -226,8 +226,14 @@ ===== `osmotrx ip HOST` -Set the IP address of the OsmoTRX transceiver to which we should connect -to. +Set the IP address for the OsmoTRX interface for both the local (OsmoBTS) and +remote (OsmoTRX) side of the UDP flows. This option has been deprecated by the +more detailed option `osmotrx ip (local|remote) A.B.C.D`. + +===== `osmotrx ip (local|remote) A.B.C.D` + +Set the IP address for the OsmoTRX interface for either the local (OsmoBTS) or +remote (OsmoTRX) side of the UDP flows. ===== `osmotrx base-port (local|remote) <0-65535>` -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 8 14:05:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 8 Jun 2017 14:05:13 +0000 Subject: [PATCH] osmo-pcu[master]: Cleanup TBF state handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2858 to look at the new patch set (#2). Cleanup TBF state handling * use OSMO_BIT_* macros for manipulating TBF state flags to improve code readability and make state change tracking easier * move copy-pasted code into inline function Change-Id: Icca5ce3273799e0165adcc062db8a4b71dd9fb04 Related: OS#1524 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 5 files changed, 53 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/58/2858/2 diff --git a/src/bts.cpp b/src/bts.cpp index 1d27284..3bc02a2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -651,7 +651,7 @@ } else { tbf->set_ta(ta); tbf->set_state(GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH); tbf_timer_start(tbf, 3169, m_bts.t3169, 0); LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", tbf_name(tbf)); @@ -788,8 +788,8 @@ /* change state */ dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + if (!OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH)) + OSMO_BIT_SET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); /* start timer */ tbf_timer_start(dl_tbf, 0, Tassign_pacch); } else { @@ -797,7 +797,7 @@ dl_tbf->was_releasing = dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_SET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH); /* send immediate assignment */ dl_tbf->bts->snd_dl_ass(dl_tbf, 0, dl_tbf->imsi()); dl_tbf->m_wait_confirm = 1; @@ -1007,10 +1007,8 @@ if (tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [UPLINK] END %s\n", tbf_name(tbf)); tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; - if ((tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + if (OSMO_BIT_GET(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK)) { + OSMO_BIT_CLEAR(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " "ack for UL %s\n", tbf_name(tbf)); } @@ -1033,22 +1031,20 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (OSMO_BIT_GET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH)) { /* We now know that the PACCH really existed */ LOGP(DRLCMAC, LOGL_INFO, "The TBF has been confirmed on the PACCH, " "changed type from CCCH to PACCH for %s\n", tbf_name(new_tbf)); - new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + OSMO_BIT_CLEAR(new_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_SET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); } new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->stop_timer(); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + if (OSMO_BIT_GET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS)) { + OSMO_BIT_CLEAR(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink " "assignment for %s\n", tbf_name(new_tbf)); } @@ -1072,10 +1068,8 @@ tbf_free(tbf); new_tbf->set_state(GPRS_RLCMAC_FLOW); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + if (OSMO_BIT_GET(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS)) { + OSMO_BIT_CLEAR(new_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS); LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " "assignment for UL %s\n", tbf_name(new_tbf)); } @@ -1150,6 +1144,15 @@ } } +static inline void try_dl_ack_recovery(struct gprs_rlcmac_dl_tbf *tbf) +{ + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_DL_ACK); + if (OSMO_BIT_GET(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK)) { + OSMO_BIT_CLEAR(tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack for %s\n", tbf_name(tbf)); + } +} + void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_nack, uint32_t fn) { int8_t tfi = 0; /* must be signed */ @@ -1175,12 +1178,9 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack " - "for %s\n", tbf_name(tbf)); - } + + try_dl_ack_recovery(tbf); + /* reset N3105 */ tbf->n3105 = 0; tbf->stop_t3191(); @@ -1263,12 +1263,9 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack " - "for %s\n", tbf_name(tbf)); - } + + try_dl_ack_recovery(tbf); + /* reset N3105 */ tbf->n3105 = 0; tbf->stop_t3191(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..5a38c49 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -393,7 +393,7 @@ } tbf->m_contention_resolution_done = 1; tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + OSMO_BIT_SET(tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); tbf_timer_start(tbf, 3169, bts->t3169, 0); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -613,11 +613,11 @@ poll_state = GPRS_RLCMAC_POLL_NONE; if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { + if (!OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + OSMO_BIT_SET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ACK); } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); @@ -638,12 +638,12 @@ } } else if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { + if (!OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET CONTROL ACK for PACKET UPLINK " "ASSIGNMENT.\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + OSMO_BIT_SET(state_flags, GPRS_RLCMAC_FLAG_TO_UL_ASS); } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; @@ -660,12 +660,12 @@ /* reschedule UL assignment */ ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; } else if (dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { + if (!OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET CONTROL ACK for PACKET DOWNLINK " "ASSIGNMENT.\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + OSMO_BIT_SET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ASS); } dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; @@ -684,11 +684,11 @@ } else if (direction == GPRS_RLCMAC_DL_TBF) { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(this); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { + if (!OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK)) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " "PACKET DOWNLINK ACK.\n"); dl_tbf->rlcmac_diag(); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + OSMO_BIT_SET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); } dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) @@ -706,8 +706,8 @@ return; } /* resend IMM.ASS on CCCH on timeout */ - if ((dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)) - && !(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_DL_ACK))) { + if (OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_CCCH) + && !OSMO_BIT_GET(dl_tbf->state_flags, GPRS_RLCMAC_FLAG_DL_ACK)) { LOGP(DRLCMAC, LOGL_DEBUG, "Re-send dowlink assignment " "for %s on PCH (IMSI=%s)\n", tbf_name(dl_tbf), @@ -961,7 +961,7 @@ switch (T) { case 0: /* assignment */ - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) { + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_PACCH)) { if (state_is(GPRS_RLCMAC_ASSIGN)) { LOGP(DRLCMAC, LOGL_NOTICE, "%s releasing due to " "PACCH assignment timeout.\n", tbf_name(this)); @@ -971,7 +971,7 @@ LOGP(DRLCMAC, LOGL_ERROR, "Error: %s is not " "in assign state\n", tbf_name(this)); } - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)) { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(this); dl_tbf->m_wait_confirm = 0; if (dl_tbf->state_is(GPRS_RLCMAC_ASSIGN)) { @@ -1022,15 +1022,15 @@ int gprs_rlcmac_tbf::rlcmac_diag() { - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)) LOGP(DRLCMAC, LOGL_NOTICE, "- Assignment was on CCCH\n"); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_PACCH)) LOGP(DRLCMAC, LOGL_NOTICE, "- Assignment was on PACCH\n"); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_UL_DATA))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_UL_DATA)) LOGP(DRLCMAC, LOGL_NOTICE, "- Uplink data was received\n"); else if (direction == GPRS_RLCMAC_UL_TBF) LOGP(DRLCMAC, LOGL_NOTICE, "- No uplink data received yet\n"); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_DL_ACK))) + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_DL_ACK)) LOGP(DRLCMAC, LOGL_NOTICE, "- Downlink ACK was received\n"); else if (direction == GPRS_RLCMAC_DL_TBF) LOGP(DRLCMAC, LOGL_NOTICE, "- No downlink ACK received yet\n"); @@ -1427,7 +1427,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); - ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + OSMO_BIT_SET(ul_tbf->state_flags, GPRS_RLCMAC_FLAG_PACCH); ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); diff --git a/src/tbf.h b/src/tbf.h index 09e3122..46c43a2 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,7 +377,7 @@ return state > GPRS_RLCMAC_ASSIGN || (direction == GPRS_RLCMAC_DL_TBF && state == GPRS_RLCMAC_ASSIGN && - (state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))); + OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)); } inline uint8_t gprs_rlcmac_tbf::tfi() const diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 24c6385..0efa893 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -777,7 +777,7 @@ if (m_last_dl_poll_fn < 0) m_last_dl_poll_fn = fn; - need_poll = state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + need_poll = OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); /* poll after POLL_ACK_AFTER_FRAMES frames, or when final block is tx. */ @@ -808,7 +808,7 @@ tbf_timer_start(this, 3191, bts_data()->t3191, 0); /* Clear poll timeout flag */ - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + OSMO_BIT_CLEAR(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK); /* Clear request flag */ m_dl_ack_requested = false; @@ -1080,7 +1080,7 @@ /* keep to flags */ state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_CLEAR(state_flags, GPRS_RLCMAC_FLAG_CCCH); return 0; } @@ -1108,7 +1108,7 @@ /* keep to flags */ state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + OSMO_BIT_CLEAR(state_flags, GPRS_RLCMAC_FLAG_CCCH); return 0; } @@ -1159,7 +1159,7 @@ if (poll_state != GPRS_RLCMAC_POLL_NONE) return false; - return state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK) || + return OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_TO_DL_ACK) || m_tx_counter >= POLL_ACK_AFTER_FRAMES || m_dl_ack_requested; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..7c9f2f4 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -156,7 +156,7 @@ const uint16_t ws = m_window.ws(); - this->state_flags |= (1 << GPRS_RLCMAC_FLAG_UL_DATA); + OSMO_BIT_SET(this->state_flags, GPRS_RLCMAC_FLAG_UL_DATA); LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA TFI=%d received (V(Q)=%d .. " "V(R)=%d)\n", rlc->tfi, this->m_window.v_q(), -- To view, visit https://gerrit.osmocom.org/2858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icca5ce3273799e0165adcc062db8a4b71dd9fb04 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 8 15:27:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 8 Jun 2017 15:27:50 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify polling troubleshooting Message-ID: Review at https://gerrit.osmocom.org/2859 Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change and logging into set_polling() Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 4 files changed, 38 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/2859/1 diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..8864198 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,37 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); - /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", + name(), poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", + name(), poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on FN=%d, TS=%d\n", + name(), poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on FN=%d, TS=%d\n", + name(), poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1135,11 +1156,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1236,11 +1253,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index 09e3122..5621ebe 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 24c6385..d904ca5 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -798,10 +798,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..4801753 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -137,9 +137,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 8 15:49:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 8 Jun 2017 15:49:52 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify polling troubleshooting In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2859 to look at the new patch set (#2). Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 5 files changed, 80 insertions(+), 90 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/2859/2 diff --git a/src/tbf.cpp b/src/tbf.cpp index 5a38c49..f51171f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,45 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); + const char *chan = "UNKNOWN"; + + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_CCCH)) + chan = "CCCH"; + + if (OSMO_BIT_GET(state_flags, GPRS_RLCMAC_FLAG_PACCH)) + chan = "PACCH"; /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1135,11 +1164,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1236,11 +1261,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index 46c43a2..2f58c21 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 0efa893..50331f8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -798,10 +798,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 7c9f2f4..740bef0 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -137,9 +137,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2002379..1eca822 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -63,8 +63,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -151,8 +150,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -239,8 +237,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -1621,8 +1618,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1706,8 +1702,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1757,8 +1752,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1788,8 +1782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654292 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 msg block (BSN 0, CS-4): 0f 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -1845,8 +1838,7 @@ TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654348, TS=7) Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1916,8 +1908,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2012,8 +2003,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654340, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2093,8 +2083,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2247,8 +2236,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2337,8 +2325,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2795,8 +2782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW): Scheduling polling at FN 2654379 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled Ack/Nack polling on FN=2654379, TS=7 msg block (BSN 20, CS-1): 0f 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654366 block=6 data=08 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 @@ -3024,8 +3010,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3258,8 +3243,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654461 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 msg block (BSN 10, CS-1): 0f 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 @@ -3388,8 +3372,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3483,8 +3466,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3728,8 +3710,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4063,8 +4044,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4343,8 +4323,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4582,8 +4561,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4785,8 +4763,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4966,8 +4943,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5128,8 +5104,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5286,8 +5261,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5431,8 +5405,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5749,8 +5722,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5820,8 +5792,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5888,8 +5859,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5959,8 +5929,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -6268,8 +6237,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6445,8 +6413,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6906,8 +6873,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -7991,8 +7957,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on PACCH (FN=2654292, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:23:22 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:23:22 +0000 Subject: osmo-trx[master]: PRBS: a Pseudo-random binary sequence (PRBS) generator class. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I also agree in that it makes sense for PRBS sequences to be in libosmocore, but the current patch is not mergeable into libosmocore. If someone decides to rewrite the patch in C and appropriate coding style for libosmocore, then we can remove it from osmo-trx at that time. -- To view, visit https://gerrit.osmocom.org/2764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:30:20 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:30:20 +0000 Subject: osmo-trx[master]: WIP:sigProcLib: Reduce burst detection window for NB. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 We can't reduce the detection window unless the timing concerns in e90c24c8 are considered and/or the underlying issue is addressed. One possibility is disabling 4/1 SPS support and/or defaulting to 4/4 SPS (which has more stable timing), but those are much more drastic solutions. -- To view, visit https://gerrit.osmocom.org/2765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3cb40d2311504a13c03e1fbccad663ac201d9a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:31:20 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:31:20 +0000 Subject: osmo-trx[master]: ssedetect: call __builtin_cpu_supports() only if supported In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c90402d8e4c9f196c54b066ff30891c8de3ad2b Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:31:23 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:31:23 +0000 Subject: osmo-trx[master]: buildenv: check for __builtin_cpu_supports call support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797f638573e8c3aae39c28abb157ce2ac419f3f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:31:28 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:31:28 +0000 Subject: osmo-trx[master]: buildenv: cosmetic changes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c52f2981513fa6322bdf992215e3e099ac3ddee Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:31:44 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:31:44 +0000 Subject: osmo-trx[master]: buildenv: fix build on systems without SIMD support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3350b14dbc91e9b388d0b04a0ed22ba27d436313 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:31:50 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:31:50 +0000 Subject: osmo-trx[master]: buildenv: actually strip unused cpuid functionality In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I380bc9c13d29319685781ef27973afe6744fcf3d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:31:57 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:31:57 +0000 Subject: osmo-trx[master]: buildenv: correct the ax_sse macro description In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4ce65443c8a33ae9add8f6da9d911c3178472ab2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:32:29 +0000 Subject: [MERGED] osmo-trx[master]: buildenv: correct the ax_sse macro description In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: buildenv: correct the ax_sse macro description ...................................................................... buildenv: correct the ax_sse macro description Change-Id: I4ce65443c8a33ae9add8f6da9d911c3178472ab2 --- M config/ax_sse.m4 1 file changed, 5 insertions(+), 6 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/config/ax_sse.m4 b/config/ax_sse.m4 index ed4d223..cf363a4 100644 --- a/config/ax_sse.m4 +++ b/config/ax_sse.m4 @@ -4,14 +4,13 @@ # # SYNOPSIS # -# AX_EXT +# AX_SSE # # DESCRIPTION # -# Find supported SIMD extensions by requesting cpuid. When an SIMD -# extension is found, the -m"simdextensionname" is added to SIMD_FLAGS if -# compiler supports it. For example, if "sse2" is available, then "-msse2" -# is added to SIMD_FLAGS. +# Find SIMD extensions supported by compiler. The -m"simdextensionname" is +# added to SIMD_FLAGS if compiler supports it. For example, if "sse2" is +# available, then "-msse2" is added to SIMD_FLAGS. # # This macro calls: # @@ -19,7 +18,7 @@ # # And defines: # -# HAVE_MMX / HAVE_SSE / HAVE_SSE2 / HAVE_SSE3 / HAVE_SSSE3 / HAVE_SSE4.1 / HAVE_SSE4.2 / HAVE_AVX +# HAVE_SSE3 / HAVE_SSE4.1 # # LICENSE # -- To view, visit https://gerrit.osmocom.org/2685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ce65443c8a33ae9add8f6da9d911c3178472ab2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:32:30 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:32:30 +0000 Subject: [MERGED] osmo-trx[master]: buildenv: actually strip unused cpuid functionality In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: buildenv: actually strip unused cpuid functionality ...................................................................... buildenv: actually strip unused cpuid functionality Despite the macro message says, that cpuid functionality was stripped it was still partially preset and wasn't used anyhow. Change-Id: I380bc9c13d29319685781ef27973afe6744fcf3d --- D config/ax_gcc_x86_avx_xgetbv.m4 D config/ax_gcc_x86_cpuid.m4 M config/ax_sse.m4 3 files changed, 0 insertions(+), 164 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/config/ax_gcc_x86_avx_xgetbv.m4 b/config/ax_gcc_x86_avx_xgetbv.m4 deleted file mode 100644 index 0624eeb..0000000 --- a/config/ax_gcc_x86_avx_xgetbv.m4 +++ /dev/null @@ -1,79 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_avx_xgetbv.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_X86_AVX_XGETBV -# -# DESCRIPTION -# -# On later x86 processors with AVX SIMD support, with gcc or a compiler -# that has a compatible syntax for inline assembly instructions, run a -# small program that executes the xgetbv instruction with input OP. This -# can be used to detect if the OS supports AVX instruction usage. -# -# On output, the values of the eax and edx registers are stored as -# hexadecimal strings as "eax:edx" in the cache variable -# ax_cv_gcc_x86_avx_xgetbv. -# -# If the xgetbv instruction fails (because you are running a -# cross-compiler, or because you are not using gcc, or because you are on -# a processor that doesn't have this instruction), -# ax_cv_gcc_x86_avx_xgetbv_OP is set to the string "unknown". -# -# This macro mainly exists to be used in AX_EXT. -# -# LICENSE -# -# Copyright (c) 2013 Michael Petch -# -# 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 . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 1 - -AC_DEFUN([AX_GCC_X86_AVX_XGETBV], -[AC_REQUIRE([AC_PROG_CC]) -AC_LANG_PUSH([C]) -AC_CACHE_CHECK(for x86-AVX xgetbv $1 output, ax_cv_gcc_x86_avx_xgetbv_$1, - [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ - int op = $1, eax, edx; - FILE *f; - /* Opcodes for xgetbv */ - __asm__(".byte 0x0f, 0x01, 0xd0" - : "=a" (eax), "=d" (edx) - : "c" (op)); - f = fopen("conftest_xgetbv", "w"); if (!f) return 1; - fprintf(f, "%x:%x\n", eax, edx); - fclose(f); - return 0; -])], - [ax_cv_gcc_x86_avx_xgetbv_$1=`cat conftest_xgetbv`; rm -f conftest_xgetbv], - [ax_cv_gcc_x86_avx_xgetbv_$1=unknown; rm -f conftest_xgetbv], - [ax_cv_gcc_x86_avx_xgetbv_$1=unknown])]) -AC_LANG_POP([C]) -]) diff --git a/config/ax_gcc_x86_cpuid.m4 b/config/ax_gcc_x86_cpuid.m4 deleted file mode 100644 index 7d46fee..0000000 --- a/config/ax_gcc_x86_cpuid.m4 +++ /dev/null @@ -1,79 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_X86_CPUID(OP) -# -# DESCRIPTION -# -# On Pentium and later x86 processors, with gcc or a compiler that has a -# compatible syntax for inline assembly instructions, run a small program -# that executes the cpuid instruction with input OP. This can be used to -# detect the CPU type. -# -# On output, the values of the eax, ebx, ecx, and edx registers are stored -# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable -# ax_cv_gcc_x86_cpuid_OP. -# -# If the cpuid instruction fails (because you are running a -# cross-compiler, or because you are not using gcc, or because you are on -# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP -# is set to the string "unknown". -# -# This macro mainly exists to be used in AX_GCC_ARCHFLAG. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2008 Matteo Frigo -# -# 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 . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 7 - -AC_DEFUN([AX_GCC_X86_CPUID], -[AC_REQUIRE([AC_PROG_CC]) -AC_LANG_PUSH([C]) -AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, - [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ - int op = $1, eax, ebx, ecx, edx; - FILE *f; - __asm__("cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op)); - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; -])], - [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], - [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], - [ax_cv_gcc_x86_cpuid_$1=unknown])]) -AC_LANG_POP([C]) -]) diff --git a/config/ax_sse.m4 b/config/ax_sse.m4 index cf363a4..5c4e321 100644 --- a/config/ax_sse.m4 +++ b/config/ax_sse.m4 @@ -42,12 +42,6 @@ case $host_cpu in i[[3456]]86*|x86_64*|amd64*) - - AC_REQUIRE([AX_GCC_X86_CPUID]) - AC_REQUIRE([AX_GCC_X86_AVX_XGETBV]) - - AX_GCC_X86_CPUID(0x00000001) - AX_CHECK_COMPILE_FLAG(-msse3, ax_cv_support_sse3_ext=yes, []) if test x"$ax_cv_support_sse3_ext" = x"yes"; then SIMD_FLAGS="$SIMD_FLAGS -msse3" -- To view, visit https://gerrit.osmocom.org/2686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I380bc9c13d29319685781ef27973afe6744fcf3d Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:32:30 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:32:30 +0000 Subject: [MERGED] osmo-trx[master]: buildenv: fix build on systems without SIMD support In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: buildenv: fix build on systems without SIMD support ...................................................................... buildenv: fix build on systems without SIMD support HAVE_SSE3 and HAVE_SSE4_1 were never defined if CPU architecture doesn't match the (86*|x86_64*|amd64*) condition. Change-Id: I3350b14dbc91e9b388d0b04a0ed22ba27d436313 --- M config/ax_sse.m4 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/config/ax_sse.m4 b/config/ax_sse.m4 index 5c4e321..7d9d7fb 100644 --- a/config/ax_sse.m4 +++ b/config/ax_sse.m4 @@ -40,6 +40,9 @@ [ AC_REQUIRE([AC_CANONICAL_HOST]) + AM_CONDITIONAL(HAVE_SSE3, false) + AM_CONDITIONAL(HAVE_SSE4_1, false) + case $host_cpu in i[[3456]]86*|x86_64*|amd64*) AX_CHECK_COMPILE_FLAG(-msse3, ax_cv_support_sse3_ext=yes, []) @@ -49,7 +52,6 @@ AM_CONDITIONAL(HAVE_SSE3, true) else AC_MSG_WARN([Your compiler does not support sse3 instructions, can you try another compiler?]) - AM_CONDITIONAL(HAVE_SSE3, false) fi AX_CHECK_COMPILE_FLAG(-msse4.1, ax_cv_support_sse41_ext=yes, []) @@ -59,7 +61,6 @@ AM_CONDITIONAL(HAVE_SSE4_1, true) else AC_MSG_WARN([Your compiler does not support sse4.1 instructions, can you try another compiler?]) - AM_CONDITIONAL(HAVE_SSE4_1, false) fi ;; esac -- To view, visit https://gerrit.osmocom.org/2687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3350b14dbc91e9b388d0b04a0ed22ba27d436313 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:32:30 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:32:30 +0000 Subject: [MERGED] osmo-trx[master]: buildenv: cosmetic changes In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: buildenv: cosmetic changes ...................................................................... buildenv: cosmetic changes Change-Id: I9c52f2981513fa6322bdf992215e3e099ac3ddee --- M config/ax_sse.m4 1 file changed, 8 insertions(+), 6 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/config/ax_sse.m4 b/config/ax_sse.m4 index 7d9d7fb..de97124 100644 --- a/config/ax_sse.m4 +++ b/config/ax_sse.m4 @@ -48,19 +48,21 @@ AX_CHECK_COMPILE_FLAG(-msse3, ax_cv_support_sse3_ext=yes, []) if test x"$ax_cv_support_sse3_ext" = x"yes"; then SIMD_FLAGS="$SIMD_FLAGS -msse3" - AC_DEFINE(HAVE_SSE3,,[Support SSE3 (Streaming SIMD Extensions 3) instructions]) - AM_CONDITIONAL(HAVE_SSE3, true) + AC_DEFINE(HAVE_SSE3,, + [Support SSE3 (Streaming SIMD Extensions 3) instructions]) + AM_CONDITIONAL(HAVE_SSE3, true) else - AC_MSG_WARN([Your compiler does not support sse3 instructions, can you try another compiler?]) + AC_MSG_WARN([Your compiler does not support SSE3 instructions]) fi AX_CHECK_COMPILE_FLAG(-msse4.1, ax_cv_support_sse41_ext=yes, []) if test x"$ax_cv_support_sse41_ext" = x"yes"; then SIMD_FLAGS="$SIMD_FLAGS -msse4.1" - AC_DEFINE(HAVE_SSE4_1,,[Support SSE4.1 (Streaming SIMD Extensions 4.1) instructions]) - AM_CONDITIONAL(HAVE_SSE4_1, true) + AC_DEFINE(HAVE_SSE4_1,, + [Support SSE4.1 (Streaming SIMD Extensions 4.1) instructions]) + AM_CONDITIONAL(HAVE_SSE4_1, true) else - AC_MSG_WARN([Your compiler does not support sse4.1 instructions, can you try another compiler?]) + AC_MSG_WARN([Your compiler does not support SSE4.1]) fi ;; esac -- To view, visit https://gerrit.osmocom.org/2688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c52f2981513fa6322bdf992215e3e099ac3ddee Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:32:30 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:32:30 +0000 Subject: [MERGED] osmo-trx[master]: buildenv: check for __builtin_cpu_supports call support In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: buildenv: check for __builtin_cpu_supports call support ...................................................................... buildenv: check for __builtin_cpu_supports call support The '__builtin_cpu_supports' is a GCC's built-in function which returns a positive integer if the run-time CPU supports specified SIMD feature and returns 0 otherwise. This change adds a new check, whether compiler supports this call. See /gcc/X86-Built-in-Functions.html at gcc.gnu.org for reference. Change-Id: I797f638573e8c3aae39c28abb157ce2ac419f3f7 --- M configure.ac 1 file changed, 27 insertions(+), 0 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 7c3c76f..8ddd07d 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,33 @@ AM_CONDITIONAL(HAVE_SSE4_1, false) ]) +dnl Check if the compiler supports specified GCC's built-in function +AC_DEFUN([CHECK_BUILTIN_SUPPORT], [ + AC_CACHE_CHECK( + [whether ${CC} has $1 built-in], + [osmo_cv_cc_has_builtin], [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([], [ + __builtin_cpu_supports("sse"); + ]) + ], + [AS_VAR_SET([osmo_cv_cc_has_builtin], [yes])], + [AS_VAR_SET([osmo_cv_cc_has_builtin], [no])]) + ] + ) + + AS_IF([test yes = AS_VAR_GET([osmo_cv_cc_has_builtin])], [ + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, + [Define to 1 if compiler has the '$1' built-in function]) + ], [ + AC_MSG_WARN($2) + ]) +]) + +dnl Check if the compiler supports runtime SIMD detection +CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports], + [Runtime SIMD detection will be disabled]) + AM_CONDITIONAL(USRP1, [test "x$with_usrp1" = "xyes"]) AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"]) AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) -- To view, visit https://gerrit.osmocom.org/2689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I797f638573e8c3aae39c28abb157ce2ac419f3f7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:32:31 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:32:31 +0000 Subject: [MERGED] osmo-trx[master]: ssedetect: call __builtin_cpu_supports() only if supported In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: ssedetect: call __builtin_cpu_supports() only if supported ...................................................................... ssedetect: call __builtin_cpu_supports() only if supported Some compilers don't support the __builtin_cpu_supports built-in, so let's make them able to compile the project anyway. Change-Id: I0c90402d8e4c9f196c54b066ff30891c8de3ad2b --- M Transceiver52M/osmo-trx.cpp M Transceiver52M/x86/convert.c M Transceiver52M/x86/convolve.c 3 files changed, 11 insertions(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 1c0ceb1..31a99cf 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -397,18 +397,26 @@ #ifdef HAVE_SSE3 printf("Info: SSE3 support compiled in"); +#ifdef HAVE___BUILTIN_CPU_SUPPORTS if (__builtin_cpu_supports("sse3")) printf(" and supported by CPU\n"); else printf(", but not supported by CPU\n"); +#else + printf(", but runtime SIMD detection disabled\n"); +#endif #endif #ifdef HAVE_SSE4_1 printf("Info: SSE4.1 support compiled in"); +#ifdef HAVE___BUILTIN_CPU_SUPPORTS if (__builtin_cpu_supports("sse4.1")) printf(" and supported by CPU\n"); else printf(", but not supported by CPU\n"); +#else + printf(", but runtime SIMD detection disabled\n"); +#endif #endif convolve_init(); diff --git a/Transceiver52M/x86/convert.c b/Transceiver52M/x86/convert.c index db98050..07cdf59 100644 --- a/Transceiver52M/x86/convert.c +++ b/Transceiver52M/x86/convert.c @@ -46,6 +46,7 @@ c.convert_si16_ps_16n = base_convert_short_float; c.convert_si16_ps = base_convert_short_float; +#ifdef HAVE___BUILTIN_CPU_SUPPORTS #ifdef HAVE_SSE4_1 if (__builtin_cpu_supports("sse4.1")) { c.convert_si16_ps_16n = &_sse_convert_si16_ps_16n; @@ -60,6 +61,7 @@ c.convert_scale_ps_si16 = _sse_convert_scale_ps_si16; } #endif +#endif } void convert_float_short(short *out, const float *in, float scale, int len) diff --git a/Transceiver52M/x86/convolve.c b/Transceiver52M/x86/convolve.c index 35cba29..eb38f64 100644 --- a/Transceiver52M/x86/convolve.c +++ b/Transceiver52M/x86/convolve.c @@ -82,7 +82,7 @@ c.conv_real4n = (void *)_base_convolve_real; c.conv_real = (void *)_base_convolve_real; -#ifdef HAVE_SSE3 +#if defined(HAVE_SSE3) && defined(HAVE___BUILTIN_CPU_SUPPORTS) if (__builtin_cpu_supports("sse3")) { c.conv_cmplx_4n = sse_conv_cmplx_4n; c.conv_cmplx_8n = sse_conv_cmplx_8n; -- To view, visit https://gerrit.osmocom.org/2690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c90402d8e4c9f196c54b066ff30891c8de3ad2b Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 18:34:26 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 8 Jun 2017 18:34:26 +0000 Subject: [MERGED] osmo-trx[master]: PRBS: a Pseudo-random binary sequence (PRBS) generator class. In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: PRBS: a Pseudo-random binary sequence (PRBS) generator class. ...................................................................... PRBS: a Pseudo-random binary sequence (PRBS) generator class. Implemeted with a Galois LFSR for speed and flexibility compared to Fibonacci version. Aliases for three popular PRBS' are added for convenience - PRBS9, PRBS15 and PRBS64. Note that we can't test PRBS64 completely, because the sequence is too long to be generated. Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74 --- M .gitignore M CommonLibs/Makefile.am A CommonLibs/PRBS.h A CommonLibs/PRBSTest.cpp 4 files changed, 157 insertions(+), 0 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index d1a0b33..d560f19 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ CommonLibs/TimevalTest CommonLibs/URLEncodeTest CommonLibs/VectorTest +CommonLibs/PRBSTest # automake/autoconf *.in diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index f0f1061..18ec2f7 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -42,6 +42,7 @@ noinst_PROGRAMS = \ BitVectorTest \ + PRBSTest \ InterthreadTest \ SocketsTest \ TimevalTest \ @@ -53,6 +54,7 @@ noinst_HEADERS = \ BitVector.h \ + PRBS.h \ Interthread.h \ LinkedLists.h \ Sockets.h \ @@ -66,6 +68,8 @@ BitVectorTest_SOURCES = BitVectorTest.cpp BitVectorTest_LDADD = libcommon.la $(SQLITE3_LIBS) +PRBSTest_SOURCES = PRBSTest.cpp + InterthreadTest_SOURCES = InterthreadTest.cpp InterthreadTest_LDADD = libcommon.la InterthreadTest_LDFLAGS = -lpthread diff --git a/CommonLibs/PRBS.h b/CommonLibs/PRBS.h new file mode 100644 index 0000000..0b7bbc3 --- /dev/null +++ b/CommonLibs/PRBS.h @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2017 Alexander Chemeris + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PRBS_H +#define PRBS_H + +#include +#include + +/** Pseudo-random binary sequence (PRBS) generator (a Galois LFSR implementation). */ +class PRBS { +public: + + PRBS(unsigned wLen, uint64_t wCoeff, uint64_t wState = 0x01) + : mCoeff(wCoeff), mStartState(wState), mState(wState), mLen(wLen) + { assert(wLen<=64); } + + /**@name Accessors */ + //@{ + uint64_t coeff() const { return mCoeff; } + uint64_t state() const { return mState; } + void state(uint64_t state) { mState = state & mask(); } + unsigned size() const { return mLen; } + //@} + + /** + Calculate one bit of a PRBS + */ + unsigned generateBit() + { + const unsigned result = mState & 0x01; + processBit(result); + return result; + } + + /** + Update the generator state by one bit. + If you want to synchronize your PRBS to a known state, call this function + size() times passing your PRBS to it bit by bit. + */ + void processBit(unsigned inBit) + { + mState >>= 1; + if (inBit) mState ^= mCoeff; + } + + /** Return true when PRBS is wrapping through initial state */ + bool isFinished() const { return mStartState == mState; } + +protected: + + uint64_t mCoeff; ///< polynomial coefficients. LSB is zero exponent. + uint64_t mStartState; ///< initial shift register state. + uint64_t mState; ///< shift register state. + unsigned mLen; ///< number of bits used in shift register + + /** Return mask for the state register */ + uint64_t mask() const { return (mLen==64)?0xFFFFFFFFFFFFFFFFUL:((1< + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "PRBS.h" +#include +#include +#include + +void testPrbs(PRBS &prbs, uint64_t expectedPeriod) +{ + uint64_t period = 0; + do { + std::cout << prbs.generateBit(); + period++; + } while (!prbs.isFinished()); + std::cout << std::endl; + std::cout << "Period: " << period << std::endl; + assert(period == expectedPeriod); +} + +int main(int argc, char *argv[]) +{ + PRBS9 prbs9(0x01); + testPrbs(prbs9, (1<<9)-1); + PRBS15 prbs15(0x01); + testPrbs(prbs15, (1<<15)-1); +} -- To view, visit https://gerrit.osmocom.org/2764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5331ba5d0b5819929541686fdd87905e2177b74 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 8 21:26:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:26:32 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-msc: configure HLR address Message-ID: Review at https://gerrit.osmocom.org/2860 osmo-msc: configure HLR address In db59bcf9fcdc5f05fdb9047b905ab497472440bc we added a configured GSUP server address for the osmo-hlr, but the osmo-msc is still trying to connect to 127.0.0.1. In the same way as for mgcpgw, add conf_for_msc() to OsmoHLR, and use that to configure the HLR's address in osmo-msc.cfg. Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 --- M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/60/2860/1 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 354eb1d..3492f06 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -126,4 +126,7 @@ % (subscriber_id, modem.imsi(), modem.msisdn)) return subscriber_id + def conf_for_msc(self): + return dict(hlr=dict(ip_address=self.ip_address)) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ca0e246..2ef88df 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -72,6 +72,7 @@ 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.hlr.conf_for_msc()) self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index c52d0dc..247365e 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -28,3 +28,5 @@ esme test password test default-route +hlr + remote-ip ${hlr.ip_address.addr} -- To view, visit https://gerrit.osmocom.org/2860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 8 21:27:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:27:10 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-msc: configure HLR address In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2860 to look at the new patch set (#2). osmo-msc: configure HLR address In db59bcf9fcdc5f05fdb9047b905ab497472440bc we added a configured GSUP server address for the osmo-hlr, but the osmo-msc is still trying to connect to 127.0.0.1. In the same way as for mgcpgw, add conf_for_msc() to OsmoHLR, and use that to configure the HLR's address in osmo-msc.cfg. Related: OS#2320 Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 --- M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/60/2860/2 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 354eb1d..3492f06 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -126,4 +126,7 @@ % (subscriber_id, modem.imsi(), modem.msisdn)) return subscriber_id + def conf_for_msc(self): + return dict(hlr=dict(ip_address=self.ip_address)) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ca0e246..2ef88df 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -72,6 +72,7 @@ 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.hlr.conf_for_msc()) self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index c52d0dc..247365e 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -28,3 +28,5 @@ esme test password test default-route +hlr + remote-ip ${hlr.ip_address.addr} -- To view, visit https://gerrit.osmocom.org/2860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 8 21:28:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:28:18 +0000 Subject: osmo-gsm-tester[master]: osmo-msc: configure HLR address In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 fast track because builds are failing. Verified to work in manual run http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/454/ -- To view, visit https://gerrit.osmocom.org/2860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Jun 8 21:28:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:28:20 +0000 Subject: [MERGED] osmo-gsm-tester[master]: osmo-msc: configure HLR address In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-msc: configure HLR address ...................................................................... osmo-msc: configure HLR address In db59bcf9fcdc5f05fdb9047b905ab497472440bc we added a configured GSUP server address for the osmo-hlr, but the osmo-msc is still trying to connect to 127.0.0.1. In the same way as for mgcpgw, add conf_for_msc() to OsmoHLR, and use that to configure the HLR's address in osmo-msc.cfg. Related: OS#2320 Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 --- M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 3 files changed, 6 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 354eb1d..3492f06 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -126,4 +126,7 @@ % (subscriber_id, modem.imsi(), modem.msisdn)) return subscriber_id + def conf_for_msc(self): + return dict(hlr=dict(ip_address=self.ip_address)) + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index ca0e246..2ef88df 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -72,6 +72,7 @@ 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.hlr.conf_for_msc()) self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index c52d0dc..247365e 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -28,3 +28,5 @@ esme test password test default-route +hlr + remote-ip ${hlr.ip_address.addr} -- To view, visit https://gerrit.osmocom.org/2860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I005aa160c679fc92b248abd762888959bd5b2c55 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 8 21:38:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:38:34 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2852/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 483: msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) > Are you perhaps checking the wrong way or I am missing something here? I'm exactly, this is correct. I could check for used_count == len(), but my personal preference is to write more paranoid code. What if for some odd software bug, used_count ends up > len()? Hence I rather check for "not (used_count < len())". Also IMHO this clarifies what I usually want: used_count to be smaller than the reserved amount. If it's not smaller, then go to this error case. -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 21:41:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:41:07 +0000 Subject: [PATCH] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial 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/2853 to look at the new patch set (#6). refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. State leaking across runs can be seen in http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/453/ where an earlier sms test for sysmo succeeds, but its state gets overwritten by the later sms test for trx that fails. The end result is that both tests failed, although the first run was successful. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should not do 'with' on a central object. The structure needed is, in pseudo code: try: with trial: try: with suite_run: try: with test: test_actions() The 'with' needs to be inside the 'try', so that the exception can be handled in __exit__ before it reaches the exception logging. To clarify this, move the 'with' one level up, i.e. do 'with test' in SuiteRun.run_tests(), not in Test.run(). Move test exception handling to suite_run.run_tests() for that purpose. To keep the same output in suite_test.py, some 'with' need to be added there. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. Minor tweak: pass the return code that the program exit should return further outward, so that the exit(1) call does not cause a SystemExit exception to be logged. The aims of this patch are: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 311 insertions(+), 233 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2853/6 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..8764379 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,35 +20,31 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) -results = s.run_tests('hello_world.py') +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) +with s: + results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) log.style_change(src=True) #log.style_change(trace=True) print('\n- a test with an error') -results = s.run_tests('test_error.py') +with s: + results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') -results = s.run_tests('test_fail.py') +with s: + results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') -results = s.run_tests('test_fail_raise.py') +with s: + results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..e481281 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,72 +157,52 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + return 1 + return 0 if __name__ == '__main__': + rc = 2 try: - main() + rc = main() except: # Tell the log to show the exception, then terminate the program with the exception anyway. # Since exceptions within test runs should be caught and evaluated, this is basically about # exceptions during command line parsing and such, so it's appropriate to abort immediately. log.log_exn() raise + exit(rc) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index fb6d55b..f098f2b 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index b88b8b2..166eb42 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,16 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition - try: - with self: - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() - except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() - else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + def run(self): + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +107,26 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + + if tb_str is None: + # populate an exception-less call to set_fail() with traceback info + tb_str = ''.join(traceback.format_stack()[:-1]) + + self.fail_tb = tb_str + self.err('%s: %s' % (self.fail_type, self.fail_message)) + if self.fail_tb: + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +138,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +146,19 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +171,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,27 +203,42 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') try: + log.large_separator(self.trial.name(), self.name(), sublevel=2) self.mark_start() event_loop.register_poll_func(self.poll) if not self.reserved_resources: self.reserve_resources() - for test in self.definition.tests: + for test in self.tests: if names and not test.name() in names: test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) + try: + with test: + test.run() + except Exception as e: + if hasattr(e, 'msg'): + msg = e.msg + else: + msg = str(e) + if isinstance(e, AssertionError): + # AssertionError lacks further information on what was + # asserted. Find the line where the code asserted: + msg += log.get_src_from_tb(sys.exc_info()[2]) + # add source file information to failure report + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + test.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise finally: # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit # base exception is raised. Make sure to stop processes in this @@ -261,14 +246,33 @@ self.stop_processes() self.objects_cleanup() self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..4be9c26 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,15 +79,15 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') - + self.log_report() for lt in self.log_targets: lt.remove() self.log_targets = None @@ -182,25 +182,33 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) + for suite_run in self.suites: + try: + with suite_run: + suite_run.run_tests(names) + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) report.trial_to_junit_write(self, junit_path) - return self.status def log_report(self): + log.large_separator(self.name(), self.status) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 6 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 Thu Jun 8 21:42:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 21:42:36 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/2853/5/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 222: except Exception as e: > As I said on the other patch, moving this here seems ugly, but if there's n either we have the 'with self' in test.run(), or we have the exception handling here. Moving the code is not optimal, but it unifies the way we do this across the several layers of trial, suite, test. -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 5 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 8 22:37:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 22:37:08 +0000 Subject: [PATCH] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial 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/2853 to look at the new patch set (#7). refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. State leaking across runs can be seen in http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/453/ where an earlier sms test for sysmo succeeds, but its state gets overwritten by the later sms test for trx that fails. The end result is that both tests failed, although the first run was successful. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should not do 'with' on a central object. The structure needed is, in pseudo code: try: with trial: try: with suite_run: try: with test: test_actions() The 'with' needs to be inside the 'try', so that the exception can be handled in __exit__ before it reaches the exception logging. To clarify this, like test exceptions caught in Test.run(), also move suite exception handling from Trial into SuiteRun.run_tests(). There are 'with self' in Test.run() and SuiteRun.run_tests(), which are well placed, because these are pivotal points in the main code path. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. Minor tweak: pass the return code that the program exit should return further outward, so that the exit(1) call does not cause a SystemExit exception to be logged. The aims of this patch are: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 305 insertions(+), 226 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2853/7 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..2a92f47 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,8 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) @@ -29,26 +30,17 @@ print('\n- a test with an error') results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..e481281 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,72 +157,52 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + return 1 + return 0 if __name__ == '__main__': + rc = 2 try: - main() + rc = main() except: # Tell the log to show the exception, then terminate the program with the exception anyway. # Since exceptions within test runs should be caught and evaluated, this is basically about # exceptions during command line parsing and such, so it's appropriate to abort immediately. log.log_exn() raise + exit(rc) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index fb6d55b..f098f2b 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index fb6cf36..0dd8790 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,38 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition + def run(self): try: with self: + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) if self.status == Test.UNKNOWN: self.set_pass() except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() + if hasattr(e, 'msg'): + msg = e.msg else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + msg = str(e) + if isinstance(e, AssertionError): + # AssertionError lacks further information on what was + # asserted. Find the line where the code asserted: + msg += log.get_src_from_tb(sys.exc_info()[2]) + # add source file information to failure report + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + self.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +129,26 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + + if tb_str is None: + # populate an exception-less call to set_fail() with traceback info + tb_str = ''.join(traceback.format_stack()[:-1]) + + self.fail_tb = tb_str + self.err('%s: %s' % (self.fail_type, self.fail_message)) + if self.fail_tb: + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +160,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +168,20 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.status = SuiteRun.UNKNOWN + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +194,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,27 +226,27 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') try: - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.definition.tests: - if names and not test.name() in names: - test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) - continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) + with self: + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('SUITE RUN ABORTED: %s' % type(e).__name__) + raise finally: # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit # base exception is raised. Make sure to stop processes in this @@ -261,14 +254,33 @@ self.stop_processes() self.objects_cleanup() self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..11f8a15 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,15 +79,15 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') - + self.log_report() for lt in self.log_targets: lt.remove() self.log_targets = None @@ -182,25 +182,30 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) report.trial_to_junit_write(self, junit_path) - return self.status def log_report(self): + log.large_separator(self.name(), self.status) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 7 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 Thu Jun 8 22:37:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 22:37:08 +0000 Subject: [PATCH] osmo-gsm-tester[master]: junit result: also write for aborted runs 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/2854 to look at the new patch set (#6). junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 26 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/2854/6 diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..f68f30b 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + else: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 0dd8790..da0244d 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -161,6 +161,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -174,6 +176,7 @@ self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) + self.status = SuiteRun.UNKNOWN self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 11f8a15..741f3a7 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -188,21 +188,23 @@ def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - suite_run.run_tests(names) - except BaseException as e: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) - raise - finally: - if suite_run.status != suite.SuiteRun.PASS: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) + try: + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + self.log('Storing JUnit report in', junit_path) + report.trial_to_junit_write(self, junit_path) def log_report(self): log.large_separator(self.name(), self.status) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 6 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 8 23:03:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 23:03:01 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 7: An example run of this can be found at http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/458/consoleFull -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 7 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 8 23:21:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 23:21:01 +0000 Subject: [PATCH] osmo-gsm-tester[master]: junit result: also write for aborted runs 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/2854 to look at the new patch set (#7). junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 26 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/2854/7 diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..82b2f13 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + elif test.status != suite.Test.PASS: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 0dd8790..da0244d 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -161,6 +161,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -174,6 +176,7 @@ self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) + self.status = SuiteRun.UNKNOWN self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 11f8a15..741f3a7 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -188,21 +188,23 @@ def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - suite_run.run_tests(names) - except BaseException as e: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) - raise - finally: - if suite_run.status != suite.SuiteRun.PASS: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) + try: + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + self.log('Storing JUnit report in', junit_path) + report.trial_to_junit_write(self, junit_path) def log_report(self): log.large_separator(self.name(), self.status) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 8 23:28:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 8 Jun 2017 23:28:12 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 7: > An example run of this can be found at http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/458/consoleFull that wasn't a good one, there was still a bug in the following commit #2584. This is better: http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/460/console -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 7 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:09:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:09:17 +0000 Subject: osmo-gsm-manuals[master]: BSC: Add series of message sequence charts about MGCP handling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5948677d23a58ce112b57f91bea953a93baab4c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Jun 9 08:09:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:09:21 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: BSC: Add series of message sequence charts about MGCP handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSC: Add series of message sequence charts about MGCP handling ...................................................................... BSC: Add series of message sequence charts about MGCP handling Change-Id: Id5948677d23a58ce112b57f91bea953a93baab4c --- M OsmoBSC/Makefile A OsmoBSC/aoip-mgw-options-docinfo.xml A OsmoBSC/aoip-mgw-options.adoc A OsmoBSC/mgw/classic-bsc.msc A OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc A OsmoBSC/mgw/osmo-bsc-new-mgw.msc A OsmoBSC/mgw/osmo-bsc-old-sccplite.msc 7 files changed, 353 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index e12d3e2..93c7b81 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -15,13 +15,14 @@ # htmlcss = TOPDIR := .. -ASCIIDOCS := osmobsc-usermanual osmux-reference +ASCIIDOCS := osmobsc-usermanual osmux-reference aoip-mgw-options 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 clean: -rm -rf $(cleanfiles) @@ -29,6 +30,9 @@ -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 gen-bsc-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoBSC/aoip-mgw-options-docinfo.xml b/OsmoBSC/aoip-mgw-options-docinfo.xml new file mode 100644 index 0000000..0809594 --- /dev/null +++ b/OsmoBSC/aoip-mgw-options-docinfo.xml @@ -0,0 +1,47 @@ + + + 0.1 + 31 May 2017 + Harald Welte + + Initial version of the proposal for internal discussion. + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 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/OsmoBSC/aoip-mgw-options.adoc b/OsmoBSC/aoip-mgw-options.adoc new file mode 100644 index 0000000..8ce3b91 --- /dev/null +++ b/OsmoBSC/aoip-mgw-options.adoc @@ -0,0 +1,77 @@ += OsmoBSC A / SCCPlite / 3GPP AoIP Options + +== Introduction + +This document serves as a paper to illustrate the different +configurations of OsmoBSC in terms of integration with BTSs and MSCs. + +The document should accompany us in the 2017 development cycle which +includes the _death of the NITB_, i.e. the move away from OsmoNITB to +having OsmoBSC in all configurations, whether with a +proprietary/external MSC or with OsmoMSC. + +Particular attention is spent on the user plane, including aspects +such as + +* user plane transport address handling +* use of MGCP (Media Gateway Control Protocol) +* the (required) evolution of `osmo-bsc_mgcp` +* not loosing classic TDM (E1/T1) BTS support when moving from + OsmoNITB to split OsmoBSC + OsmoMSC setup + + +== Overview + +=== Classic GSM RAN with E1 based Abis and E1 A + +This configuration was actually never supported by OpenBSC, as E1 BTS +support was so far for NITB only, but not for OsmoBSC. + +[mscgen] +---- +include::mgw/classic-bsc.msc[] +---- + +=== OsmoBSC 2010-2017: IPA-style A over SCCPlite + +This configuration was introduced as early as 2010 in OpenBSC. It +allowed the use of IP based BTSs (ip.access nanoBTS as well as all the +OsmoBTS supported BTS models) in combination with third-party MSCs +implementing a pre-standard, proprietary way of transporting the A +interface over IP at a time where the 3GPP specifications only allowed +classic TDM transport. + +[mscgen] +---- +include::mgw/osmo-bsc-old-sccplite.msc[] +---- + + +=== OsmoBSC 2017+: 3GPP AoIP + Abis/IP + +Release 7 of 3GPP included an official specification on how an +interoperable A-over-IP (AoIP) interface shall look like. + +As more modern MSCs at operators tend to favor implementing 3GPP AoIP +rather than the proprietary SCCPlite based A interface, it becomes +neccessary for OsmoBSC to support this. + +At the same time, for compatibility reasons, the classic SCCPlite +support shall be kept, if possible with reasonable effort. + +[mscgen] +---- +include::mgw/osmo-bsc-new-mgw.msc[] +---- + + +=== OsmoBSC 2017+: 3GPP AoIP + Abis/E1 + +Since OsmoNITB will soon be deprecated, we will use OsmoBSC in all +Osmocom GSM ntework setups, requiring the support for classic E1/T1 +based BTSs from OsmoBSC. + +[mscgen] +---- +include::mgw/osmo-bsc-new-mgw-e1.msc[] +---- diff --git a/OsmoBSC/mgw/classic-bsc.msc b/OsmoBSC/mgw/classic-bsc.msc new file mode 100644 index 0000000..56d2889 --- /dev/null +++ b/OsmoBSC/mgw/classic-bsc.msc @@ -0,0 +1,39 @@ +# MO Call on a classic E1 Abis BTS with classic E1 A BSC +# not actually supported by OsmoBSC (nor planned), for refrence only +msc { + hscale=2; + ms [label="MS"], bts [label="E1 BTS"], bsc[label="OsmoBSC"], trau[label="TRAU"], m_sc[label="MSC"]; + + ms box m_sc [label="We assume a SDCCH is already established"]; + ...; + + ms -> m_sc [label="DTAP CC SETUP"]; + ms <- m_sc [label="DTAP CC CALL PROCEEDING"]; + + bsc <- m_sc [label="BSSAP ASSGN REQ"]; + bsc box m_sc [label="E1 TS for PCM specified by CIC"]; + bts <- bsc [label="RSL CHAN ACT"]; + bts -> bsc [label="RSL CHAN ACT ACK"]; + bts box bsc [label="E1 TS + 16k sub-slot configured for given lchan"]; + ms <-> bsc [label="Assignment"]; + bsc -> m_sc [label="BSSAP ASSGN CMPL"]; + + ...; + trau <- m_sc [label="PCM Audio in full E1 slot"]; + bts <- trau [label="A-bis TRAU frames on 16k sub-slot"]; + + ...; + ms <- m_sc [label="DTAP CC CONNECT"]; + ms -> m_sc [label="DTAP CC CONNECT ACK"]; + trau <-> m_sc [label="PCM Audio in full E1 slot"]; + bts <-> trau [label="A-bis TRAU frames on 16k sub-slot"]; + --- [label="Voice Call in Progress"]; + ms <- m_sc [label="DTAP CC DISCONNET"]; + ms <- m_sc [label="DTAP CC RELEASE"]; + ms <- m_sc [label="DTAP CC RELEASE COMPL"]; + ...; + bsc <- m_sc [label="BSSMAP CLEAR CMD"]; + bsc -> m_sc [label="BSSMAP CLEAR COMPL"]; + bsc <- m_sc [label="SCCP RLSD"]; + bsc -> m_sc [label="SCCP RLC"]; +} diff --git a/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc b/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc new file mode 100644 index 0000000..7912a73 --- /dev/null +++ b/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc @@ -0,0 +1,50 @@ +# MO-Call with E1 BTS + OsmoBSC with true 3GPP AoIP (planned +# osmo-bsc_mgcp has to be extended to true MGW functionality! +msc { + hscale=2; + ms [label="MS"], bts [label="E1 BTS"], bsc[label="OsmoBSC"], mgcp[label="osmo-bsc_mgcp"], m_sc[label="MSC"]; + + ms box m_sc [label="We assume a SDCCH is already established"]; + ...; + + ms -> m_sc [label="DTAP CC SETUP"]; + ms <- m_sc [label="DTAP CC CALL PROCEEDING"]; + + m_sc box m_sc [label="Bind arbitrary local port (4000)"]; + bsc <- m_sc [label="BSSAP ASSGN REQ (3GPP AoIP MSC:4000)"]; + bts <- bsc [label="RSL CHAN ACT"]; + bts -> bsc [label="RSL CHAN ACT ACK"]; + ms <-> bsc [label="Assignment"]; + ...; + + mgcp <- bsc [label="MGCP CRCX ts1/ss2 at abis (MSC:4000)"]; + mgcp box mgcp [label="Bind to MGW-local RTP Port (3000)\nConnect to MSC:4000"]; + mgcp -> bsc [label="MGCP CRCX ts1/ss2 at a OK (MGW:3000)"]; + ...; + + bsc -> m_sc [label="BSSAP ASSGN CMPL (3GPP AoIP MGW:3000)"]; + m_sc box m_sc [label="Connect remote RTP to MGW addr from ASSGN CMPL"]; + ...; + + mgcp <=> m_sc [label="RTP Audio MGW:3000 MSC:4000"]; + bts <=> mgcp [label="TRAU Frame Audio (E1 TS1 SS2)"]; + ms <=> bts [label="Um Audio (bidirectional)"]; + ms <-> m_sc [label="DTAP CC ALERTING"]; + ...; + + ms <- m_sc [label="DTAP CC CONNECT"]; + ms -> m_sc [label="DTAP CC CONNECT ACK"]; + --- [label="Voice Call in Progress"]; + ms <- m_sc [label="DTAP CC DISCONNET"]; + ms <- m_sc [label="DTAP CC RELEASE"]; + ms <- m_sc [label="DTAP CC RELEASE COMPL"]; + ...; + bsc <- m_sc [label="BSSMAP CLEAR CMD"]; + bsc -> m_sc [label="BSSMAP CLEAR COMPL"]; + bsc <- m_sc [label="SCCP RLSD"]; + bsc -> m_sc [label="SCCP RLC"]; + ...; + mgcp <- bsc [label="MGCP DLCX ts1/ss2 at a"]; + mgcp box mgcp [label="Release MSC-facing local RTP port (3000)"]; + mgcp -> bsc [label="MGCP DLCX ts1/ss2 at a OK"]; +} diff --git a/OsmoBSC/mgw/osmo-bsc-new-mgw.msc b/OsmoBSC/mgw/osmo-bsc-new-mgw.msc new file mode 100644 index 0000000..2bab84d --- /dev/null +++ b/OsmoBSC/mgw/osmo-bsc-new-mgw.msc @@ -0,0 +1,71 @@ +# MO-Call with OsmoBTS + OsmoBSC with true 3GPP AoIP (planned) +msc { + hscale=2; + ms [label="MS"], bts [label="OsmoBTS"], bsc[label="OsmoBSC"], mgcp[label="osmo-bsc_mgcp"], m_sc[label="MSC"]; + + ms box m_sc [label="We assume a SDCCH is already established"]; + ...; + + ms -> m_sc [label="DTAP CC SETUP"]; + ms <- m_sc [label="DTAP CC CALL PROCEEDING"]; + + m_sc box m_sc [label="Bind arbitrary local port (4000)"]; + bsc <- m_sc [label="BSSAP ASSGN REQ (3GPP AoIP MSC:4000)"]; + bts <- bsc [label="RSL CHAN ACT"]; + bts -> bsc [label="RSL CHAN ACT ACK"]; + ms <-> bsc [label="Assignment"]; + ...; + + # connect BTS RTP with BSC-MGW RTP + bts <- bsc [label="IPA CRCX"]; + bts box bts [label="Bind to BTS-local RTP Port (1000)"]; + bts -> bsc [label="IPA CRCX ACK (BTS:1000)"]; + bsc -> mgcp [label="MGCP CRCX 2 at abis (BTS:1000)"]; + mgcp box mgcp [label="Bind to MGW-local RTP Port (2000)\nConnect to BTS:1000"]; + bsc <- mgcp [label="MGCP CRCX 2 at abis OK (MGW:2000)"]; + bts <- bsc [label="IPA MDCX 2 at abis (MGW:2000)"]; + bts box bts [label="Connect RTP socket to remote (MGW) RTP Port"]; + bts -> bsc [label="IPA MDCX 2 at abis ACK"]; + #bsc -> mgcp [label="MGCP MDCX 2 at abis (optional)"]; + #bsc <- mgcp [label="MGCP MDCX 2 at abis OK (optional)"]; + ...; + + mgcp <- bsc [label="MGCP CRCX 1 at a (MSC:4000)"]; + mgcp box mgcp [label="Bind to MGW-local RTP Port (3000)\nConnect to MSC:4000"]; + mgcp -> bsc [label="MGCP CRCX 1 at a OK (MGW:3000)"]; + ...; + + bsc -> m_sc [label="BSSAP ASSGN CMPL (3GPP AoIP MGW:3000)"]; + m_sc box m_sc [label="Connect remote RTP to MGW addr from ASSGN CMPL"]; + ...; + + mgcp <=> m_sc [label="RTP Audio MGW:3000 MSC:4000"]; + bts <=> mgcp [label="RTP Audio BTS:1000 MGW:2000"]; + ms <=> bts [label="Um Audio (bidirectional)"]; + ms <-> m_sc [label="DTAP CC ALERTING"]; + ...; + + ms <- m_sc [label="DTAP CC CONNECT"]; + ms -> m_sc [label="DTAP CC CONNECT ACK"]; + --- [label="Voice Call in Progress"]; + ms <- m_sc [label="DTAP CC DISCONNET"]; + ms <- m_sc [label="DTAP CC RELEASE"]; + ms <- m_sc [label="DTAP CC RELEASE COMPL"]; + ...; + bsc <- m_sc [label="BSSMAP CLEAR CMD"]; + bsc -> m_sc [label="BSSMAP CLEAR COMPL"]; + bsc <- m_sc [label="SCCP RLSD"]; + bsc -> m_sc [label="SCCP RLC"]; + ...; + mgcp <- bsc [label="MGCP DLCX 1 at a"]; + mgcp box mgcp [label="Release MSC-facing local RTP port (3000)"]; + mgcp -> bsc [label="MGCP DLCX 1 at a OK"]; + + bsc -> mgcp [label="MGCP DLCX 2 at abis"]; + mgcp box mgcp [label="Release BTS-facing local RTP port (2000)"]; + bsc <- mgcp [label="MGCP DLCX 2 at abis OK"]; + + bts <- bsc [label="IPA DLCX"]; + bts box bts [label="Release BTS-local RTP port (1000)"]; + bts -> bsc [label="IPA DLCX OK"]; +} diff --git a/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc b/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc new file mode 100644 index 0000000..f7298bf --- /dev/null +++ b/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc @@ -0,0 +1,64 @@ +# MO-Call with OsmoBTS + OsmoBSC using A/IP with IPA/SCCPlite +# Supported since 2010 using osmo-bsc + osmo-bsc_nat +msc { + hscale=2; + ms [label="MS"], bts [label="OsmoBTS"], bsc[label="OsmoBSC"], mgcp[label="osmo-bsc_mgcp"], m_sc[label="MSC"]; + + ms box m_sc [label="We assume a SDCCH is already established"]; + ...; + + ms -> m_sc [label="DTAP CC SETUP"]; + ms <- m_sc [label="DTAP CC CALL PROCEEDING"]; + + bsc <- m_sc [label="BSSAP ASSGN REQ"]; + bts <- bsc [label="RSL CHAN ACT"]; + bts -> bsc [label="RSL CHAN ACT ACK"]; + ms <-> bsc [label="Assignment"]; + bsc -> m_sc [label="BSSAP ASSGN CMPL"]; + + ...; + bts <- bsc [label="IPA CRCX"]; + bts box bts [label="Bind to BSC-local RTP Port"]; + bts -> bsc [label="IPA CRCX ACK"]; + bts <- bsc [label="IPA MDCX"]; + bts box bts [label="Connect RTP socket to remote (bsc_mgcp) RTP Port"]; + bts -> bsc [label="IPA MDCX ACK"]; + + mgcp <- m_sc [label="MGCP CRCX"]; + mgcp box mgcp [label="Bind to BTS-local RTP Port"]; + mgcp -> m_sc [label="MGCP CRCX OK"]; + mgcp <- m_sc [label="MGCP MDCX (recvonly) "]; + mgcp box mgcp [label="Connect RTP socket to remote (MSC) RTP Port"]; + mgcp -> m_sc [label="MGCP MDCX OK"]; + mgcp <= m_sc [label="RTP Audio"]; + bts <= mgcp [label="RTP Audio"]; + ms <= bts [label="Um Audio (unidirectional)"]; + ms <- m_sc [label="DTAP CC ALERTING"]; + + ...; + mgcp <- m_sc [label="MGCP MDCX (sndrecv) "]; + mgcp box mgcp [label="Switch to bi-directional audio"]; + mgcp -> m_sc [label="MGCP MDCX OK"]; + mgcp <=> m_sc [label="RTP Audio"]; + bts <=> mgcp [label="RTP Audio"]; + ms <=> bts [label="Um Audio (bidirectional)"]; + ...; + ms <- m_sc [label="DTAP CC CONNECT"]; + ms -> m_sc [label="DTAP CC CONNECT ACK"]; + mgcp <- m_sc [label="MGCP MDCX (sndrecv) "]; + mgcp box mgcp [label="Why?"]; + mgcp -> m_sc [label="MGCP MDCX OK"]; + --- [label="Voice Call in Progress"]; + ms <- m_sc [label="DTAP CC DISCONNET"]; + ms <- m_sc [label="DTAP CC RELEASE"]; + ms <- m_sc [label="DTAP CC RELEASE COMPL"]; + ...; + bsc <- m_sc [label="BSSMAP CLEAR CMD"]; + bsc -> m_sc [label="BSSMAP CLEAR COMPL"]; + bsc <- m_sc [label="SCCP RLSD"]; + bsc -> m_sc [label="SCCP RLC"]; + ...; + mgcp <- m_sc [label="MGCP DLCX"]; + mgcp box mgcp [label="Release local RTP port"]; + mgcp -> m_sc [label="MGCP DLCX OK"]; +} -- To view, visit https://gerrit.osmocom.org/2816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5948677d23a58ce112b57f91bea953a93baab4c Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:12:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 08:12:17 +0000 Subject: libosmo-netif[master]: src: use osmo_timer_setup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:12:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 08:12:57 +0000 Subject: libosmo-abis[master]: src: use osmo_timer_setup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4ca4950e49a09c63b608b13ac7561ebbd351889a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:13:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:13:34 +0000 Subject: libosmocore[master]: introduce proper test case for GSM FR detection In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I710c7871f959671deb3d18ab9062588f3056fd7c Gerrit-PatchSet: 3 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 Fri Jun 9 08:14:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:14:01 +0000 Subject: [MERGED] libosmocore[master]: introduce proper test case for GSM FR detection In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: introduce proper test case for GSM FR detection ...................................................................... introduce proper test case for GSM FR detection our code is actually wrong, so let's skip the test until the fix is applied in a follow-up patch. Change-Id: I710c7871f959671deb3d18ab9062588f3056fd7c --- M tests/codec/codec_test.c M tests/testsuite.at 2 files changed, 98 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/codec/codec_test.c b/tests/codec/codec_test.c index f944f38..b204d77 100644 --- a/tests/codec/codec_test.c +++ b/tests/codec/codec_test.c @@ -94,6 +94,100 @@ hr ? osmo_hr_check_sid(t, len) : osmo_fr_check_sid(t, len)); } +const uint8_t fr_sid1[33] = { 0xd7, 0xe0, 0xa3, 0x61, 0x2c, 0x00, 0x00, + 0x80, 0x49, 0x00, 0x00, 0x49, 0x00, 0x00, 0x80, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x12, 0x40, 0x00, 0x10, 0x08, 0x00, + 0x00, 0x00, 0x08, 0x2d, 0x04, 0x09 }; + +const uint8_t fr_sid2[33] = { 0xd7, 0xa2, 0xbb, 0x65, 0xe5, 0x00, 0x00, + 0x10, 0x00, 0x04, 0x82, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, + 0x02, 0x41, 0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x01, 0x00, + 0x00, 0x00, 0x42, 0x40, 0x10, 0xd2 }; + +const uint8_t fr_sid3[33] = { 0xd9, 0x60, 0xab, 0x21, 0xea, 0x00, 0x00, + 0x80, 0x48, 0x20, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x80, 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, 0x10, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x08 }; + +const uint8_t fr_sid4[33] = { 0xd8, 0x21, 0xab, 0x25, 0xea, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x02, 0x41, 0x00, + 0x02, 0x48, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x42, 0x00, 0x02, 0x50 }; + +const uint8_t fr_sid5[33] = { 0xd9, 0x61, 0x9a, 0x65, 0x60, 0x00, 0x00, + 0x10, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x00, 0x02, 0x40, 0x82, 0x52 }; + +const uint8_t fr_sid6[33] = { 0xd9, 0xa5, 0x93, 0xe1, 0xa0, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x09, 0x00, + 0x02, 0x40, 0x00, 0x00, 0x00, 0x01, 0x20, 0x80, 0x01, 0x00, + 0x00, 0x90, 0x02, 0x40, 0x02, 0x02 }; + +const uint8_t fr_sid7[33] = { 0xd8, 0x20, 0xa3, 0xe5, 0xaa, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x00, 0x04, + 0x80, 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, 0x12, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x09 }; + +const uint8_t fr_sid8[33] = { 0xd7, 0xe0, 0xa3, 0xa1, 0x60, 0x00, 0x00, + 0x10, 0x00, 0x04, 0x92, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x12, 0x00, 0x40, 0x12, 0x00 }; + +const uint8_t fr_sid9[33] = { 0xd8, 0x20, 0xa3, 0xa5, 0x62, 0x00, 0x00, + 0x10, 0x00, 0x04, 0x82, 0x00, 0x00, 0x00, 0x02, 0x49, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x02, 0x00, 0x82, 0x02 }; + +const uint8_t fr_sid10[33] = { 0xd4, 0xaa, 0xba, 0x6e, 0xbb, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x10, 0x00, 0x20, + 0x90, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x08, 0x00, + 0x00, 0x00, 0x08, 0x2c, 0x20, 0x00 }; + +const uint8_t fr_sid11[33] = { 0xd9, 0x64, 0xbb, 0x6d, 0x62, 0x00, 0x00, + 0x80, 0x41, 0x00, 0x00, 0x48, 0x00, 0x00, 0x10, 0x00, 0x04, + 0x90, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2c, 0x24, 0x01 }; + +const uint8_t fr_sid12[33] = { 0xd8, 0x61, 0xb2, 0xa5, 0x62, 0x00, 0x00, + 0x00, 0x41, 0x20, 0x00, 0x48, 0x00, 0x00, 0x10, 0x00, 0x04, + 0x90, 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x01, 0x29, 0x24, 0x08 }; + +const uint8_t fr_sid13[33] = { 0xd9, 0x23, 0xba, 0xe5, 0xe2, 0x00, 0x00, + 0x80, 0x41, 0x20, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x09, 0x05, 0x20, 0x00 }; + +const uint8_t fr_sid14[33] = { 0xd8, 0x62, 0xa2, 0x61, 0x60, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x80, 0x00, 0x40, 0x02, 0x40 }; + +const uint8_t fr_sid15[33] = { 0xd9, 0xe4, 0xc3, 0x6d, 0x12, 0x00, 0x00, + 0x80, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x48, 0x00, 0x10, 0x48, 0x00, + 0x00, 0x00, 0x00, 0x2d, 0x04, 0x00 }; + +const uint8_t fr_sid16[33] = { 0xd9, 0xa4, 0xc3, 0x29, 0x59, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x42, 0x00, 0x12, 0x02 }; + +static const uint8_t *fr_sids[] = { fr_sid1, fr_sid2, fr_sid3, fr_sid4, + fr_sid5, fr_sid6, fr_sid7, fr_sid8, fr_sid9, fr_sid10, fr_sid11, + fr_sid12, fr_sid13, fr_sid14, fr_sid15, fr_sid16 }; + +static void test_sid_fr(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(fr_sids); i++) { + int rc = osmo_fr_check_sid(fr_sids[i], 33); + printf("FR SID %s: %d\n", osmo_hexdump(fr_sids[i], 33), rc); + } +} + int main(int argc, char **argv) { printf("AMR RTP payload decoder test:\n"); @@ -114,6 +208,9 @@ test_sid_xr(sid_hr, 14, true); test_sid_xr(hr, 14, true); + printf("FR RTP payload SID test:\n"); + test_sid_fr(); + return 0; } diff --git a/tests/testsuite.at b/tests/testsuite.at index 63027d9..aa943e8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -147,6 +147,7 @@ AT_SETUP([codec]) AT_KEYWORDS([codec]) +AT_CHECK([exit 77]) cat $abs_srcdir/codec/codec_test.ok > expout AT_CHECK([$abs_top_builddir/tests/codec/codec_test], [0], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/2802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I710c7871f959671deb3d18ab9062588f3056fd7c Gerrit-PatchSet: 3 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 Fri Jun 9 08:17:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:17:28 +0000 Subject: [MERGED] libosmocore[master]: Fix wrongful GSM FR codec SID frame detection in DTX. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix wrongful GSM FR codec SID frame detection in DTX. ...................................................................... Fix wrongful GSM FR codec SID frame detection in DTX. Based on ETSI TS 101 318 section 5.1.2 the 95 bits SID code word is not detected correctly due to a wrongful offset in the bits location indexes. Change-Id: I45d98c6edf267f313883503a65385190ffbc65ca --- M src/codec/gsm610.c M tests/codec/codec_test.ok M tests/testsuite.at 3 files changed, 27 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/codec/gsm610.c b/src/codec/gsm610.c index 47faea2..165484d 100644 --- a/src/codec/gsm610.c +++ b/src/codec/gsm610.c @@ -306,16 +306,16 @@ bool osmo_fr_check_sid(uint8_t *rtp_payload, size_t payload_len) { struct bitvec bv; - uint16_t i, z_bits[] = { 59, 60, 62, 63, 65, 66, 68, 69, 71, 72, 74, 75, - 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 92, 93, - 95, 96, 115, 116, 118, 119, 121, 122, 124, 125, - 127, 128, 130, 131, 133, 134, 136, 137, 139, - 140, 142, 143, 145, 146, 148, 149, 151, 152, - 171, 172, 174, 175, 177, 178, 180, 181, 183, - 184, 186, 187, 189, 190, 192, 193, 195, 196, - 198, 199, 201, 202, 204, 205, 207, 208, 227, - 228, 230, 231, 233, 234, 236, 237, 239, 242, - 245, 248, 251, 254, 257, 260, 263 }; + uint16_t i, z_bits[] = { 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73, + 75, 76, 78, 79, 81, 82, 84, 85, 87, 88, 90, 91, + 93, 94, 113, 114, 116, 117, 119, 120, 122, 123, + 125, 126, 128, 129, 131, 132, 134, 135, 137, + 138, 140, 141, 143, 144, 146, 147, 149, 150, + 169, 170, 172, 173, 175, 176, 178, 179, 181, + 182, 184, 185, 187, 188, 190, 191, 193, 194, + 196, 197, 199, 200, 202, 203, 205, 206, 225, + 226, 228, 229, 231, 232, 234, 235, 237, 240, + 243, 246, 249, 252, 255, 258, 261 }; /* signature does not match Full Rate SID */ if ((rtp_payload[0] >> 4) != 0xD) diff --git a/tests/codec/codec_test.ok b/tests/codec/codec_test.ok index 80c4a09..5307023 100644 --- a/tests/codec/codec_test.ok +++ b/tests/codec/codec_test.ok @@ -13,3 +13,20 @@ HR RTP payload SID test: HR SID ? 03 8e b6 cb ff ff ff ff ff ff ff ff ff ff :: 1 HR SID ? 06 46 76 b1 8e 48 9a 2f 5e 4c 22 2b 62 25 :: 0 +FR RTP payload SID test: +FR SID d7 e0 a3 61 2c 00 00 80 49 00 00 49 00 00 80 00 04 00 00 00 00 12 40 00 10 08 00 00 00 08 2d 04 09 : 1 +FR SID d7 a2 bb 65 e5 00 00 10 00 04 82 00 00 00 00 49 00 02 41 00 00 00 00 20 80 01 00 00 00 42 40 10 d2 : 1 +FR SID d9 60 ab 21 ea 00 00 80 48 20 00 09 00 00 00 00 24 80 00 00 00 10 08 00 10 08 00 00 00 00 01 00 08 : 1 +FR SID d8 21 ab 25 ea 00 00 00 00 04 10 00 00 00 02 41 00 02 48 00 00 00 01 20 00 00 00 00 00 42 00 02 50 : 1 +FR SID d9 61 9a 65 60 00 00 10 00 04 02 00 00 00 02 00 00 00 40 00 00 00 00 00 80 01 00 00 00 02 40 82 52 : 1 +FR SID d9 a5 93 e1 a0 00 00 10 00 00 02 00 00 00 02 09 00 02 40 00 00 00 01 20 80 01 00 00 90 02 40 02 02 : 1 +FR SID d8 20 a3 e5 aa 00 00 80 00 00 00 08 00 00 80 00 04 80 00 00 00 10 08 00 12 08 00 00 00 00 08 00 09 : 1 +FR SID d7 e0 a3 a1 60 00 00 10 00 04 92 00 00 00 00 40 00 00 40 00 00 00 01 00 00 00 00 00 12 00 40 12 00 : 1 +FR SID d8 20 a3 a5 62 00 00 10 00 04 82 00 00 00 02 49 00 00 00 00 00 80 00 24 00 00 00 00 10 02 00 82 02 : 1 +FR SID d4 aa ba 6e bb 00 00 00 00 00 00 40 00 00 10 00 20 90 00 00 00 00 08 00 02 08 00 00 00 08 2c 20 00 : 1 +FR SID d9 64 bb 6d 62 00 00 80 41 00 00 48 00 00 10 00 04 90 00 00 00 00 08 00 00 00 00 00 00 00 2c 24 01 : 1 +FR SID d8 61 b2 a5 62 00 00 00 41 20 00 48 00 00 10 00 04 90 00 00 00 10 08 00 10 40 00 00 00 01 29 24 08 : 1 +FR SID d9 23 ba e5 e2 00 00 80 41 20 00 01 00 00 10 00 04 00 00 00 00 00 48 00 00 00 00 00 00 09 05 20 00 : 1 +FR SID d8 62 a2 61 60 00 00 10 00 00 92 00 00 00 00 40 00 00 08 00 00 00 01 00 00 01 00 00 80 00 40 02 40 : 1 +FR SID d9 e4 c3 6d 12 00 00 80 00 20 00 40 00 00 00 00 00 10 00 00 00 10 48 00 10 48 00 00 00 00 2d 04 00 : 1 +FR SID d9 a4 c3 29 59 00 00 10 00 00 12 00 00 00 00 41 00 00 01 00 00 00 01 00 80 00 00 00 00 42 00 12 02 : 1 diff --git a/tests/testsuite.at b/tests/testsuite.at index aa943e8..63027d9 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -147,7 +147,6 @@ AT_SETUP([codec]) AT_KEYWORDS([codec]) -AT_CHECK([exit 77]) cat $abs_srcdir/codec/codec_test.ok > expout AT_CHECK([$abs_top_builddir/tests/codec/codec_test], [0], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/2441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I45d98c6edf267f313883503a65385190ffbc65ca Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: jfdionne Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: jfdionne From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:35:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 9 Jun 2017 08:35:52 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2852/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 483: msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) > exactly, this is correct. I could check for used_count == len(), but my per Ok thanks for clarifying :) -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:36:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 9 Jun 2017 08:36:51 +0000 Subject: osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 Gerrit-PatchSet: 4 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:46:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 9 Jun 2017 08:46:42 +0000 Subject: osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (1 comment) You can merge once you push a new version removing the line I pointed in the comment. https://gerrit.osmocom.org/#/c/2854/7/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 179: self.status = SuiteRun.UNKNOWN This is already set two lines below, no need for this line. -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:48:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:48:14 +0000 Subject: [MERGED] libosmocore[master]: osmo_{fr, hr}_check_sid(): Use const input argument In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_{fr,hr}_check_sid(): Use const input argument ...................................................................... osmo_{fr,hr}_check_sid(): Use const input argument Change-Id: If779cce63f06a18d4f3b0cb3d6dd7a99aa52a646 --- M include/osmocom/codec/codec.h M src/codec/gsm610.c M src/codec/gsm620.c 3 files changed, 6 insertions(+), 6 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/osmocom/codec/codec.h b/include/osmocom/codec/codec.h index fb127b5..05da911 100644 --- a/include/osmocom/codec/codec.h +++ b/include/osmocom/codec/codec.h @@ -63,8 +63,8 @@ } } -bool osmo_fr_check_sid(uint8_t *rtp_payload, size_t payload_len); -bool osmo_hr_check_sid(uint8_t *rtp_payload, size_t payload_len); +bool osmo_fr_check_sid(const uint8_t *rtp_payload, size_t payload_len); +bool osmo_hr_check_sid(const uint8_t *rtp_payload, size_t payload_len); int osmo_amr_rtp_enc(uint8_t *payload, uint8_t cmr, enum osmo_amr_type ft, enum osmo_amr_quality bfi); int osmo_amr_rtp_dec(const uint8_t *payload, int payload_len, uint8_t *cmr, diff --git a/src/codec/gsm610.c b/src/codec/gsm610.c index 165484d..3346ffc 100644 --- a/src/codec/gsm610.c +++ b/src/codec/gsm610.c @@ -303,7 +303,7 @@ * \param[in] payload_len Length of payload * \returns true if code word is found, false otherwise */ -bool osmo_fr_check_sid(uint8_t *rtp_payload, size_t payload_len) +bool osmo_fr_check_sid(const uint8_t *rtp_payload, size_t payload_len) { struct bitvec bv; uint16_t i, z_bits[] = { 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73, @@ -321,7 +321,7 @@ if ((rtp_payload[0] >> 4) != 0xD) return false; - bv.data = rtp_payload; + bv.data = (uint8_t *) rtp_payload; bv.data_len = payload_len; /* code word is all 0 at given bits, numbered from 1 */ diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c index 6f1a95b..29ae4f5 100644 --- a/src/codec/gsm620.c +++ b/src/codec/gsm620.c @@ -277,11 +277,11 @@ * \param[in] payload_len Length of payload * \returns true if code word is found, false otherwise */ -bool osmo_hr_check_sid(uint8_t *rtp_payload, size_t payload_len) +bool osmo_hr_check_sid(const uint8_t *rtp_payload, size_t payload_len) { uint8_t i, bits[] = { 1, 2, 8, 9, 5, 4, 9, 5, 4, 9, 5, 4, 9, 5 }; struct bitvec bv; - bv.data = rtp_payload; + bv.data = (uint8_t *) rtp_payload; bv.data_len = payload_len; bv.cur_bit = 33; -- To view, visit https://gerrit.osmocom.org/2803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If779cce63f06a18d4f3b0cb3d6dd7a99aa52a646 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 Fri Jun 9 08:48:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:48:53 +0000 Subject: libosmocore[master]: Update L3 protocol discriminator definitions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia699d3494b93b7f88c36338e4960b35c42a29b9c 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 Jun 9 08:49:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:49:13 +0000 Subject: [MERGED] libosmocore[master]: Update L3 protocol discriminator definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update L3 protocol discriminator definitions ...................................................................... Update L3 protocol discriminator definitions Change-Id: Ia699d3494b93b7f88c36338e4960b35c42a29b9c --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 3f0ce64..124f8b7 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -909,12 +909,13 @@ uint8_t rr_cause; } __attribute__((packed)); -/* Section 10.2 + GSM 04.07 12.2.3.1.1 */ +/* Section 10.2 + GSM 04.07 12.2.3.1.1 + 3GPP TS 24.007 11.2.3.1.1 */ #define GSM48_PDISC_GROUP_CC 0x00 #define GSM48_PDISC_BCAST_CC 0x01 -#define GSM48_PDISC_PDSS1 0x02 +#define GSM48_PDISC_PDSS1 0x02 /* 04.07 only */ #define GSM48_PDISC_CC 0x03 -#define GSM48_PDISC_PDSS2 0x04 +#define GSM48_PDISC_PDSS2 0x04 /* 04.07 only */ +#define GSM48_PDISC_GTTP 0x04 /* 24.007 only */ #define GSM48_PDISC_MM 0x05 #define GSM48_PDISC_RR 0x06 #define GSM48_PDISC_MM_GPRS 0x08 @@ -923,6 +924,7 @@ #define GSM48_PDISC_NC_SS 0x0b #define GSM48_PDISC_LOC 0x0c #define GSM48_PDISC_EXTEND 0x0e +#define GSM48_PDISC_TEST 0x0f /* as per 11.10, 04.14 */ #define GSM48_PDISC_MASK 0x0f #define GSM48_PDISC_USSD 0x11 -- To view, visit https://gerrit.osmocom.org/2787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia699d3494b93b7f88c36338e4960b35c42a29b9c 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 Fri Jun 9 08:49:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:49:37 +0000 Subject: [MERGED] openbsc[master]: don't re-implement osmo_talloc_replace_string() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: don't re-implement osmo_talloc_replace_string() ...................................................................... don't re-implement osmo_talloc_replace_string() osmo_talloc_replace_string() was introducd into libosmocore in 2014, see commit f3c7e85d05f7b2b7bf093162b776f71b2bc6420d There's no reason for us to re-implement this as bsc_replace_string here. Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602 --- M openbsc/include/openbsc/vty.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libcommon-cs/common_cs_vty.c M openbsc/src/libcommon/common_vty.c M openbsc/src/libmgcp/mgcp_vty.c M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/src/osmo-bsc/osmo_bsc_vty.c M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c M openbsc/src/osmo-bsc_nat/bsc_nat_utils.c M openbsc/src/osmo-bsc_nat/bsc_nat_vty.c M openbsc/tests/mgcp/mgcp_test.c 11 files changed, 42 insertions(+), 51 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index f79eab5..60b7d2d 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -41,7 +41,6 @@ }; extern int bsc_vty_is_config_node(struct vty *vty, int node); -extern void bsc_replace_string(void *ctx, char **dst, const char *newstr); struct log_info; int bsc_vty_init(struct gsm_network *network); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0ee2390..b05d3d9 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -2946,7 +2946,7 @@ struct gsm_bts *bts = vty->index; int rc; - bsc_replace_string(bts, &bts->pcu_sock_path, argv[0]); + osmo_talloc_replace_string(bts, &bts->pcu_sock_path, argv[0]); pcu_sock_exit(bts); rc = pcu_sock_init(bts->pcu_sock_path, bts); if (rc < 0) { diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c index 76336a1..bcc001d 100644 --- a/openbsc/src/libcommon-cs/common_cs_vty.c +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -88,7 +88,7 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - bsc_replace_string(gsmnet, &gsmnet->name_short, argv[0]); + osmo_talloc_replace_string(gsmnet, &gsmnet->name_short, argv[0]); return CMD_SUCCESS; } @@ -99,7 +99,7 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - bsc_replace_string(gsmnet, &gsmnet->name_long, argv[0]); + osmo_talloc_replace_string(gsmnet, &gsmnet->name_long, argv[0]); return CMD_SUCCESS; } diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index 834da51..6e1c10b 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -143,11 +143,3 @@ return 1; } } - -/* a talloc string replace routine */ -void bsc_replace_string(void *ctx, char **dst, const char *newstr) -{ - if (*dst) - talloc_free(*dst); - *dst = talloc_strdup(ctx, newstr); -} diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c index 13f66c5..7d4b2da 100644 --- a/openbsc/src/libmgcp/mgcp_vty.c +++ b/openbsc/src/libmgcp/mgcp_vty.c @@ -261,7 +261,7 @@ IP_STR "IPv4 Address to use in SDP record\n") { - bsc_replace_string(g_cfg, &g_cfg->local_ip, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->local_ip, argv[0]); return CMD_SUCCESS; } @@ -272,7 +272,7 @@ IP_STR "IPv4 Address of the BTS\n") { - bsc_replace_string(g_cfg, &g_cfg->bts_ip, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->bts_ip, argv[0]); inet_aton(g_cfg->bts_ip, &g_cfg->bts_in); return CMD_SUCCESS; } @@ -285,7 +285,7 @@ IP_STR "IPv4 Address to bind to\n") { - bsc_replace_string(g_cfg, &g_cfg->source_addr, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->source_addr, argv[0]); return CMD_SUCCESS; } @@ -403,7 +403,7 @@ "rtp bts-bind-ip A.B.C.D", RTP_STR "Bind endpoints facing the BTS\n" "Address to bind to\n") { - bsc_replace_string(g_cfg, &g_cfg->bts_ports.bind_addr, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->bts_ports.bind_addr, argv[0]); return CMD_SUCCESS; } @@ -422,7 +422,7 @@ "rtp net-bind-ip A.B.C.D", RTP_STR "Bind endpoints facing the Network\n" "Address to bind to\n") { - bsc_replace_string(g_cfg, &g_cfg->net_ports.bind_addr, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->net_ports.bind_addr, argv[0]); return CMD_SUCCESS; } @@ -483,7 +483,7 @@ if (!txt) return CMD_WARNING; - bsc_replace_string(g_cfg, &g_cfg->trunk.audio_fmtp_extra, txt); + osmo_talloc_replace_string(g_cfg, &g_cfg->trunk.audio_fmtp_extra, txt); talloc_free(txt); return CMD_SUCCESS; } @@ -529,7 +529,7 @@ "sdp audio-payload name NAME", SDP_STR AUDIO_STR "Name\n" "Payload name\n") { - bsc_replace_string(g_cfg, &g_cfg->trunk.audio_name, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->trunk.audio_name, argv[0]); return CMD_SUCCESS; } @@ -714,7 +714,7 @@ CALL_AGENT_STR IP_STR "IPv4 Address of the callagent\n") { - bsc_replace_string(g_cfg, &g_cfg->call_agent_addr, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->call_agent_addr, argv[0]); return CMD_SUCCESS; } @@ -730,7 +730,7 @@ "Use a MGW to detranscoder RTP\n" "The IP address of the MGW") { - bsc_replace_string(g_cfg, &g_cfg->transcoder_ip, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->transcoder_ip, argv[0]); inet_aton(g_cfg->transcoder_ip, &g_cfg->transcoder_in); return CMD_SUCCESS; @@ -838,7 +838,7 @@ if (!txt) return CMD_WARNING; - bsc_replace_string(g_cfg, &trunk->audio_fmtp_extra, txt); + osmo_talloc_replace_string(g_cfg, &trunk->audio_fmtp_extra, txt); talloc_free(txt); return CMD_SUCCESS; } @@ -866,7 +866,7 @@ { struct mgcp_trunk_config *trunk = vty->index; - bsc_replace_string(g_cfg, &trunk->audio_name, argv[0]); + osmo_talloc_replace_string(g_cfg, &trunk->audio_name, argv[0]); return CMD_SUCCESS; } @@ -1289,7 +1289,7 @@ "osmux bind-ip A.B.C.D", OSMUX_STR IP_STR "IPv4 Address to bind to\n") { - bsc_replace_string(g_cfg, &g_cfg->osmux_addr, argv[0]); + osmo_talloc_replace_string(g_cfg, &g_cfg->osmux_addr, argv[0]); return CMD_SUCCESS; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 2f0b96d..ee094d6 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -253,7 +253,7 @@ data = bsc_gsmnet->bsc_data; if (rf_ctrl) - bsc_replace_string(data, &data->rf_ctrl_name, rf_ctrl); + osmo_talloc_replace_string(data, &data->rf_ctrl_name, rf_ctrl); data->rf_ctrl = osmo_bsc_rf_create(data->rf_ctrl_name, bsc_gsmnet); if (!data->rf_ctrl) { diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c index 2336669..2e2e99b 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c @@ -230,7 +230,7 @@ { struct bsc_msc_data *data = bsc_msc_data(vty); - bsc_replace_string(osmo_bsc_data(vty), &data->bsc_token, argv[0]); + osmo_talloc_replace_string(osmo_bsc_data(vty), &data->bsc_token, argv[0]); return CMD_SUCCESS; } @@ -490,7 +490,7 @@ if (!str) return CMD_WARNING; - bsc_replace_string(osmo_bsc_data(vty), &data->ussd_welcome_txt, str); + osmo_talloc_replace_string(osmo_bsc_data(vty), &data->ussd_welcome_txt, str); talloc_free(str); return CMD_SUCCESS; } @@ -518,7 +518,7 @@ if (!str) return CMD_WARNING; - bsc_replace_string(osmo_bsc_data(vty), &data->ussd_msc_lost_txt, str); + osmo_talloc_replace_string(osmo_bsc_data(vty), &data->ussd_msc_lost_txt, str); talloc_free(str); return CMD_SUCCESS; } @@ -546,7 +546,7 @@ if (!str) return CMD_WARNING; - bsc_replace_string(osmo_bsc_data(vty), &data->ussd_grace_txt, str); + osmo_talloc_replace_string(osmo_bsc_data(vty), &data->ussd_grace_txt, str); talloc_free(str); return CMD_SUCCESS; } @@ -574,7 +574,7 @@ if (!txt) return CMD_WARNING; - bsc_replace_string(data, &data->ussd_no_msc_txt, txt); + osmo_talloc_replace_string(data, &data->ussd_no_msc_txt, txt); talloc_free(txt); return CMD_SUCCESS; } @@ -666,7 +666,7 @@ { struct bsc_msc_data *msc = bsc_msc_data(vty); - bsc_replace_string(msc, &msc->acc_lst_name, argv[0]); + osmo_talloc_replace_string(msc, &msc->acc_lst_name, argv[0]); return CMD_SUCCESS; } @@ -695,7 +695,7 @@ if (!txt) return CMD_WARNING; - bsc_replace_string(data, &data->mid_call_txt, txt); + osmo_talloc_replace_string(data, &data->mid_call_txt, txt); talloc_free(txt); return CMD_SUCCESS; } @@ -717,7 +717,7 @@ { struct osmo_bsc_data *data = osmo_bsc_data(vty); - bsc_replace_string(data, &data->rf_ctrl_name, argv[0]); + osmo_talloc_replace_string(data, &data->rf_ctrl_name, argv[0]); return CMD_SUCCESS; } @@ -749,7 +749,7 @@ { struct osmo_bsc_data *bsc = osmo_bsc_data(vty); - bsc_replace_string(bsc, &bsc->acc_lst_name, argv[0]); + osmo_talloc_replace_string(bsc, &bsc->acc_lst_name, argv[0]); return CMD_SUCCESS; } diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index 3453758..128ea65 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -362,7 +362,7 @@ return CTRL_CMD_ERROR; if (strcmp(bsc_variable, "access-list-name") == 0) { - bsc_replace_string(bsc_cfg, &bsc_cfg->acc_lst_name, cmd->value); + osmo_talloc_replace_string(bsc_cfg, &bsc_cfg->acc_lst_name, cmd->value); cmd->reply = talloc_asprintf(cmd, "%s", bsc_cfg->acc_lst_name ? bsc_cfg->acc_lst_name : ""); return CTRL_CMD_REPLY; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index bb0f4c4..c12b29f 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -139,7 +139,7 @@ void bsc_nat_set_msc_ip(struct bsc_nat *nat, const char *ip) { - bsc_replace_string(nat, &nat->main_dest->ip, ip); + osmo_talloc_replace_string(nat, &nat->main_dest->ip, ip); } struct bsc_connection *bsc_connection_alloc(struct bsc_nat *nat) diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index deb98fc..a11ae15 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -479,7 +479,7 @@ "Authentication token configuration\n" "Token of the BSC, currently transferred in cleartext\n") { - bsc_replace_string(_nat, &_nat->token, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->token, argv[0]); return CMD_SUCCESS; } @@ -502,7 +502,7 @@ "Set the name of the access list to use.\n" "The name of the to be used access list.") { - bsc_replace_string(_nat, &_nat->acc_lst_name, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->acc_lst_name, argv[0]); return CMD_SUCCESS; } @@ -518,11 +518,11 @@ struct bsc_connection *con1, *con2; if ('/' == argv[0][0]) - bsc_replace_string(_nat, &_nat->resolved_path, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->resolved_path, argv[0]); else { path = talloc_asprintf(_nat, "%s/%s", _nat->include_base, argv[0]); - bsc_replace_string(_nat, &_nat->resolved_path, path); + osmo_talloc_replace_string(_nat, &_nat->resolved_path, path); talloc_free(path); } @@ -538,7 +538,7 @@ return CMD_WARNING; } - bsc_replace_string(_nat, &_nat->include_file, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->include_file, argv[0]); llist_for_each_entry_safe(con1, con2, &_nat->bsc_connections, list_entry) { @@ -574,7 +574,7 @@ "IMSI black listing\n" "Filename IMSI and reject-cause\n") { - bsc_replace_string(_nat, &_nat->imsi_black_list_fn, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->imsi_black_list_fn, argv[0]); if (_nat->imsi_black_list_fn) { int rc; struct osmo_config_list *rewr = NULL; @@ -609,7 +609,7 @@ { struct osmo_config_list *rewr = NULL; - bsc_replace_string(nat, name, file); + osmo_talloc_replace_string(nat, name, file); if (*name) { rewr = osmo_config_list_parse(nat, *name); bsc_nat_num_rewr_entry_adapt(nat, head, rewr); @@ -740,7 +740,7 @@ _nat->num_rewr_trie = NULL; /* replace the file name */ - bsc_replace_string(_nat, &_nat->num_rewr_trie_name, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->num_rewr_trie_name, argv[0]); if (!_nat->num_rewr_trie_name) { vty_out(vty, "%% prefix-tree no filename is present.%s", VTY_NEWLINE); return CMD_WARNING; @@ -789,7 +789,7 @@ "Set the name of the access list to check for IMSIs for USSD message\n" "The name of the access list for HLR USSD handling") { - bsc_replace_string(_nat, &_nat->ussd_lst_name, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->ussd_lst_name, argv[0]); return CMD_SUCCESS; } @@ -809,7 +809,7 @@ "ussd-token TOKEN", "Set the token used to identify the USSD module\n" "Secret key\n") { - bsc_replace_string(_nat, &_nat->ussd_token, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->ussd_token, argv[0]); return CMD_SUCCESS; } @@ -818,7 +818,7 @@ "ussd-local-ip A.B.C.D", "Set the IP to listen for the USSD Provider\n" "IP Address\n") { - bsc_replace_string(_nat, &_nat->ussd_local, argv[0]); + osmo_talloc_replace_string(_nat, &_nat->ussd_local, argv[0]); return CMD_SUCCESS; } @@ -884,7 +884,7 @@ if (strncmp(conf->token, argv[0], 128) != 0) conf->token_updated = true; - bsc_replace_string(conf, &conf->token, argv[0]); + osmo_talloc_replace_string(conf, &conf->token, argv[0]); return CMD_SUCCESS; } @@ -983,7 +983,7 @@ { struct bsc_config *conf = vty->index; - bsc_replace_string(conf, &conf->acc_lst_name, argv[0]); + osmo_talloc_replace_string(conf, &conf->acc_lst_name, argv[0]); return CMD_SUCCESS; } @@ -1035,7 +1035,7 @@ { struct bsc_config *conf = vty->index; - bsc_replace_string(conf, &conf->description, argv[0]); + osmo_talloc_replace_string(conf, &conf->description, argv[0]); return CMD_SUCCESS; } diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c index b2d237e..43a453a 100644 --- a/openbsc/tests/mgcp/mgcp_test.c +++ b/openbsc/tests/mgcp/mgcp_test.c @@ -532,7 +532,7 @@ last_endpoint = -1; dummy_packets = 0; - bsc_replace_string(cfg, &cfg->trunk.audio_fmtp_extra, t->extra_fmtp); + osmo_talloc_replace_string(cfg, &cfg->trunk.audio_fmtp_extra, t->extra_fmtp); inp = create_msg(t->req); msg = mgcp_handle_message(cfg, inp); -- To view, visit https://gerrit.osmocom.org/2778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602 Gerrit-PatchSet: 2 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 Fri Jun 9 08:51:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:51:04 +0000 Subject: osmo-gsm-manuals[master]: osmo-nitb: Update VTY command reference In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4c2d71eeca853ef277e802e9e8e200eb3414bca Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: dexter 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 Fri Jun 9 08:51:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:51:46 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmo-nitb: Update VTY command reference In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-nitb: Update VTY command reference ...................................................................... osmo-nitb: Update VTY command reference Change-Id: Ia4c2d71eeca853ef277e802e9e8e200eb3414bca --- M OsmoNITB/vty/nitb_vty_additions.xml M OsmoNITB/vty/nitb_vty_reference.xml 2 files changed, 1,085 insertions(+), 433 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/OsmoNITB/vty/nitb_vty_additions.xml b/OsmoNITB/vty/nitb_vty_additions.xml index b982a6a..0d473bd 100644 --- a/OsmoNITB/vty/nitb_vty_additions.xml +++ b/OsmoNITB/vty/nitb_vty_additions.xml @@ -1,11 +1,11 @@ - + 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 @@ -13,8 +13,8 @@ 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 13e130b..5f49b09 100644 --- a/OsmoNITB/vty/nitb_vty_reference.xml +++ b/OsmoNITB/vty/nitb_vty_reference.xml @@ -116,14 +116,6 @@ - - - - - - - - @@ -176,6 +168,24 @@ + + + + + + + + + + + + + + + + + + @@ -192,7 +202,7 @@ - + @@ -220,6 +230,9 @@ + + + @@ -227,10 +240,13 @@ - + + + + - + @@ -246,6 +262,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -274,10 +313,10 @@ - - - - + + + + @@ -290,7 +329,7 @@ - + @@ -306,42 +345,48 @@ - - - - + + + + - - - - + + + + - + - - - - + + + + - - - + + + + + + + + + - - - - + + + + @@ -354,10 +399,10 @@ - - - - + + + + @@ -366,10 +411,10 @@ - - - - + + + + @@ -381,10 +426,10 @@ - - - - + + + + @@ -401,11 +446,12 @@ - + - - - + + + + @@ -587,14 +633,6 @@ - - - - - - - - @@ -647,6 +685,24 @@ + + + + + + + + + + + + + + + + + + @@ -663,7 +719,7 @@ - + @@ -691,6 +747,9 @@ + + + @@ -698,10 +757,13 @@ - + + + + - + @@ -719,6 +781,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -727,6 +812,12 @@ + + + + + + @@ -740,6 +831,15 @@ + + + + + + + + + @@ -842,10 +942,10 @@ - - - - + + + + @@ -858,7 +958,7 @@ - + @@ -874,42 +974,48 @@ - - - - + + + + - - - - + + + + - + - - - - + + + + - - - + + + + + + + + + - - - - + + + + @@ -922,10 +1028,10 @@ - - - - + + + + @@ -934,10 +1040,10 @@ - - - - + + + + @@ -949,10 +1055,10 @@ - - - - + + + + @@ -969,13 +1075,32 @@ + + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -984,10 +1109,10 @@ - - - - + + + + @@ -996,10 +1121,10 @@ - - - - + + + + @@ -1009,10 +1134,10 @@ - - - - + + + + @@ -1021,46 +1146,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1101,20 +1193,20 @@ - - - - + + + + - + - - - + + + @@ -1352,6 +1444,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1367,9 +1503,14 @@ - + - + + + + + + @@ -1448,7 +1589,25 @@ - + + + + + + + + + + + + + + + + + + + @@ -1476,6 +1635,9 @@ + + + @@ -1483,20 +1645,15 @@ - + + + + - + - - - - - - - - @@ -1512,8 +1669,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1574,8 +1856,14 @@ + + + + + + - + @@ -1677,8 +1965,23 @@ + + + + + + + + + + + + + + + @@ -1758,13 +2061,20 @@ - + + + + + + + + @@ -1876,91 +2186,91 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + @@ -1987,7 +2297,7 @@ - + @@ -2072,6 +2382,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2146,6 +2483,13 @@ + + + + + + + @@ -2375,6 +2719,12 @@ + + + + + + @@ -2382,6 +2732,14 @@ + + + + + + + + @@ -2414,6 +2772,19 @@ + + + + + + + + + + + + + @@ -2583,6 +2954,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2665,6 +3078,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2681,8 +3458,14 @@ + + + + + + - + @@ -2801,7 +3584,7 @@ - + @@ -2851,7 +3634,7 @@ - + @@ -2863,6 +3646,9 @@ + + + @@ -2931,7 +3717,7 @@ - + @@ -2996,7 +3782,7 @@ - + @@ -3092,34 +3878,91 @@ + + + + + - + + + - - - - - - + - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -3186,244 +4029,53 @@ - - - + - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - + + - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - \ No newline at end of file + -- To view, visit https://gerrit.osmocom.org/2014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia4c2d71eeca853ef277e802e9e8e200eb3414bca Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: dexter 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 Fri Jun 9 08:51:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:51:47 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmo-sgsn: fix arrow tips in flow diagrams In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-sgsn: fix arrow tips in flow diagrams ...................................................................... osmo-sgsn: fix arrow tips in flow diagrams The arrow style used to desribe the flowcharts in gsup.adoc does not match the arrow style used in the protocol descriptions which are included from the common directory (gb.adoc, control_if.adoc, oap.adoc). This patch changes the arrow style to match the already existing common parts. Change-Id: I7faa0c97ee3705a64289a47bc63f311d05f988b3 --- M OsmoSGSN/chapters/gsup.adoc 1 file changed, 37 insertions(+), 37 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoSGSN/chapters/gsup.adoc b/OsmoSGSN/chapters/gsup.adoc index 45c0e1d..f496b84 100644 --- a/OsmoSGSN/chapters/gsup.adoc +++ b/OsmoSGSN/chapters/gsup.adoc @@ -65,8 +65,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - SGSN -> Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; - Peer -> SGSN [label="SEND AUTHENTICATION INFO RESPONSE (Tuples)"]; + SGSN => Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; + Peer => SGSN [label="SEND AUTHENTICATION INFO RESPONSE (Tuples)"]; } ---- @@ -77,8 +77,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - SGSN -> Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; - Peer -> SGSN [label="SEND AUTHENTICATION INFO ERROR (Cause)"]; + SGSN => Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; + Peer => SGSN [label="SEND AUTHENTICATION INFO ERROR (Cause)"]; } ---- @@ -94,7 +94,7 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - SGSN -> Peer [label="AUTHENTICATION FAILURE REPORT (IMSI)"]; + SGSN => Peer [label="AUTHENTICATION FAILURE REPORT (IMSI)"]; } ---- @@ -115,10 +115,10 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - SGSN -> Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; - Peer -> SGSN [label="INSERT SUBSCRIBER DATA"]; - SGSN -> Peer [label="INSERT SUBSCRIBER DATA ACK"]; - Peer -> SGSN [label="UPDATE LOCATTION RESULT"]; + SGSN => Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; + Peer => SGSN [label="INSERT SUBSCRIBER DATA"]; + SGSN => Peer [label="INSERT SUBSCRIBER DATA ACK"]; + Peer => SGSN [label="UPDATE LOCATTION RESULT"]; } ---- @@ -129,8 +129,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - SGSN -> Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; - Peer -> SGSN [label="UPDATE LOCATTION ERROR (Cause)"]; + SGSN => Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; + Peer => SGSN [label="UPDATE LOCATTION ERROR (Cause)"]; } ---- @@ -146,8 +146,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - Peer -> SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; - SGSN -> Peer [label="CANCEL LOCATION RESULT"]; + Peer => SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; + SGSN => Peer [label="CANCEL LOCATION RESULT"]; } ---- @@ -158,8 +158,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - Peer -> SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; - SGSN -> Peer [label="CANCEL LOCATION ERROR (Cause)"]; + Peer => SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; + SGSN => Peer [label="CANCEL LOCATION ERROR (Cause)"]; } ---- @@ -176,8 +176,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - SGSN -> Peer [label="PURGE MS REQUEST (IMSI)"]; - Peer -> SGSN [label="PURGE MS RESULT"]; + SGSN => Peer [label="PURGE MS REQUEST (IMSI)"]; + Peer => SGSN [label="PURGE MS RESULT"]; } ---- @@ -195,8 +195,8 @@ hscale="1.5"; SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; - Peer -> SGSN [label="DELETE SUBSCRIBER DATA REQUEST (IMSI)"]; - SGSN -> Peer [label="DELETE SUBSCRIBER DATA RESULT"]; + Peer => SGSN [label="DELETE SUBSCRIBER DATA REQUEST (IMSI)"]; + SGSN => Peer [label="DELETE SUBSCRIBER DATA RESULT"]; } ---- @@ -221,7 +221,7 @@ ==== Send Authentication Info Request -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -239,7 +239,7 @@ ==== Send Authentication Info Error -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -251,7 +251,7 @@ ==== Send Authentication Info Response -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -263,7 +263,7 @@ ==== Authentication Failure Report -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -275,7 +275,7 @@ ==== Update Location Request -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -287,7 +287,7 @@ ==== Update Location Error -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -299,7 +299,7 @@ ==== Update Location Result -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -316,7 +316,7 @@ ==== Location Cancellation Request -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -329,7 +329,7 @@ ==== Location Cancellation Result -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -341,7 +341,7 @@ ==== Purge MS Request -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -354,7 +354,7 @@ ==== Purge MS Error -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -366,7 +366,7 @@ ==== Purge MS Result -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -378,7 +378,7 @@ ==== Insert Subscriber Data Request -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -396,7 +396,7 @@ ==== Insert Subscriber Data Error -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -408,7 +408,7 @@ ==== Insert Subscriber Data Result -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -419,7 +419,7 @@ ==== Delete Subscriber Data Request -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -432,7 +432,7 @@ ==== Delete Subscriber Data Error -Direction: SGSN -> Network peer +Direction: SGSN => Network peer [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -444,7 +444,7 @@ ==== Delete Subscriber Data Result -Direction: Network peer -> SGSN +Direction: Network peer => SGSN [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== -- To view, visit https://gerrit.osmocom.org/2022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7faa0c97ee3705a64289a47bc63f311d05f988b3 Gerrit-PatchSet: 7 Gerrit-Project: osmo-gsm-manuals 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 Fri Jun 9 08:53:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:53:08 +0000 Subject: openggsn[master]: libgtp: improve error logging and propagation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie07f1e4246eb178838b7df21946a08a1f60f2084 Gerrit-PatchSet: 2 Gerrit-Project: openggsn 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 Jun 9 08:53:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:53:11 +0000 Subject: [MERGED] openggsn[master]: libgtp: improve error logging and propagation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: improve error logging and propagation ...................................................................... libgtp: improve error logging and propagation * propagate error code from gtp_new() to caller instead of always returning -1 * on socket-related failures log explicitly which kind of socket caused error * log expected GTP version for unexpected packets Change-Id: Ie07f1e4246eb178838b7df21946a08a1f60f2084 related: SYS#3610 --- M gtp/gtp.c 1 file changed, 13 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index ade746a..801664d 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -730,9 +730,9 @@ if (((*gsn)->fd0 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { (*gsn)->err_socket++; LOGP(DLGTP, LOGL_ERROR, - "socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", + "GTPv0 socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", AF_INET, SOCK_DGRAM, 0, strerror(errno)); - return -1; + return -errno; } memset(&addr, 0, sizeof(addr)); @@ -748,16 +748,16 @@ LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr, "bind(fd0=%d) failed: Error = %s\n", (*gsn)->fd0, strerror(errno)); - return -1; + return -errno; } /* Create GTP version 1 control plane socket */ if (((*gsn)->fd1c = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { (*gsn)->err_socket++; LOGP(DLGTP, LOGL_ERROR, - "socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", + "GTPv1 control plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", AF_INET, SOCK_DGRAM, 0, strerror(errno)); - return -1; + return -errno; } memset(&addr, 0, sizeof(addr)); @@ -773,16 +773,16 @@ LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr, "bind(fd1c=%d) failed: Error = %s\n", (*gsn)->fd1c, strerror(errno)); - return -1; + return -errno; } /* Create GTP version 1 user plane socket */ if (((*gsn)->fd1u = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { (*gsn)->err_socket++; LOGP(DLGTP, LOGL_ERROR, - "socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", + "GTPv1 user plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n", AF_INET, SOCK_DGRAM, 0, strerror(errno)); - return -1; + return -errno; } memset(&addr, 0, sizeof(addr)); @@ -798,7 +798,7 @@ LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr, "bind(fd1u=%d) failed: Error = %s\n", (*gsn)->fd1u, strerror(errno)); - return -1; + return -errno; } return 0; @@ -2730,7 +2730,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTP Signalling Message\n"); + "Unexpected GTPv0 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2741,7 +2741,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTP Signalling Message\n"); + "Unexpected GTPv0 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2905,7 +2905,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTP Signalling Message\n"); + "Unexpected GTPv1 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2916,7 +2916,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTP Signalling Message\n"); + "Unexpected GTPv1 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } -- To view, visit https://gerrit.osmocom.org/2655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie07f1e4246eb178838b7df21946a08a1f60f2084 Gerrit-PatchSet: 3 Gerrit-Project: openggsn 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 Jun 9 08:54:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:54:54 +0000 Subject: [MERGED] osmo-bts[master]: measurement: fix measurement computation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: measurement: fix measurement computation ...................................................................... measurement: fix measurement computation Timing advance is currently not taken into account when computing the measurement results, this commit fixes that Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553 --- M include/osmo-bts/measurement.h M src/common/measurement.c M src/common/rsl.c 3 files changed, 56 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h index 2efe40f..87c8109 100644 --- a/include/osmo-bts/measurement.h +++ b/include/osmo-bts/measurement.h @@ -1,6 +1,9 @@ #ifndef OSMO_BTS_MEAS_H #define OSMO_BTS_MEAS_H +#define MEAS_MAX_TIMING_ADVANCE 63 +#define MEAS_MIN_TIMING_ADVANCE 0 + int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm); int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn); diff --git a/src/common/measurement.c b/src/common/measurement.c index 22ab27c..a84cf7a 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -196,6 +196,50 @@ return 7; } +/* Update order TA at end of meas period */ +static void lchan_meas_update_ordered_TA(struct gsm_lchan *lchan, + int32_t taqb_sum) +{ + int32_t ms_timing_offset = 0; + uint8_t l1_info_valid; + + l1_info_valid = lchan->meas.flags & LC_UL_M_F_L1_VALID; + + if (l1_info_valid) { + DEBUGP(DMEAS, + "%s Update TA TimingOffset_Mean:%d, UL RX TA:%d, DL ordered TA:%d, flags:%d \n", + gsm_lchan_name(lchan), taqb_sum, lchan->meas.l1_info[1], + lchan->rqd_ta, lchan->meas.flags); + + ms_timing_offset = + taqb_sum + (lchan->meas.l1_info[1] - lchan->rqd_ta); + + if (ms_timing_offset > 0) { + if (lchan->rqd_ta < MEAS_MAX_TIMING_ADVANCE) { + /* MS is moving away from BTS. + * So increment Ordered TA by 1 */ + lchan->rqd_ta++; + } + } else if (ms_timing_offset < 0) { + if (lchan->rqd_ta > MEAS_MIN_TIMING_ADVANCE) { + /* MS is moving toward BTS. So decrement + * Ordered TA by 1 */ + lchan->rqd_ta--; + } + } + + DEBUGP(DMEAS, + "%s New Update TA--> TimingOff_diff:%d, UL RX TA:%d, DL ordered TA:%d \n", + gsm_lchan_name(lchan), ms_timing_offset, + lchan->meas.l1_info[1], lchan->rqd_ta); + } + + /* Clear L1 INFO valid flag at Meas period end */ + lchan->meas.flags &= ~LC_UL_M_F_L1_VALID; + + return; +} + int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) { struct gsm_meas_rep_unidir *mru; @@ -206,6 +250,7 @@ int32_t taqb_sum = 0; unsigned int num_meas_sub = 0; int i; + int32_t ms_timing_offset = 0; /* if measurement period is not complete, abort */ if (!is_meas_complete(ts_pchan(lchan->ts), lchan->ts->nr, @@ -241,6 +286,9 @@ if (num_meas_sub) { ber_sub_sum = ber_sub_sum / num_meas_sub; irssi_sub_sum = irssi_sub_sum / num_meas_sub; + } else { + ber_sub_sum = ber_full_sum; + irssi_sub_sum = irssi_full_sum; } DEBUGP(DMEAS, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), " @@ -249,6 +297,9 @@ ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, ber_sub_sum%100, irssi_sub_sum); + /* Update ordered TA for DL SACCH L1 Header */ + lchan_meas_update_ordered_TA(lchan, taqb_sum); + /* store results */ mru = &lchan->meas.ul_res; mru->full.rx_lev = dbm2rxlev((int)irssi_full_sum * -1); diff --git a/src/common/rsl.c b/src/common/rsl.c index 0f2b671..101d13f 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2267,7 +2267,8 @@ msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr); if (lchan->meas.flags & LC_UL_M_F_L1_VALID) { msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info); - lchan->meas.flags &= ~LC_UL_M_F_L1_VALID; + /* Note: L1 info valid flag is cleared by function + * lchan_meas_update_ordered_TA() in measurement.c */ } msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3); if (ms_to_valid(lchan)) { -- To view, visit https://gerrit.osmocom.org/2412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553 Gerrit-PatchSet: 13 Gerrit-Project: osmo-bts 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 Fri Jun 9 08:56:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:56:55 +0000 Subject: openbsc[master]: Request and parse BTS feature list via OML In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Gerrit-PatchSet: 3 Gerrit-Project: openbsc 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 Jun 9 08:58:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:58:01 +0000 Subject: openbsc[master]: Get TRX attributes In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Gerrit-PatchSet: 6 Gerrit-Project: openbsc 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 Jun 9 08:58:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:58:05 +0000 Subject: [MERGED] openbsc[master]: Get TRX attributes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Get TRX attributes ...................................................................... Get TRX attributes Request per-TRX attributes in addition to BTS attributes. Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Related: OS#1614 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/libcommon/gsm_data_shared.c 4 files changed, 77 insertions(+), 37 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index b920e3b..b72ed2d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -512,6 +512,7 @@ enum bts_attribute { BTS_TYPE_VARIANT, BTS_SUB_MODEL, + TRX_PHY_VERSION, }; struct vty; diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index ec1e478..38c47a3 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -439,14 +439,14 @@ return res; } -static inline bool handle_attr(struct gsm_bts *bts, enum bts_attribute id, uint8_t *val, uint8_t len) +static inline bool handle_attr(const struct gsm_bts *bts, enum bts_attribute id, uint8_t *val, uint8_t len) { switch (id) { case BTS_TYPE_VARIANT: - LOGP(DNM, LOGL_ERROR, "BTS reported variant: %s\n", val); + LOGP(DNM, LOGL_NOTICE, "BTS%u reported variant: %s\n", bts->nr, val); break; case BTS_SUB_MODEL: - LOGP(DNM, LOGL_ERROR, "BTS reported submodel: %s\n", val); + LOGP(DNM, LOGL_NOTICE, "BTS%u reported submodel: %s\n", bts->nr, val); break; default: return false; @@ -454,55 +454,87 @@ return true; } +/* Parse Attribute Response Info - return pointer to the actual content */ +static inline uint8_t *parse_attr_resp_info_unreported(uint8_t bts_nr, uint8_t *ari, uint16_t ari_len, uint16_t *out_len) +{ + uint8_t num_unreported = ari[0], i; + + DEBUGP(DNM, "BTS%u Get Attributes Response Info: %u bytes total with %u unreported attributes\n", + bts_nr, ari_len, num_unreported); + + /* +1 because we have to account for number of unreported attributes, prefixing the list: */ + for (i = 0; i < num_unreported; i++) + LOGP(DNM, LOGL_ERROR, "BTS%u Attribute %s is unreported\n", + bts_nr, get_value_string(abis_nm_att_names, ari[i + 1])); + + /* the data starts right after the list of unreported attributes + space for length of that list */ + *out_len = ari_len - (num_unreported + 2); + + return ari + num_unreported + 1; /* we have to account for 1st byte with number of unreported attributes */ +} + +/* Parse Attribute Response Info content for 3GPP TS 52.021 ?9.4.28 Manufacturer Dependent State */ +static inline uint8_t *parse_attr_resp_info_manuf_state(const struct gsm_bts_trx *trx, uint8_t *data, uint16_t *data_len) +{ + struct tlv_parsed tp; + const uint8_t *power; + uint8_t adjust = 0; + + if (!trx) /* this attribute does not make sense on BTS level, only on TRX level */ + return data; + + abis_nm_tlv_parse(&tp, trx->bts, data, *data_len); + if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_STATE, 1)) { + power = TLVP_VAL(&tp, NM_ATT_MANUF_STATE); + LOGP(DNM, LOGL_NOTICE, "%s Get Attributes Response: nominal power is %u\n", gsm_trx_name(trx), *power); + adjust = 2; /* adjust for parsed TV struct */ + } + + *data_len -= adjust; + + return data + adjust; +} + /* Handle 3GPP TS 52.021 ?9.4.64 Get Attribute Response Info */ -static int abis_nm_rx_get_attr_resp(struct msgb *mb, struct gsm_bts *bts) +static int abis_nm_rx_get_attr_resp(struct msgb *mb, const struct gsm_bts_trx *trx) { struct abis_om_hdr *oh = msgb_l2(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb); struct e1inp_sign_link *sign_link = mb->dst; + struct gsm_bts *bts = trx ? trx->bts : sign_link->trx->bts; struct tlv_parsed tp; - const uint8_t *ari; - uint8_t unreported, i; - uint16_t ari_len; + uint8_t *data, i; + uint16_t data_len; int rc; struct abis_nm_sw_desc sw_descr[MAX_BTS_ATTR]; abis_nm_debugp_foh(DNM, foh); - DEBUGPC(DNM, "Get Attributes Response\n"); + DEBUGPC(DNM, "Get Attributes Response for BTS%u\n", bts->nr); - abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh)); - - if (!TLVP_PRESENT(&tp, NM_ATT_GET_ARI)) { - LOGP(DNM, LOGL_ERROR, "Get Attributes Response without Response Info?!\n"); + abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); + if (!TLVP_PRES_LEN(&tp, NM_ATT_GET_ARI, 1)) { + LOGP(DNM, LOGL_ERROR, "BTS%u: Get Attributes Response without Response Info?!\n", bts->nr); return -EINVAL; } - ari = TLVP_VAL(&tp, NM_ATT_GET_ARI); - ari_len = TLVP_LEN(&tp, NM_ATT_GET_ARI); - /* Attributes Response Info has peculiar structure - first the number of unreported attributes */ - unreported = ari[0]; - DEBUGP(DNM, "Found Get Attributes Response Info: %u bytes total with %u unreported attributes\n", - ari_len, unreported); + data = parse_attr_resp_info_unreported(bts->nr, TLVP_VAL(&tp, NM_ATT_GET_ARI), TLVP_LEN(&tp, NM_ATT_GET_ARI), + &data_len); - /* than the list of unreported attributes */ - for (i = 0; i < unreported; i++) - LOGP(DNM, LOGL_ERROR, "Attribute %s is unreported\n", /* +1 because we have to account for number of */ - get_value_string(abis_nm_att_names, ari[i + 1])); /* unreported attributes, prefixing the list. */ + data = parse_attr_resp_info_manuf_state(trx, data, &data_len); - /* after that there's finally list of replies in form of sw-conf structure: - it starts right after the list of unreported attributes + space for length of that list */ - rc = abis_nm_get_sw_conf(ari + unreported + 1, ari_len - (unreported + 2), &sw_descr[0], ARRAY_SIZE(sw_descr)); + /* after parsing manufacturer-specific attributes there's list of replies in form of sw-conf structure: */ + rc = abis_nm_get_sw_conf(data, data_len, &sw_descr[0], ARRAY_SIZE(sw_descr)); if (rc > 0) { for (i = 0; i < rc; i++) { - if (!handle_attr(bts, str2btsattr((const char *)sw_descr[i].file_id), sw_descr[i].file_version, - sw_descr[i].file_version_len)) - LOGP(DNM, LOGL_NOTICE, "ARI reported sw[%d/%d]: %s is %s\n", - i, rc, sw_descr[i].file_id, sw_descr[i].file_version); + if (!handle_attr(bts, str2btsattr((const char *)sw_descr[i].file_id), + sw_descr[i].file_version, sw_descr[i].file_version_len)) + LOGP(DNM, LOGL_NOTICE, "BTS%u: ARI reported sw[%d/%d]: %s is %s\n", + bts->nr, i, rc, sw_descr[i].file_id, sw_descr[i].file_version); } } else - LOGP(DNM, LOGL_ERROR, "Failed to parse SW-Config part of Get Attribute Response Info: %s\n", - strerror(-rc)); + LOGP(DNM, LOGL_ERROR, "BTS%u: failed to parse SW-Config part of Get Attribute Response Info: %s\n", + bts->nr, strerror(-rc)); return 0; } @@ -720,7 +752,7 @@ case NM_MT_SET_BTS_ATTR_ACK: break; case NM_MT_GET_ATTR_RESP: - ret = abis_nm_rx_get_attr_resp(mb, bts); + ret = abis_nm_rx_get_attr_resp(mb, gsm_bts_trx_num(bts, (foh)->obj_inst.trx_nr)); break; default: abis_nm_debugp_foh(DNM, foh); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index caec800..e5226a9 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -316,10 +316,13 @@ struct input_signal_data *isd = signal_data; struct gsm_bts_trx *trx = isd->trx; int ts_no, lchan_no; - const uint8_t attr[] = { NM_ATT_SW_CONFIG, }; + /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ + const uint8_t bts_attr[] = { NM_ATT_MANUF_ID, NM_ATT_SW_CONFIG, }; + const uint8_t trx_attr[] = { NM_ATT_MANUF_STATE, NM_ATT_SW_CONFIG, }; /* we should not request more attributes than we're ready to handle */ - OSMO_ASSERT(sizeof(attr) < MAX_BTS_ATTR); + OSMO_ASSERT(sizeof(bts_attr) < MAX_BTS_ATTR); + OSMO_ASSERT(sizeof(trx_attr) < MAX_BTS_ATTR); if (subsys != SS_L_INPUT) return -EINVAL; @@ -339,14 +342,17 @@ set bts->si_common.cell_alloc */ generate_cell_chan_list(ca, trx->bts); + /* Request generic BTS-level attributes */ + abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - + /* Request TRX-level attributes */ + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); } - - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, attr, sizeof(attr)); } if (isd->link_type == E1INP_SIGN_RSL) bootstrap_rsl(trx); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 7743b69..8992636 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -54,6 +54,7 @@ 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 } }; -- To view, visit https://gerrit.osmocom.org/2783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 9 08:58:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 08:58:05 +0000 Subject: [MERGED] openbsc[master]: Request and parse BTS feature list via OML In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Request and parse BTS feature list via OML ...................................................................... Request and parse BTS feature list via OML Request features supported by BTS when getting attributes over OML. Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Related: OS#1614 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 40 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 38c47a3..551c0bf 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -473,6 +473,45 @@ return ari + num_unreported + 1; /* we have to account for 1st byte with number of unreported attributes */ } +/* Parse Attribute Response Info content for 3GPP TS 52.021 ?9.4.30 Manufacturer Id */ +static inline uint8_t *parse_attr_resp_info_manuf_id(struct gsm_bts *bts, uint8_t *data, uint16_t *data_len) +{ + struct tlv_parsed tp; + uint16_t m_id_len = 0; + uint8_t adjust = 0, i; + + abis_nm_tlv_parse(&tp, bts, data, *data_len); + if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_ID, 2)) { + m_id_len = TLVP_LEN(&tp, NM_ATT_MANUF_ID); + + if (m_id_len > MAX_BTS_FEATURES/8 + 1) { + LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n", + bts->nr, MAX_BTS_FEATURES/8); + m_id_len = MAX_BTS_FEATURES/8; + } + + if (m_id_len > _NUM_BTS_FEAT/8 + 1) + LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " + "feature vector - most likely it was compiled against newer BSC headers. " + "Consider upgrading your BSC to later version.\n", + bts->nr, m_id_len); + + memcpy(bts->_features_data, TLVP_VAL(&tp, NM_ATT_MANUF_ID), m_id_len); + adjust = m_id_len + 3; /* adjust for parsed TL16V struct */ + + for (i = 0; i < _NUM_BTS_FEAT; i++) + if (gsm_bts_has_feature(bts, i) != gsm_btsmodel_has_feature(bts->model, i)) + LOGP(DNM, LOGL_NOTICE, "BTS%u feature '%s' reported via OML does not match statically " + "set feature: %u != %u. Please fix.\n", bts->nr, + get_value_string(gsm_bts_features_descs, i), + gsm_bts_has_feature(bts, i), gsm_btsmodel_has_feature(bts->model, i)); + } + + *data_len -= adjust; + + return data + adjust; +} + /* Parse Attribute Response Info content for 3GPP TS 52.021 ?9.4.28 Manufacturer Dependent State */ static inline uint8_t *parse_attr_resp_info_manuf_state(const struct gsm_bts_trx *trx, uint8_t *data, uint16_t *data_len) { @@ -522,6 +561,7 @@ &data_len); data = parse_attr_resp_info_manuf_state(trx, data, &data_len); + data = parse_attr_resp_info_manuf_id(bts, data, &data_len); /* after parsing manufacturer-specific attributes there's list of replies in form of sw-conf structure: */ rc = abis_nm_get_sw_conf(data, data_len, &sw_descr[0], ARRAY_SIZE(sw_descr)); -- To view, visit https://gerrit.osmocom.org/2800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 9 09:00:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 09:00:02 +0000 Subject: osmo-bts[master]: Re-add version to phy_instance In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Gerrit-PatchSet: 2 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 Fri Jun 9 09:00:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 09:00:04 +0000 Subject: [MERGED] osmo-bts[master]: Re-add version to phy_instance In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Re-add version to phy_instance ...................................................................... Re-add version to phy_instance This is resubmission of 9eeb0b1a136fc8c24a86cb4d832c264674c10db0 with errorneous use of talloc_asprintf() removed which should fix OS#2316. Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Related: OS#1614 --- M include/osmo-bts/phy_link.h M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 8 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 2164dfa..4c7ff34 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -76,7 +76,7 @@ struct llist_head list; int num; char *description; - + char version[MAX_VERSION_LENGTH]; /* pointer to the PHY link to which we belong */ struct phy_link *phy_link; diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 4652e10..ccef231 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1140,14 +1140,14 @@ LOGP(DL1C, LOGL_INFO, "Tx APP-INFO-SYSTEM.req\n"); - return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, 0); + return l1if_req_compl(fl1h, msg, app_info_sys_compl_cb, pinst); } static int app_info_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp, void *data) { char ver_hdr[32]; - + struct phy_instance *pinst = data; tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *air = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *) resp->l2h; @@ -1171,6 +1171,7 @@ talloc_replace(fl1h->info.app.name, fl1h, air->szName); talloc_replace(fl1h->info.app.description, fl1h, air->szDescription); talloc_replace(fl1h->info.app.version, fl1h, air->szVersion); + osmo_strlcpy(pinst->version, ver_hdr, sizeof(pinst->version)); /* in a completion call-back, we take msgb ownership and must * release it before returning */ diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 60638e1..79fccd9 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1875,6 +1875,10 @@ hdl = pinst->u.sysmobts.hdl; osmo_strlcpy(bts->sub_model, sysmobts_model(hdl->hw_info.model_nr, hdl->hw_info.trx_nr), sizeof(bts->sub_model)); + snprintf(pinst->version, sizeof(pinst->version), "%u.%u dsp %u.%u.%u fpga %u.%u.%u", + hdl->hw_info.ver_major, hdl->hw_info.ver_minor, + hdl->hw_info.dsp_version[0], hdl->hw_info.dsp_version[1], hdl->hw_info.dsp_version[2], + hdl->hw_info.fpga_version[0], hdl->hw_info.fpga_version[1], hdl->hw_info.fpga_version[2]); phy_link_state_set(plink, PHY_LINK_CONNECTED); -- To view, visit https://gerrit.osmocom.org/2844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 9 09:10:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 09:10:02 +0000 Subject: osmo-bts[master]: Extend Get Attribute responder In-Reply-To: References: Message-ID: Patch Set 5: > > get_p_max_out_mdBm() should be used in this context, with no > fall-back > > See updated revision, not sure if I'm doing it right - is there > some limit on returned value? the limit implied by physical reality. It's very rare that you would see a value in excess of ~ 46 dBm in reality. So 255 as upper bound is not a constraint, 255 dBm are 31622776601683796426752 Watts of power ;) What I'm slightly more worried about is having a lower bound at 0dBm. While all devices we know/support today have more than 0dBm (1mW) Rf output power, there could very well be (particularly) SDR boards that might have less. > > why are we encoding the power in an IE that is called STATE ?!? > > Because I was unable to find any other suitable attribute among the > 3GPP TS 52.021 ?9.4 so I've used manufacturer-depended attribute. > Which one would be better to use in this case? I would have just defined a new IEI, like all other BTS vendors do on OML for their own attributes. Look at all the Siemens/BS11 specific values or the many IPA specific values in our header files. "Manufacturer Specific State" is defined as to be used in 6.7.1 state changed event. I think it is intended for an extension on the operational state. So I would go for an int16_t value in an actual manufacturer-specific IE. If you're worried about polluting the global space of IEIs in OML, you could use nested IEs and put all osmocom specific IEs into an "osmocom extension container TLV IE". -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 5 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 Fri Jun 9 09:16:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 09:16:22 +0000 Subject: osmo-bts[master]: Remove incorrect BTS number check In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 * OsmoBTS implements only a single BTS within a given OML link so a value != 0x00 is invalid. If this happens, the transmitter of the message must be fixed. * TS 52.021 clearly defines the meaning of 0xff in the bts number: "If the BTS number is NULL, it shall be understood as referring to all BTSs under the Site Manager." "The value for NULL shall be in all the cases mentioned above in this subclause." AFAICT, the original code is doing exactyl what it is supposed to do. -- To view, visit https://gerrit.osmocom.org/2846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3d5078ed1239d553c7200ceb5b08b638df33a15 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 Fri Jun 9 09:16:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 09:16:57 +0000 Subject: [MERGED] libosmocore[master]: Include codec.h file from codec C files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Include codec.h file from codec C files ...................................................................... Include codec.h file from codec C files failure to do so would prevent the compiler from catching inconsistencies between declaration and definition. Change-Id: I88617c97adcff328292e501fd5d254eeae96a660 --- M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm660.c 3 files changed, 3 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/src/codec/gsm610.c b/src/codec/gsm610.c index 3346ffc..c1eca0c 100644 --- a/src/codec/gsm610.c +++ b/src/codec/gsm610.c @@ -26,6 +26,7 @@ #include #include +#include /* GSM FR - subjective importance bit ordering */ /* This array encodes GSM 05.03 Table 2. diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c index 29ae4f5..7067239 100644 --- a/src/codec/gsm620.c +++ b/src/codec/gsm620.c @@ -26,6 +26,7 @@ #include #include +#include /* GSM HR unvoiced (mode=0) frames - subjective importance bit ordering */ /* This array encode mapping between GSM 05.03 Table 3a (bits diff --git a/src/codec/gsm660.c b/src/codec/gsm660.c index c044a2a..6c9215f 100644 --- a/src/codec/gsm660.c +++ b/src/codec/gsm660.c @@ -22,6 +22,7 @@ */ #include +#include /* GSM EFR - subjective importance bit ordering */ /* This array encodes GSM 05.03 Table 6. -- To view, visit https://gerrit.osmocom.org/2804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88617c97adcff328292e501fd5d254eeae96a660 Gerrit-PatchSet: 3 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 Fri Jun 9 09:19:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 09:19:49 +0000 Subject: osmo-bts[master]: Remove incorrect BTS number check In-Reply-To: References: Message-ID: Patch Set 1: ok, than it means that BSC code is doing smth wrong as I got 1 (bts number in openbsc config) value which triggers this error. I'll look into that, thank you for clarification. -- To view, visit https://gerrit.osmocom.org/2846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3d5078ed1239d553c7200ceb5b08b638df33a15 Gerrit-PatchSet: 1 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 Fri Jun 9 09:19:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 09:19:59 +0000 Subject: [ABANDON] osmo-bts[master]: Remove incorrect BTS number check In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Remove incorrect BTS number check ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ia3d5078ed1239d553c7200ceb5b08b638df33a15 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 Fri Jun 9 09:22:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 9 Jun 2017 09:22:18 +0000 Subject: osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 Nice work, output looks much cleaner now. -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 7 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 9 11:08:40 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 11:08:40 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND Message-ID: Review at https://gerrit.osmocom.org/2861 osmo-bts-litecell15: Fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. This commit changes process_meas_res() to properly include the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap) Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 5977aa9..b7abfbe 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -895,13 +895,13 @@ static void dump_meas_res(int ll, GsmL1_MeasParam_t *m) { - LOGPC(DL1C, ll, ", Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, " + LOGPC(DL1C, ll, ", Meas: RSSI %-3.2f dBm, Qual %-3. l1sap->u.info.u.meas_ind.fn = fn;2f dB, " "BER %-3.2f, Timing %d\n", m->fRssi, m->fLinkQuality, m->fBer, m->i16BurstTiming); } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -912,6 +912,7 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + l1sap.u.info.u.meas_ind.fn = fn; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +942,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 9 11:11:18 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 11:11:18 +0000 Subject: [ABANDON] osmo-bts[master]: measurement: Fix measurement reporting period tables In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: measurement: Fix measurement reporting period tables ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I4e0fdf081e0e28bed7d2b04f47ebc26bd2b94658 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Fri Jun 9 12:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 12:08:16 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2813 to look at the new patch set (#3). osmo-bts-trx: fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-trx does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. This commit changes l1if_fill_meas_res() to properly include the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap) it also takes care of the normalization so that the reported frame number matches the lookup tables in the higher layers. Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h 2 files changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/13/2813/3 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index a7bcd2c..1492503 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -527,9 +527,10 @@ } -void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, - float ber, float rssi) +void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, struct gsm_lchan *lchan, + uint32_t fn, float ber, float rssi, float toa) { + float ta = lchan->rqd_ta + toa; memset(l1sap, 0, sizeof(*l1sap)); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_INDICATION, NULL); @@ -538,6 +539,17 @@ l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); + l1sap->u.info.u.meas_ind.fn = fn; + + /* Align frame number with measurement period ends */ + if (lchan->type == GSM_LCHAN_TCH_F) + l1sap->u.info.u.meas_ind.fn += 1; + else if (lchan->type == GSM_LCHAN_TCH_H) { + if (lchan->nr == 0) + l1sap->u.info.u.meas_ind.fn += 2; + else if (lchan->nr == 1) + l1sap->u.info.u.meas_ind.fn += 1; + } } int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, @@ -553,7 +565,7 @@ gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); - l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + l1if_fill_meas_res(&l1sap, chan_nr, lchan, fn, ber, rssi, toa); return l1sap_up(trx, &l1sap); } diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 1864857..52af02d 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -68,8 +68,8 @@ int l1if_provision_transceiver_trx(struct trx_l1h *l1h); int l1if_provision_transceiver(struct gsm_bts *bts); int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); -void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, - float ber, float rssi); +void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, struct gsm_lchan *lchan, + uint32_t fn, float ber, float rssi, float toa); int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, int n_errors, int n_bits_total, float rssi, float toa); -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 3 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 Jun 9 12:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 12:08:16 +0000 Subject: [PATCH] osmo-bts[master]: Revert "measurement: exclude idle channels from uplink measu... Message-ID: Review at https://gerrit.osmocom.org/2862 Revert "measurement: exclude idle channels from uplink measurement" The offsets used in the lookup tables may be phy dependand. So we will have to do the alignment in the layer 1 interface of the phy dependand code before we report the frame number up to the higher layers. This reverts commit e0fb3ae52d747b26b6487ec67c79eceaf37a125c. Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c --- M src/common/measurement.c 1 file changed, 24 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/2862/1 diff --git a/src/common/measurement.c b/src/common/measurement.c index a84cf7a..0c86faf 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -24,40 +24,35 @@ * 7 6 and 7 91 to 90 103, 25, 51, 77 */ /* measurement period ends at fn % 104 == ? */ -/* Added (-1) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103 - 1, - [1] = 12 - 1, - [2] = 25 - 1, - [3] = 38 - 1, - [4] = 51 - 1, - [5] = 64 - 1, - [6] = 77 - 1, - [7] = 90 - 1, + [0] = 103, + [1] = 12, + [2] = 25, + [3] = 38, + [4] = 51, + [5] = 64, + [6] = 77, + [7] = 90, }; - -/* Added (-2) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchh0_meas_rep_fn104[] = { - [0] = 103 - 2, - [1] = 103 - 2, - [2] = 25 - 2, - [3] = 25 - 2, - [4] = 51 - 2, - [5] = 51 - 2, - [6] = 77 - 2, - [7] = 77 - 2, + [0] = 103, + [1] = 103, + [2] = 25, + [3] = 25, + [4] = 51, + [5] = 51, + [6] = 77, + [7] = 77, }; - -/* Added (-1) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12 - 1, - [1] = 12 - 1, - [2] = 38 - 1, - [3] = 38 - 1, - [4] = 64 - 1, - [5] = 64 - 1, - [6] = 90 - 1, - [7] = 90 - 1, + [0] = 12, + [1] = 12, + [2] = 38, + [3] = 38, + [4] = 64, + [5] = 64, + [6] = 90, + [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan -- To view, visit https://gerrit.osmocom.org/2862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:08:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 12:08:17 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: normalize frame number in measurement indication Message-ID: Review at https://gerrit.osmocom.org/2863 sysmobts: normalize frame number in measurement indication The higher layers relay on a normalized version of frame number in order to detect the end of a measurement period. The frame number on which the measurement reports are sent may depend on the phy, so we need to normalize the frame number before we report it to the higher layers. Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/63/2863/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 79fccd9..a83816e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,12 +897,14 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_PhDataInd_t *data_ind) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_INDICATION, NULL); + GsmL1_MeasParam_t *m = &data_ind->measParam; + l1sap.u.info.type = PRIM_INFO_MEAS; l1sap.u.info.u.meas_ind.chan_nr = chan_nr; l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; @@ -913,6 +915,12 @@ * physical radio link, the uplink is delayed by 3 timeslots, we need * to compensate for that delay. */ l1sap.u.info.u.meas_ind.fn = fn + 3; + + /* Align frame number with measurement period ends */ + if (data_ind->sapi == GsmL1_Sapi_TchF) + l1sap.u.info.u.meas_ind.fn += 1; + else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == GsmL1_SubCh_0) + l1sap.u.info.u.meas_ind.fn += 1; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +949,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, data_ind); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:08:17 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 12:08:17 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: remove unused variable Message-ID: Review at https://gerrit.osmocom.org/2864 cosmetic: remove unused variable Tha variable ms_timing_offset in lchan_meas_check_compute is not used anymore. Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c --- M src/common/measurement.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/64/2864/1 diff --git a/src/common/measurement.c b/src/common/measurement.c index 0c86faf..bd2af7e 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -245,7 +245,6 @@ int32_t taqb_sum = 0; unsigned int num_meas_sub = 0; int i; - int32_t ms_timing_offset = 0; /* if measurement period is not complete, abort */ if (!is_meas_complete(ts_pchan(lchan->ts), lchan->ts->nr, -- To view, visit https://gerrit.osmocom.org/2864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:26:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:26:48 +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 (#3). 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 insecure random generation is used as a fallback (which is clearly indicated to the caller). 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 instead. The size of the output is deliberately limited to decrease the chance of entropy pool depletion. It's still possible via successive calls but the caller can find a way to deplete the entropy anyway so it's not our concern. 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, 73 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/3 diff --git a/configure.ac b/configure.ac index 04d126e..b152b13 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +# 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 1ffe579..5429226 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -37,6 +37,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) */ @@ -59,6 +62,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); + /*! * \brief 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 7365ab7..7e9111d 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -69,6 +69,7 @@ #include #include +#include #include #include #include @@ -76,6 +77,10 @@ #include #include #include +#include + +#include +#include #include "../../config.h" @@ -662,6 +667,62 @@ return arfcn; } +static inline void fallback_insecure_rand(uint8_t *out, size_t len) +{ + int i; + + srand(time(NULL)); + + for (i = 0; i < len; out[i++] = rand()); +} + +/*! \brief Generate random identifier + * \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; + + /* we use /dev/urandom (default when GRND_RANDOM flag is not set) which is fine as (at least on GNU/Linux >= 4.8) + both /dev/(u)random numbers are coming from the same CSPRNG anyway - see also RFC4086 */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#warning "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 +#warning "Insecure random fallback is used: no getrandom syscall available!" + /* Fallback for systems without getrandom() syscall */ + rc = 0; +#endif + if (rc < 0) { /* getrandom() failed entirely */ + switch (errno) { + case EAGAIN: /* the requested entropy is not available: fallback to insecure generator and let + application decide if it's OK with */ + fallback_insecure_rand(out, len); + default: /* intentional fall-through */ + return -errno; + } + } + + if (rc != len) { /* the system call was interrupted by a signal: this should not actually happen + (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 because we do not set + GRND_RANDOM but let's be paranoid and check/fallback anyway */ + fallback_insecure_rand(out + rc, len); + + return -EAGAIN; + } + + return 0; +} + void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn) { time->fn = fn; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 8fb9878..a3e8420 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 6b1e623..eba1663 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -33,6 +33,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -224,15 +225,8 @@ } 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); - } + if (osmo_get_rand_id(_rand, 16) < 0) + printf("WARNING: We're using really weak random numbers!\n\n"); } if (test_aud.type == OSMO_AUTH_TYPE_NONE || -- 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: 3 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 From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:26:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:26:58 +0000 Subject: [PATCH] openbsc[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/1464 to look at the new patch set (#7). 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: I270c33912bf107b3c7c217d199262cc74d56ffdb --- M debian/control M openbsc/configure.ac M openbsc/src/gprs/Makefile.am M openbsc/src/gprs/gb_proxy.c M openbsc/src/gprs/gprs_gmm.c M openbsc/src/gprs/gprs_llc.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/libiu/Makefile.am M openbsc/src/libmsc/Makefile.am M openbsc/src/libmsc/auth.c M openbsc/src/libmsc/db.c M openbsc/src/osmo-bsc_nat/Makefile.am M openbsc/src/osmo-bsc_nat/bsc_nat.c M openbsc/src/osmo-nitb/Makefile.am M openbsc/tests/channel/Makefile.am M openbsc/tests/db/Makefile.am M openbsc/tests/gbproxy/Makefile.am M openbsc/tests/gbproxy/gbproxy_test.c M openbsc/tests/mm_auth/Makefile.am M openbsc/tests/mm_auth/mm_auth_test.c M openbsc/tests/sgsn/Makefile.am M openbsc/tests/sgsn/sgsn_test.c M openbsc/tests/sndcp_xid/Makefile.am M openbsc/tests/xid/Makefile.am 24 files changed, 44 insertions(+), 87 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/64/1464/7 diff --git a/debian/control b/debian/control index 87b6f07..14108d2 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,6 @@ libosmo-netif-dev, libdbd-sqlite3, libpcap-dev, - libssl-dev, libc-ares-dev, libsmpp34-dev Standards-Version: 3.9.8 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index c6ae159..00fa891 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -38,11 +38,10 @@ 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(LIBOSMOGSM, libosmogsm >= 0.9.6) 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(LIBCRYPTO, libcrypto >= 0.9.5) # Enabke/disable the NAT? AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am index cb09979..fc6f862 100644 --- a/openbsc/src/gprs/Makefile.am +++ b/openbsc/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 @@ osmo_gbproxy_LDADD = \ $(top_builddir)/src/libcommon/libcommon.a \ $(OSMO_LIBS) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) @@ -98,7 +96,6 @@ $(OSMO_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index d95139f..f11b9b9 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -51,8 +51,6 @@ #include #include -#include - static const struct rate_ctr_desc global_ctr_description[] = { { "inv-bvci", "Invalid BVC Identifier " }, { "inv-lai", "Invalid Location Area Identifier" }, @@ -236,7 +234,7 @@ bss_ptmsi = sgsn_ptmsi; } else { do { - if (RAND_bytes((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) != 1) { + if (osmo_get_rand_id((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi)) < 0) { bss_ptmsi = GSM_RESERVED_TMSI; break; } @@ -273,7 +271,7 @@ } else { do { /* create random TLLI, 0b01111xxx... */ - if (RAND_bytes((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) != 1) { + if (osmo_get_rand_id((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli)) < 0) { sgsn_tlli = 0; break; } diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index e6751db..84cdc87 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -31,8 +31,6 @@ #include #include -#include - #include "bscconfig.h" #include @@ -598,12 +596,9 @@ /* ? 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; + if (osmo_get_rand_id(&rbyte, 1) < 0) + LOGP(DMM, LOGL_ERROR, "osmo_get_rand_id() failed for A&C ref, falling back to insecure random\n"); + 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 */ @@ -1373,8 +1368,8 @@ }; /* XXX: Hack to make 3G auth work with special SIM card */ ctx->auth_state = SGSN_AUTH_AUTHENTICATE; - - RAND_bytes(tmp_rand, 16); + /* FIXME: check return value and propagate error */ + osmo_get_rand_id(tmp_rand, 16); memset(&ctx->auth_triplet.vec, 0, sizeof(ctx->auth_triplet.vec)); osmo_auth_gen_vec(&ctx->auth_triplet.vec, &auth, tmp_rand); diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c index 2be663f..720d6c5 100644 --- a/openbsc/src/gprs/gprs_llc.c +++ b/openbsc/src/gprs/gprs_llc.c @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -1070,11 +1068,8 @@ 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(); - } + if (osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4) < 0) + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset, falling back to insecure random\n"); /* Generate XID message */ xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, @@ -1103,11 +1098,8 @@ 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(); - } + if (osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4) < 0) + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset, falling back to insecure random\n"); /* Generate XID message */ xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 071dd97..ab4d3b4 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -45,8 +45,6 @@ #include -#include - #define GPRS_LLME_CHECK_TICK 30 extern struct sgsn_instance *sgsn; @@ -615,7 +613,7 @@ int max_retries = 100; restart: - if (RAND_bytes((uint8_t *) &ptmsi, sizeof(ptmsi)) != 1) + if (osmo_get_rand_id((uint8_t *) &ptmsi, sizeof(ptmsi)) < 0) goto failed; /* Enforce that the 2 MSB are set without loosing the distance between diff --git a/openbsc/src/libiu/Makefile.am b/openbsc/src/libiu/Makefile.am index e5f9e27..f78b411 100644 --- a/openbsc/src/libiu/Makefile.am +++ b/openbsc/src/libiu/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ -Wall \ $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index 9d966db..38b6e21 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -10,7 +10,6 @@ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(NULL) diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c index 19def1e..09d411c 100644 --- a/openbsc/src/libmsc/auth.c +++ b/openbsc/src/libmsc/auth.c @@ -28,8 +28,6 @@ #include #include -#include - #include const struct value_string auth_action_names[] = { @@ -123,8 +121,8 @@ } atuple->use_count = 1; - if (RAND_bytes(atuple->vec.rand, sizeof(atuple->vec.rand)) != 1) { - LOGP(DMM, LOGL_NOTICE, "RAND_bytes failed, can't generate new auth tuple\n"); + if (osmo_get_rand_id(atuple->vec.rand, sizeof(atuple->vec.rand)) < 0) { + LOGP(DMM, LOGL_ERROR, "osmo_get_rand_id() failed, can't generate new auth tuple\n"); return AUTH_ERROR; } diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5fe2a3c..6625047 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -41,8 +41,6 @@ #include #include -#include - /* Semi-Private-Interface (SPI) for the subscriber code */ void subscr_direct_free(struct gsm_subscriber *subscr); @@ -1220,8 +1218,8 @@ char *tmsi_quoted; for (;;) { - if (RAND_bytes((uint8_t *) &subscriber->tmsi, sizeof(subscriber->tmsi)) != 1) { - LOGP(DDB, LOGL_ERROR, "RAND_bytes failed\n"); + if (osmo_get_rand_id((uint8_t *) &subscriber->tmsi, sizeof(subscriber->tmsi)) < 0) { + LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed\n"); return 1; } if (subscriber->tmsi == GSM_RESERVED_TMSI) @@ -1300,8 +1298,8 @@ uint32_t try; for (;;) { - if (RAND_bytes((uint8_t *) &try, sizeof(try)) != 1) { - LOGP(DDB, LOGL_ERROR, "RAND_bytes failed\n"); + if (osmo_get_rand_id((uint8_t *) &try, sizeof(try)) < 0) { + LOGP(DDB, LOGL_ERROR, "osmo_get_rand_id() failed\n"); return 1; } if (!try) /* 0 is an invalid token */ diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/openbsc/src/osmo-bsc_nat/Makefile.am index be33d28..e7b78c9 100644 --- a/openbsc/src/osmo-bsc_nat/Makefile.am +++ b/openbsc/src/osmo-bsc_nat/Makefile.am @@ -13,7 +13,6 @@ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMONETIF_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -53,6 +52,5 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMONETIF_LIBS) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index daa066d..e510a0e 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -74,8 +74,6 @@ #include -#include - #include "../../bscconfig.h" #define SCCP_CLOSE_TIME 20 @@ -221,7 +219,7 @@ buf = v_put(buf, 0x23); mrand = bsc->last_rand; - if (RAND_bytes(mrand, 16) != 1) + if (osmo_get_rand_id(mrand, 16) < 0) goto failed_random; memcpy(buf, mrand, 16); diff --git a/openbsc/src/osmo-nitb/Makefile.am b/openbsc/src/osmo-nitb/Makefile.am index f4ef487..5ffaedf 100644 --- a/openbsc/src/osmo-nitb/Makefile.am +++ b/openbsc/src/osmo-nitb/Makefile.am @@ -13,7 +13,6 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -40,6 +39,5 @@ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBSMPP34_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) diff --git a/openbsc/tests/channel/Makefile.am b/openbsc/tests/channel/Makefile.am index ca470ac..82ffb61 100644 --- a/openbsc/tests/channel/Makefile.am +++ b/openbsc/tests/channel/Makefile.am @@ -30,6 +30,5 @@ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) diff --git a/openbsc/tests/db/Makefile.am b/openbsc/tests/db/Makefile.am index 0eed5cd..7099645 100644 --- a/openbsc/tests/db/Makefile.am +++ b/openbsc/tests/db/Makefile.am @@ -43,6 +43,5 @@ $(LIBOSMOGSM_LIBS) \ $(LIBSMPP34_LIBS) \ $(LIBOSMOVTY_LIBS) \ - $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) diff --git a/openbsc/tests/gbproxy/Makefile.am b/openbsc/tests/gbproxy/Makefile.am index 2dd66df..0bd06be 100644 --- a/openbsc/tests/gbproxy/Makefile.am +++ b/openbsc/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 = \ @@ -49,6 +49,5 @@ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOABIS_LIBS) \ $(LIBRARY_DL) \ - $(LIBCRYPTO_LIBS) \ -lrt \ $(NULL) diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index 577daa9..370cd2a 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -37,8 +37,6 @@ #include #include -#include - #define REMOTE_BSS_ADDR 0x01020304 #define REMOTE_SGSN_ADDR 0x05060708 @@ -53,30 +51,30 @@ 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 *data, size_t len) { - return (*RAND_bytes_cb)(buf, num); + return (*osmo_get_rand_id_cb)(data, len); } static int rand_seq_num = 0; -int mock_RAND_bytes(unsigned char *buf, int num) +int mock_osmo_get_rand_id(uint8_t *data, size_t len) { uint32_t val; - OSMO_ASSERT(num == sizeof(val)); - OSMO_ASSERT(__real_RAND_bytes(buf, num) == 1); + OSMO_ASSERT(len == sizeof(val)); + OSMO_ASSERT(__real_osmo_get_rand_id(data, len) == 0); val = 0x00dead00 + rand_seq_num; rand_seq_num++; - memcpy(buf, &val, num); + memcpy(data, &val, len); return 1; } diff --git a/openbsc/tests/mm_auth/Makefile.am b/openbsc/tests/mm_auth/Makefile.am index cb35198..a591d0a 100644 --- a/openbsc/tests/mm_auth/Makefile.am +++ b/openbsc/tests/mm_auth/Makefile.am @@ -8,7 +8,6 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ $(NULL) noinst_PROGRAMS = \ diff --git a/openbsc/tests/mm_auth/mm_auth_test.c b/openbsc/tests/mm_auth/mm_auth_test.c index b8777a8..2adaf26 100644 --- a/openbsc/tests/mm_auth/mm_auth_test.c +++ b/openbsc/tests/mm_auth/mm_auth_test.c @@ -120,8 +120,8 @@ return auth_action; } -/* override libssl RAND_bytes() to get testable crypto results */ -int RAND_bytes(uint8_t *rand, int len) +/* override osmo_get_rand_id() to get testable crypto results */ +int osmo_get_rand_id(uint8_t *rand, size_t len) { memset(rand, 23, len); return 1; diff --git a/openbsc/tests/sgsn/Makefile.am b/openbsc/tests/sgsn/Makefile.am index f1606cb..2b8a671 100644 --- a/openbsc/tests/sgsn/Makefile.am +++ b/openbsc/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 \ @@ -66,7 +66,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 2f1513a..02e1086 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/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 *data, size_t num) { + uint8_t *buf = (uint8_t *)data; if (num > 1) - return __real_RAND_bytes(buf, num); + return __real_osmo_get_rand_id(data, num); buf[0] = 0; return 1; } diff --git a/openbsc/tests/sndcp_xid/Makefile.am b/openbsc/tests/sndcp_xid/Makefile.am index d09c41b..fbcb36c 100644 --- a/openbsc/tests/sndcp_xid/Makefile.am +++ b/openbsc/tests/sndcp_xid/Makefile.am @@ -14,7 +14,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt -lm diff --git a/openbsc/tests/xid/Makefile.am b/openbsc/tests/xid/Makefile.am index aaf17ed..9956f36 100644 --- a/openbsc/tests/xid/Makefile.am +++ b/openbsc/tests/xid/Makefile.am @@ -31,7 +31,6 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBCARES_LIBS) \ - $(LIBCRYPTO_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ -lm \ -- To view, visit https://gerrit.osmocom.org/1464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I270c33912bf107b3c7c217d199262cc74d56ffdb Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:37:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:37:01 +0000 Subject: libosmocore[master]: Add function to generate random identifier In-Reply-To: References: Message-ID: Patch Set 3: Note: the current version does not implement direct reading from /dev/urandom as a fallback when getrandom() is missing. Instead insecure rand() used and error is reported to caller. The reasons are twofold: 1) it's much simpler 2) that matches the way RAND_bytes() is used throughout OpenBSC. I can add it in future revisions if necessary. Also, there's no initialization for entropy pool: if there's insufficient entropy than we'll fail with error as described above. I'm not sure how can I initialize kernel's entropy pool programmatically (or if it's possible at all) - any ideas would be appreciated. -- 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: 3 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 Jun 9 12:40:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:40:42 +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 (#4). 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 insecure random generation is used as a fallback (which is clearly indicated to the caller). 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 instead. The size of the output is deliberately limited to decrease the chance of entropy pool depletion. It's still possible via successive calls but the caller can find a way to deplete the entropy anyway so it's not our concern. 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, 75 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/4 diff --git a/configure.ac b/configure.ac index 04d126e..b152b13 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +# 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 1ffe579..5429226 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -37,6 +37,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) */ @@ -59,6 +62,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); + /*! * \brief 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 7365ab7..7a2106f 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -69,6 +69,7 @@ #include #include +#include #include #include #include @@ -76,6 +77,12 @@ #include #include #include +#include + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#endif +#include #include "../../config.h" @@ -662,6 +669,62 @@ return arfcn; } +static inline void fallback_insecure_rand(uint8_t *out, size_t len) +{ + int i; + + srand(time(NULL)); + + for (i = 0; i < len; out[i++] = rand()); +} + +/*! \brief Generate random identifier + * \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; + + /* we use /dev/urandom (default when GRND_RANDOM flag is not set) which is fine as (at least on GNU/Linux >= 4.8) + both /dev/(u)random numbers are coming from the same CSPRNG anyway - see also RFC4086 */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#warning "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 +#warning "Insecure random fallback is used: no getrandom syscall available!" + /* Fallback for systems without getrandom() syscall */ + rc = 0; +#endif + if (rc < 0) { /* getrandom() failed entirely */ + switch (errno) { + case EAGAIN: /* the requested entropy is not available: fallback to insecure generator and let + application decide if it's OK with */ + fallback_insecure_rand(out, len); + default: /* intentional fall-through */ + return -errno; + } + } + + if (rc != len) { /* the system call was interrupted by a signal: this should not actually happen + (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 because we do not set + GRND_RANDOM but let's be paranoid and check/fallback anyway */ + fallback_insecure_rand(out + rc, len); + + return -EAGAIN; + } + + return 0; +} + void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn) { time->fn = fn; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 8fb9878..a3e8420 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 6b1e623..eba1663 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -33,6 +33,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -224,15 +225,8 @@ } 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); - } + if (osmo_get_rand_id(_rand, 16) < 0) + printf("WARNING: We're using really weak random numbers!\n\n"); } if (test_aud.type == OSMO_AUTH_TYPE_NONE || -- 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: 4 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 From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:41:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:41:31 +0000 Subject: osmo-bts[master]: cosmetic: remove unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 9 12:44:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:44:34 +0000 Subject: osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2813/3/src/osmo-bts-trx/l1_if.h File src/osmo-bts-trx/l1_if.h: Line 71: void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, struct gsm_lchan *lchan, Why do you need chan_nr and *lchan in parameters at the same time? Why can't you use chan->nr? -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 3 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 Jun 9 12:45:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:45:11 +0000 Subject: osmo-bts[master]: sysmobts: normalize frame number in measurement indication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 9 12:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:48:03 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/2861/2/src/osmo-bts-litecell15/l1_if.c File src/osmo-bts-litecell15/l1_if.c: Line 898: LOGPC(DL1C, ll, ", Meas: RSSI %-3.2f dBm, Qual %-3. l1sap->u.info.u.meas_ind.fn = fn;2f dB, " Looks like typo. If not than please explain why it's here. -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 2 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 Jun 9 12:51:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 12:51:06 +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 (#5). 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 insecure random generation is used as a fallback (which is clearly indicated to the caller). 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 instead. The size of the output is deliberately limited to decrease the chance of entropy pool depletion. It's still possible via successive calls but the caller can find a way to deplete the entropy anyway so it's not our concern. 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, 76 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1526/5 diff --git a/configure.ac b/configure.ac index 04d126e..b152b13 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,9 @@ AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) +# 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 1ffe579..5429226 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -37,6 +37,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) */ @@ -59,6 +62,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); + /*! * \brief 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 7365ab7..af8d853 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -69,6 +69,7 @@ #include #include +#include #include #include #include @@ -76,6 +77,13 @@ #include #include #include +#include + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) +#include +#elif HAVE_DECL_SYS_GETRANDOM +#include +#endif #include "../../config.h" @@ -662,6 +670,62 @@ return arfcn; } +static inline void fallback_insecure_rand(uint8_t *out, size_t len) +{ + int i; + + srand(time(NULL)); + + for (i = 0; i < len; out[i++] = rand()); +} + +/*! \brief Generate random identifier + * \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; + + /* we use /dev/urandom (default when GRND_RANDOM flag is not set) which is fine as (at least on GNU/Linux >= 4.8) + both /dev/(u)random numbers are coming from the same CSPRNG anyway - see also RFC4086 */ +#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) + rc = getrandom(out, len, GRND_NONBLOCK); +#elif HAVE_DECL_SYS_GETRANDOM +#warning "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 +#warning "Insecure random fallback is used: no getrandom syscall available!" + /* Fallback for systems without getrandom() syscall */ + rc = 0; +#endif + if (rc < 0) { /* getrandom() failed entirely */ + switch (errno) { + case EAGAIN: /* the requested entropy is not available: fallback to insecure generator and let + application decide if it's OK with */ + fallback_insecure_rand(out, len); + default: /* intentional fall-through */ + return -errno; + } + } + + if (rc != len) { /* the system call was interrupted by a signal: this should not actually happen + (according to getrandom(2)) as long as OSMO_MAX_RAND_ID_LEN < 256 because we do not set + GRND_RANDOM but let's be paranoid and check/fallback anyway */ + fallback_insecure_rand(out + rc, len); + + return -EAGAIN; + } + + return 0; +} + void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn) { time->fn = fn; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 8fb9878..a3e8420 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 6b1e623..eba1663 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -33,6 +33,7 @@ #include #include +#include static void dump_triplets_dat(struct osmo_auth_vector *vec) { @@ -224,15 +225,8 @@ } 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); - } + if (osmo_get_rand_id(_rand, 16) < 0) + printf("WARNING: We're using really weak random numbers!\n\n"); } if (test_aud.type == OSMO_AUTH_TYPE_NONE || -- 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: 5 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 From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:55:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 9 Jun 2017 12:55:40 +0000 Subject: osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/2854/7/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 179: self.status = SuiteRun.UNKNOWN > This is already set two lines below, no need for this line. heh, thanks. I think it came from rebase confusion: I had it committed in this patch, when testing the previous one I found it missing and added it there as well. Explains why I had a feeling of having fixed that before. -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 7 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 9 12:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 9 Jun 2017 12:56:01 +0000 Subject: [MERGED] osmo-gsm-tester[master]: refactor: fix error handling; fix log.Origin; only one trial In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: refactor: fix error handling; fix log.Origin; only one trial ...................................................................... refactor: fix error handling; fix log.Origin; only one trial A bit of refactoring to fix logging and error reporting, and simplify the code. This transmogrifies some of the things committed in 0ffb41440661631fa1d520c152be4cf8ebd4c46b "Add JUnit XML reports; refactor test reporting", which did not fully match the code structuring ideas used in osmo-gsm-tester. Also solve some problems present from the start of the code base. Though this is a bit of a code bomb, it would take a lot of time to separate this into smaller bits: these changes are closely related and resulted incrementally from testing error handling and logging details. I hope it's ok. Things changed / problems fixed: Allow only a single trial to be run per cmdline invocation: unbloat trial and suite invocation in osmo-gsm-tester.py. There is a SuiteDefinition, intended to be immutable, and a mutable SuiteRun. SuiteDefinition had a list of tests, which was modified by the SuiteRun to record test results. Instead, have only the test basenames in the SuiteDefinition and create a new set of Test() instances for each SuiteRun, to ensure that no state leaks between separate suite runs. State leaking across runs can be seen in http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/453/ where an earlier sms test for sysmo succeeds, but its state gets overwritten by the later sms test for trx that fails. The end result is that both tests failed, although the first run was successful. Fix a problem with Origin: log.Origin allowed to be __enter__ed more than once, skipping the second entry. The problem there is that we'd still __exit__ twice or more, popping the Origin off the stack even though it should still remain. We could count __enter__ recurrences, but instead, completely disallow entering a second time. A code path should have one 'with' statement per object, at pivotal points like run_suites or run_tests. Individual utility functions should not do 'with' on a central object. The structure needed is, in pseudo code: try: with trial: try: with suite_run: try: with test: test_actions() The 'with' needs to be inside the 'try', so that the exception can be handled in __exit__ before it reaches the exception logging. To clarify this, like test exceptions caught in Test.run(), also move suite exception handling from Trial into SuiteRun.run_tests(). There are 'with self' in Test.run() and SuiteRun.run_tests(), which are well placed, because these are pivotal points in the main code path. Log output: clearly separate logging of distinct suites and test scripts, by adding more large_separator() calls at the start of each test. Place these separator calls in more logical places. Add separator size and spacing args. Log output: print tracebacks only once, for the test script where they happen. Have less state that duplicates other state: drop SuiteRun.test_failed_ctr and suite.test_skipped_ctr, instead add SuiteRun.count_test_results(). For test failure reporting, store the traceback text in a separate member var. In the text report, apply above changes and unclutter to achieve a brief and easy to read result overview: print less filler characters, drop the starting times, drop the tracebacks. This can be found in the individual test logs. Because the tracebacks are no longer in the text report, the suite_test.py can just print the reports and expect that output instead of asserting individual contents. In the text report, print duration in precision of .1 seconds. Add origin information and a traceback text to the junit XML result to give more context when browsing the result XML. For 'AssertionError', add the source line of where the assertion hit. Drop the explicit Failure exception. We don't need one specific exception to mark a failure, instead any arbitrary exception is treated as a failure. Use the exception's class name as fail_type. Though my original idea was to use raising exceptions as the only way to cause a test failure, I'm keeping the set_fail() function as an alternative way, because it allows test specific cleanup and may come in handy later. To have both ways integrate seamlessly, shift some result setting into 'finally' clauses and make sure higher levels (suite, trial) count the contained items' stati. Minor tweak: write the 'pass' and 'skip' reports in lower case so that the 'FAIL' stands out. Minor tweak: pass the return code that the program exit should return further outward, so that the exit(1) call does not cause a SystemExit exception to be logged. The aims of this patch are: - Logs are readable so that it is clear which logging belongs to which test and suite. - The logging origins are correct (vs. parents gone missing as previously) - A single test error does not cause following tests or suites to be skipped. - An exception "above" Exception, i.e. SystemExit and the like, *does* immediately abort all tests and suites, and the results for tests that were not run are reported as "unknown" (rather than skipped on purpose): - Raising a SystemExit aborts all. - Hitting ctrl-c aborts all. - The resulting summary in the log is brief and readable. Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 --- M selftest/log_test.ok M selftest/log_test.py M selftest/suite_test.ok M selftest/suite_test.ok.ign M selftest/suite_test.py M selftest/suite_test/test_suite/test_fail_raise.py M src/osmo-gsm-tester.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py M suites/debug/fail.py M suites/debug/fail_raise.py 14 files changed, 305 insertions(+), 226 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/log_test.ok b/selftest/log_test.ok index b9f1465..7ed94a0 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -38,4 +38,4 @@ 01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] 01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] - Enter the same Origin context twice -01:02:03 tst level2: nested log [level1?level2] [log_test.py:159] +disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 46afb73..7670c8e 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -152,10 +152,13 @@ log.log_exn() print('- Enter the same Origin context twice') -with Thing('level1'): - l2 = Thing('level2') - with l2: - with l2: - l2.log('nested log') +try: + t = Thing('foo') + with t: + with t: + raise RuntimeError('this should not be reached') +except AssertionError: + print('disallowed successfully') + pass # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index fd4d743..54c950a 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] +--- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -24,7 +24,10 @@ - run hello world test cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir -tst test_suite: Suite run start + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] @@ -49,37 +52,93 @@ ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 label: m7802 path: /wavecom_1 -tst hello_world.py:[LINENR] START [test_suite?hello_world.py] + +---------------------------------------------- +trial test_suite hello_world.py +---------------------------------------------- tst hello_world.py:[LINENR]: hello world [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: I am 'test_suite' / 'hello_world.py:[LINENR]' [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: one [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] -tst hello_world.py:[LINENR] PASS [test_suite?hello_world.py] -tst test_suite: PASS -pass: all 6 tests passed (5 skipped). +tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] +--------------------------------------------------------------------- +trial test_suite PASS +--------------------------------------------------------------------- +PASS: test_suite (pass: 1, skip: 5) + pass: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py + skip: test_fail.py + skip: test_fail_raise.py - a test with an error -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_error.py:[LINENR] START [test_suite?test_error.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_error.py +---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: [test_error.py:[LINENR]: assert False] -tst test_error.py:[LINENR] FAIL (AssertionError) [test_suite?test_error.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + skip: test_fail.py + skip: test_fail_raise.py - a test with a failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail.py:[LINENR] START [test_suite?test_fail.py] [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail.py +---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + FAIL: test_fail.py (N.N sec) EpicFail: This failure is expected + skip: test_fail_raise.py - a test with a raised failure -tst test_suite: Suite run start [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR] START [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: I am 'test_suite' / 'test_fail_raise.py:[LINENR]' [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]] -tst test_fail_raise.py:[LINENR]: ERR: Failure: ('EpicFail', 'This failure is expected') [test_fail_raise.py:[LINENR]: raise Failure('EpicFail', 'This failure is expected')] -tst test_fail_raise.py:[LINENR] FAIL (EpicFail) [test_suite?test_fail_raise.py] [suite.py:[LINENR]] -tst test_suite: FAIL [suite.py:[LINENR]] + +--------------------------------------------------------------------- +trial test_suite +--------------------------------------------------------------------- + +---------------------------------------------- +trial test_suite test_fail_raise.py +---------------------------------------------- +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +--------------------------------------------------------------------- +trial test_suite FAIL +--------------------------------------------------------------------- +FAIL: test_suite (fail: 1, skip: 5) + skip: hello_world.py (N.N sec) + skip: mo_mt_sms.py + skip: mo_sms.py + skip: test_error.py (N.N sec) + skip: test_fail.py (N.N sec) + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] - graceful exit. diff --git a/selftest/suite_test.ok.ign b/selftest/suite_test.ok.ign index a19fb8b..dcda3b6 100644 --- a/selftest/suite_test.ok.ign +++ b/selftest/suite_test.ok.ign @@ -1,2 +1,3 @@ /[^ ]*/selftest/ [PATH]/selftest/ \.py:[0-9]* .py:[LINENR] +\([0-9.]+ sec\) (N.N sec) diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 16342c5..2a92f47 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,8 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -s = suite.SuiteRun(None, 'test_suite', s_def) +trial = log.Origin('trial') +s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) @@ -29,26 +30,17 @@ print('\n- a test with an error') results = s.run_tests('test_error.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_error.py]' in output -assert "type:'AssertionError' message: AssertionError()" in output -assert 'assert False' in output +print(output) print('\n- a test with a failure') results = s.run_tests('test_fail.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "test.set_fail('EpicFail', 'This failure is expected')" in output +print(output) print('\n- a test with a raised failure') results = s.run_tests('test_fail_raise.py') output = report.suite_to_text(s) -assert 'FAIL: [test_suite] 1 failed ' in output -assert 'FAIL: [test_fail_raise.py]' in output -assert "type:'EpicFail' message: This failure is expected" in output -assert "raise Failure('EpicFail', 'This failure is expected')" in output +print(output) print('\n- graceful exit.') # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/selftest/suite_test/test_suite/test_fail_raise.py b/selftest/suite_test/test_suite/test_fail_raise.py index a7b0b61..4e5eddb 100755 --- a/selftest/suite_test/test_suite/test_fail_raise.py +++ b/selftest/suite_test/test_suite/test_fail_raise.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -from osmo_gsm_tester.test import * - -print('I am %r / %r' % (suite.name(), test.name())) - -raise Failure('EpicFail', 'This failure is expected') +class ExpectedFail(Exception): + pass +raise ExpectedFail('This failure is expected') diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index 0402802..e481281 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -98,7 +98,7 @@ # is easiest to maintain. parser.add_argument('-V', '--version', action='store_true', help='Show version') - parser.add_argument('trial_package', nargs='+', + parser.add_argument('trial_package', help='Directory containing binaries to test') parser.add_argument('-s', '--suite-scenario', dest='suite_scenario', action='append', help='''A suite-scenarios combination @@ -128,7 +128,7 @@ print('combinations:', repr(args.suite_scenario)) print('series:', repr(args.series)) - print('trials:', repr(args.trial_package)) + print('trial:', repr(args.trial_package)) print('tests:', repr(args.test)) # create a default log to stdout @@ -157,72 +157,52 @@ if not combination_strs: raise RuntimeError('Need at least one suite:scenario or series to run') + # make sure all suite:scenarios exist suite_scenarios = [] for combination_str in combination_strs: suite_scenarios.append(suite.load_suite_scenario_str(combination_str)) + # pick tests and make sure they exist test_names = [] for test_name in (args.test or []): found = False if test_name.startswith('=') and not test_name.endswith('.py'): test_name = test_name + '.py' for suite_scenario_str, suite_def, scenarios in suite_scenarios: - for test in suite_def.tests: + for def_test_name in suite_def.test_basenames: if test_name.startswith('='): - match = test_name[1:] == test.name() + match = test_name[1:] == def_test_name else: - match = test_name in test.name() + match = test_name in def_test_name if match: found = True - test_names.append(test.name()) + test_names.append(def_test_name) if not found: raise RuntimeError('No test found for %r' % test_name) if test_names: + test_names = sorted(set(test_names)) print(repr(test_names)) - trials = [] - for trial_package in args.trial_package: - t = trial.Trial(trial_package) - t.verify() - trials.append(t) + with trial.Trial(args.trial_package) as current_trial: + current_trial.verify() + for suite_scenario_str, suite_def, scenarios in suite_scenarios: + current_trial.add_suite_run(suite_scenario_str, suite_def, scenarios) + current_trial.run_suites(test_names) - trials_run = [] - any_failed = False - - for current_trial in trials: - try: - with current_trial: - for suite_scenario_str, suite_def, scenarios in suite_scenarios: - suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios) - current_trial.add_suite(suite_run) - - status = current_trial.run_suites(test_names) - if status == trial.Trial.FAIL: - any_failed = True - trials_run.append(current_trial) - except Exception: - # Do not catch here subclasses of BaseException such as SystemExit, let them finish the program - any_failed = True - current_trial.log_exn() - - sys.stderr.flush() - sys.stdout.flush() - if not any_failed: - log.large_separator('All trials passed:\n ' + ('\n '.join(mytrial.name() for mytrial in trials_run))) - else: - for mytrial in trials_run: - log.large_separator('Trial Report for %s' % mytrial.name()) - mytrial.log_report() - exit(1) + if current_trial.status != trial.Trial.PASS: + return 1 + return 0 if __name__ == '__main__': + rc = 2 try: - main() + rc = main() except: # Tell the log to show the exception, then terminate the program with the exception anyway. # Since exceptions within test runs should be caught and evaluated, this is basically about # exceptions during command line parsing and such, so it's appropriate to abort immediately. log.log_exn() raise + exit(rc) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index fb6d55b..f098f2b 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -206,13 +206,16 @@ log_str = log_str + '\n' self.log_write_func(log_str) - def large_separator(self, *msgs): + def large_separator(self, *msgs, sublevel=1, space_above=True): + sublevel = max(1, min(3, sublevel)) msg = ' '.join(msgs) + sep = '-' * int(23 * (5 - sublevel)) if not msg: - msg = '------------------------------------------' - self.log_write_func('------------------------------------------\n' - '%s\n' - '------------------------------------------\n' % msg) + msg = sep + lines = [sep, msg, sep, ''] + if space_above: + lines.insert(0, '') + self.log_write_func('\n'.join(lines)) def level_str(level): if level == L_TRACEBACK: @@ -231,9 +234,9 @@ for target in LogTarget.all_targets: target.log(origin, category, level, src, messages, named_items) -def large_separator(*msgs): +def large_separator(*msgs, sublevel=1, space_above=True): for target in LogTarget.all_targets: - target.large_separator(*msgs) + target.large_separator(*msgs, sublevel=sublevel, space_above=space_above) def get_src_from_caller(levels_up=1): caller = getframeinfo(stack()[levels_up][0]) @@ -327,6 +330,9 @@ def err(self, *messages, **named_items): self._log(L_ERR, messages, named_items) + def trace(self, *messages, **named_items): + self._log(L_TRACEBACK, messages, named_items) + def log_exn(self, exc_info=None): log_exn(self, self._log_category, exc_info) @@ -373,10 +379,8 @@ def set_child_of(self, parent_origin): # avoid loops - if self._parent_origin is not None: - return False - if parent_origin == self: - return False + assert self._parent_origin is None + assert parent_origin is not self self._parent_origin = parent_origin return True diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index 7892fc6..ae63408 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -41,7 +41,7 @@ testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) - testsuite.set('failures', str(suite.test_failed_ctr)) + testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: testcase = test_to_junit(test) testsuite.append(testcase) @@ -54,31 +54,56 @@ if test.status == suite.Test.SKIP: skip = et.SubElement(testcase, 'skipped') elif test.status == suite.Test.FAIL: - failure = et.SubElement(testcase, 'failure') - failure.set('type', test.fail_type) - failure.text = test.fail_message + failure = et.SubElement(testcase, 'failure') + failure.set('type', test.fail_type or 'failure') + failure.text = test.fail_message + if test.fail_tb: + system_err = et.SubElement(testcase, 'system-err') + system_err.text = test.fail_tb return testcase def trial_to_text(trial): - msg = '\n%s [%s]\n ' % (trial.status, trial.name()) - msg += '\n '.join(suite_to_text(result) for result in trial.suites) - return msg + suite_failures = [] + count_fail = 0 + count_pass = 0 + for suite in trial.suites: + if suite.passed(): + count_pass += 1 + else: + count_fail += 1 + suite_failures.append(suite_to_text(suite)) + + summary = ['%s: %s' % (trial.name(), trial.status)] + if count_fail: + summary.append('%d suites failed' % count_fail) + if count_pass: + summary.append('%d suites passed' % count_pass) + msg = [', '.join(summary)] + msg.extend(suite_failures) + return '\n'.join(msg) def suite_to_text(suite): - if suite.test_failed_ctr: - return 'FAIL: [%s] %d failed out of %d tests run (%d skipped):\n %s' % ( - suite.name(), suite.test_failed_ctr, len(suite.tests), suite.test_skipped_ctr, - '\n '.join([test_to_text(t) for t in suite.tests])) if not suite.tests: return 'no tests were run.' - return 'pass: all %d tests passed (%d skipped).' % (len(suite.tests), suite.test_skipped_ctr) + + passed, skipped, failed = suite.count_test_results() + details = [] + if failed: + details.append('fail: %d' % failed) + if passed: + details.append('pass: %d' % passed) + if skipped: + details.append('skip: %d' % skipped) + msgs = ['%s: %s (%s)' % (suite.status, suite.name(), ', '.join(details))] + msgs.extend([test_to_text(t) for t in suite.tests]) + return '\n '.join(msgs) def test_to_text(test): - ret = "%s: [%s]" % (test.status, test.name()) - if test.status != suite.Test.SKIP: - ret += " (%s, %d sec)" % (datetime.fromtimestamp(round(test.start_timestamp)).isoformat(), test.duration) + msgs = ['%s: %s' % (test.status, test.name())] + if test.start_timestamp: + msgs.append('(%.1f sec)' % test.duration) if test.status == suite.Test.FAIL: - ret += " type:'%s' message: %s" % (test.fail_type, test.fail_message.replace('\n', '\n ')) - return ret + msgs.append('%s: %s' % (test.fail_type, test.fail_message)) + return ' '.join(msgs) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index fb6cf36..0dd8790 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -31,16 +31,6 @@ class Timeout(Exception): pass -class Failure(Exception): - '''Test failure exception, provided to be raised by tests. fail_type is - usually a keyword used to quickly identify the type of failure that - occurred. fail_msg is a more extensive text containing information about - the issue.''' - - def __init__(self, fail_type, fail_msg): - self.fail_type = fail_type - self.fail_msg = fail_msg - class SuiteDefinition(log.Origin): '''A test suite reserves resources for a number of tests. Each test requires a specific number of modems, BTSs etc., which are @@ -65,43 +55,32 @@ self.read_conf() def read_conf(self): - with self: - self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) - if not os.path.isdir(self.suite_dir): - raise RuntimeError('No such directory: %r' % self.suite_dir) - self.conf = config.read(os.path.join(self.suite_dir, - SuiteDefinition.CONF_FILENAME), - SuiteDefinition.CONF_SCHEMA) - self.load_tests() + self.dbg('reading %s' % SuiteDefinition.CONF_FILENAME) + if not os.path.isdir(self.suite_dir): + raise RuntimeError('No such directory: %r' % self.suite_dir) + self.conf = config.read(os.path.join(self.suite_dir, + SuiteDefinition.CONF_FILENAME), + SuiteDefinition.CONF_SCHEMA) + self.load_test_basenames() - def load_tests(self): - with self: - self.tests = [] - for basename in sorted(os.listdir(self.suite_dir)): - if not basename.endswith('.py'): - continue - self.tests.append(Test(self, basename)) + def load_test_basenames(self): + self.test_basenames = [] + for basename in sorted(os.listdir(self.suite_dir)): + if not basename.endswith('.py'): + continue + self.test_basenames.append(basename) - def add_test(self, test): - with self: - if not isinstance(test, Test): - raise ValueError('add_test(): pass a Test() instance, not %s' % type(test)) - if test.suite is None: - test.suite = self - if test.suite is not self: - raise ValueError('add_test(): test already belongs to another suite') - self.tests.append(test) class Test(log.Origin): UNKNOWN = 'UNKNOWN' - SKIP = 'SKIP' - PASS = 'PASS' + SKIP = 'skip' + PASS = 'pass' FAIL = 'FAIL' - def __init__(self, suite, test_basename): - self.suite = suite + def __init__(self, suite_run, test_basename): + self.suite_run = suite_run self.basename = test_basename - self.path = os.path.join(self.suite.suite_dir, self.basename) + self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) super().__init__(self.path) self.set_name(self.basename) self.set_log_category(log.C_TST) @@ -111,38 +90,38 @@ self.fail_type = None self.fail_message = None - def run(self, suite_run): - assert self.suite is suite_run.definition + def run(self): try: with self: + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(suite_run, self, ofono_client, sys.modules[__name__], event_loop) - self.log('START') + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite.name(), self.name()), + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) if self.status == Test.UNKNOWN: self.set_pass() except Exception as e: - self.log_exn() - if isinstance(e, Failure): - ftype = e.fail_type - fmsg = e.fail_msg + '\n' + traceback.format_exc().rstrip() + if hasattr(e, 'msg'): + msg = e.msg else: - ftype = type(e).__name__ - fmsg = repr(e) + '\n' + traceback.format_exc().rstrip() - if isinstance(e, resource.NoResourceExn): - fmsg += suite_run.resource_status_str() - - self.set_fail(ftype, fmsg, False) - - finally: - if self.status == Test.PASS or self.status == Test.SKIP: - self.log(self.status) - else: - self.log('%s (%s)' % (self.status, self.fail_type)) - return self.status + msg = str(e) + if isinstance(e, AssertionError): + # AssertionError lacks further information on what was + # asserted. Find the line where the code asserted: + msg += log.get_src_from_tb(sys.exc_info()[2]) + # add source file information to failure report + if hasattr(e, 'origins'): + msg += ' [%s]' % e.origins + tb_str = traceback.format_exc() + if isinstance(e, resource.NoResourceExn): + tb_str += self.suite_run.resource_status_str() + self.set_fail(type(e).__name__, msg, tb_str) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TEST RUN ABORTED: %s' % type(e).__name__) + raise def name(self): l = log.get_line_for_src(self.path) @@ -150,17 +129,26 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb=True): + def set_fail(self, fail_type, fail_message, tb_str=None): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type self.fail_message = fail_message - if tb: - self.fail_message += '\n' + ''.join(traceback.format_stack()[:-1]).rstrip() + + if tb_str is None: + # populate an exception-less call to set_fail() with traceback info + tb_str = ''.join(traceback.format_stack()[:-1]) + + self.fail_tb = tb_str + self.err('%s: %s' % (self.fail_type, self.fail_message)) + if self.fail_tb: + self.trace(self.fail_tb) + self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): self.status = Test.PASS self.duration = time.time() - self.start_timestamp + self.log('Test passed (%.1f sec)' % self.duration) def set_skip(self): self.status = Test.SKIP @@ -172,6 +160,7 @@ FAIL = 'FAIL' trial = None + status = None resources_pool = None reserved_resources = None objects_to_clean_up = None @@ -179,13 +168,20 @@ _config = None _processes = None - def __init__(self, current_trial, suite_scenario_str, suite_definition, scenarios=[]): - self.trial = current_trial + def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + self.trial = trial self.definition = suite_definition self.scenarios = scenarios self.set_name(suite_scenario_str) self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() + self.status = SuiteRun.UNKNOWN + self.load_tests() + + def load_tests(self): + self.tests = [] + for test_basename in self.definition.test_basenames: + self.tests.append(Test(self, test_basename)) def register_for_cleanup(self, *obj): assert all([hasattr(o, 'cleanup') for o in obj]) @@ -198,11 +194,8 @@ obj.cleanup() def mark_start(self): - self.tests = [] self.start_timestamp = time.time() self.duration = 0 - self.test_failed_ctr = 0 - self.test_skipped_ctr = 0 self.status = SuiteRun.UNKNOWN def combined(self, conf_name): @@ -233,27 +226,27 @@ if self.reserved_resources: raise RuntimeError('Attempt to reserve resources twice for a SuiteRun') self.log('reserving resources in', self.resources_pool.state_dir, '...') - with self: - self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) def run_tests(self, names=None): - self.log('Suite run start') try: - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.definition.tests: - if names and not test.name() in names: - test.set_skip() - self.test_skipped_ctr += 1 - self.tests.append(test) - continue - with self: - st = test.run(self) - if st == Test.FAIL: - self.test_failed_ctr += 1 - self.tests.append(test) + with self: + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() + except Exception: + self.log_exn() + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('SUITE RUN ABORTED: %s' % type(e).__name__) + raise finally: # if sys.exit() called from signal handler (e.g. SIGINT), SystemExit # base exception is raised. Make sure to stop processes in this @@ -261,14 +254,33 @@ self.stop_processes() self.objects_cleanup() self.free_resources() - event_loop.unregister_poll_func(self.poll) - self.duration = time.time() - self.start_timestamp - if self.test_failed_ctr: - self.status = SuiteRun.FAIL - else: - self.status = SuiteRun.PASS - self.log(self.status) - return self.status + event_loop.unregister_poll_func(self.poll) + self.duration = time.time() - self.start_timestamp + + passed, skipped, failed = self.count_test_results() + # if no tests ran, count it as failure + if passed and not failed: + self.status = SuiteRun.PASS + else: + self.status = SuiteRun.FAIL + + log.large_separator(self.trial.name(), self.name(), self.status, sublevel=2, space_above=False) + + def passed(self): + return self.status == SuiteRun.PASS + + def count_test_results(self): + passed = 0 + skipped = 0 + failed = 0 + for test in self.tests: + if test.status == Test.PASS: + passed += 1 + elif test.status == Test.FAIL: + failed += 1 + else: + skipped += 1 + return (passed, skipped, failed) def remember_to_stop(self, process): if self._processes is None: diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 74cebea..45ac602 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,7 +33,6 @@ poll = None prompt = None Timeout = None -Failure = None def setup(suite_run, _test, ofono_client, suite_module, event_module): global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout @@ -49,7 +48,6 @@ sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) poll = event_module.poll prompt = suite_run.prompt - Failure = suite_module.Failure Timeout = suite_module.Timeout # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 3d04de8..11f8a15 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -79,15 +79,15 @@ log.FileLogTarget(run_dir.new_child(FILE_LOG_BRIEF)) .style_change(src=False, all_origins_on_levels=(log.L_ERR, log.L_TRACEBACK)) ] - self.log('Trial start') + log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() super().__enter__() + return self def __exit__(self, *exc_info): super().__exit__(*exc_info) - self.log('Trial end') - + self.log_report() for lt in self.log_targets: lt.remove() self.log_targets = None @@ -182,25 +182,30 @@ except: pass - def add_suite(self, suite_run): + def add_suite_run(self, suite_scenario_str, suite_def, scenarios): + suite_run = suite.SuiteRun(self, suite_scenario_str, suite_def, scenarios) self.suites.append(suite_run) def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - log.large_separator(self.name(), suite_run.name()) - st = suite_run.run_tests(names) - if st == suite.SuiteRun.FAIL: - self.status = Trial.FAIL - elif self.status == Trial.UNKNOWN: - self.status = Trial.PASS - self.log(self.status) + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS junit_path = self.get_run_dir().new_file(self.name()+'.xml') self.log('Storing JUnit report in', junit_path) report.trial_to_junit_write(self, junit_path) - return self.status def log_report(self): + log.large_separator(self.name(), self.status) self.log(report.trial_to_text(self)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/debug/fail.py b/suites/debug/fail.py index fcd56e0..8e30578 100644 --- a/suites/debug/fail.py +++ b/suites/debug/fail.py @@ -2,4 +2,4 @@ from osmo_gsm_tester.test import * # This can be used to verify that a test failure is reported properly. -test.set_fail('EpicFail', 'This failure is expected') +test.set_fail('ExpectedFail', 'This failure is expected') diff --git a/suites/debug/fail_raise.py b/suites/debug/fail_raise.py index 22fb940..336029b 100644 --- a/suites/debug/fail_raise.py +++ b/suites/debug/fail_raise.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * +class ExpectedExn(Exception): + pass + # This can be used to verify that a test failure is reported properly. -raise Failure('EpicFail', 'This failure is expected') +raise ExpectedExn('This failure is expected') -- To view, visit https://gerrit.osmocom.org/2853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf0846d457cab26f54c25e6906a8bb304724e2d8 Gerrit-PatchSet: 7 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 Fri Jun 9 12:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 9 Jun 2017 12:56:01 +0000 Subject: [MERGED] osmo-gsm-tester[master]: error log: clarify for using more resources than reserved In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: error log: clarify for using more resources than reserved ...................................................................... error log: clarify for using more resources than reserved Figure out how many resources were reserved, how many of those match the requirements, and how many are used, and log one of three matching error messages for that situation. For that purpose, allow find()ing reserved resources without logging anything, using a log_label=None arg. Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 --- M src/osmo_gsm_tester/resource.py 1 file changed, 17 insertions(+), 6 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 52b23c7..7cc32bb 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -301,7 +301,8 @@ # list item contains specifics for the particular BTS. my_list = self.get(key, []) - for_origin.log(log_label, len(want_list), 'x', key, '(candidates: %d)'%len(my_list)) + if log_label: + for_origin.log(log_label, len(want_list), 'x', key, '(candidates: %d)'%len(my_list)) # Try to avoid a less constrained item snatching away a resource # from a more detailed constrained requirement. @@ -472,11 +473,21 @@ available = available_dict.get(kind) self.dbg(available=len(available)) if not available: - raise NoResourceExn('When trying to reserve %r nr %d: No unused resource found%s' % - (kind, - self.count(kind) + 1, - (' matching %r' % specifics) if specifics else '') - ) + # cook up a detailed error message for the current situation + kind_reserved = self.reserved.get(kind, []) + used_count = len([r for r in kind_reserved if USED_KEY in r]) + matching = self.reserved.find(self.origin, want, raise_if_missing=False, log_label=None).get(kind, []) + if not matching: + msg = 'none of the reserved resources matches requirements %r' % specifics + elif not (used_count < len(kind_reserved)): + msg = 'suite.conf reserved only %d x %r.' % (len(kind_reserved), kind) + else: + msg = ('No unused resource left that matches the requirements;' + ' Of reserved %d x %r, %d match the requirements, but all are already in use;' + ' Requirements: %r' + % (len(kind_reserved), kind, len(matching), specifics)) + raise NoResourceExn('When trying to use instance nr %d of %r: %s' % (used_count + 1, kind, msg)) + pick = available[0] self.dbg(using=pick) assert not pick.get(USED_KEY) -- To view, visit https://gerrit.osmocom.org/2852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c67600ba69351859e46b8b2f368ee8106db0993 Gerrit-PatchSet: 4 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 Fri Jun 9 12:58:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 9 Jun 2017 12:58:26 +0000 Subject: [PATCH] osmo-gsm-tester[master]: junit result: also write for aborted runs 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/2854 to look at the new patch set (#8). junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 25 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/2854/8 diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..82b2f13 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + elif test.status != suite.Test.PASS: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 0dd8790..55f81b1 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -161,6 +161,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 11f8a15..741f3a7 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -188,21 +188,23 @@ def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - suite_run.run_tests(names) - except BaseException as e: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) - raise - finally: - if suite_run.status != suite.SuiteRun.PASS: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) + try: + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + self.log('Storing JUnit report in', junit_path) + report.trial_to_junit_write(self, junit_path) def log_report(self): log.large_separator(self.name(), self.status) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 8 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 Fri Jun 9 13:32:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 13:32:31 +0000 Subject: osmo-bts[master]: Remove incorrect BTS number check In-Reply-To: References: Message-ID: Patch Set 1: I'll update OS#2317 with related questions - please follow-up discussion there. -- To view, visit https://gerrit.osmocom.org/2846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3d5078ed1239d553c7200ceb5b08b638df33a15 Gerrit-PatchSet: 1 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 Fri Jun 9 14:10:04 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 14:10:04 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2861 to look at the new patch set (#3). osmo-bts-litecell15: Fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. This commit changes process_meas_res() to properly include the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap) Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/3 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 5977aa9..22a33d8 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -901,7 +901,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -912,6 +912,10 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + l1sap.u.info.u.meas_ind.fn = fn; + + /* FIXME: The frame number most likely will require some alignment + * in order to match the lookup tables in the higher layers. */ /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +945,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 3 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 Jun 9 14:10:05 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 14:10:05 +0000 Subject: [PATCH] osmo-bts[master]: octphy: fix segfault Message-ID: Review at https://gerrit.osmocom.org/2865 octphy: fix segfault The priv pointer of the callback function app_info_compl_cb() is set to null by the pointer. It should be set to pinst instead. Besides of that there is a memory violation while accessing the local variable ver_hdr using osmo_strlcpy(). Both is fixed with this commit. Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806 --- M src/osmo-bts-octphy/l1_oml.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/65/2865/1 diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index ccef231..03ff547 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1151,9 +1151,9 @@ tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *air = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *) resp->l2h; - sprintf(ver_hdr, "%02i.%02i.%02i-B%i", cOCTVC1_MAIN_VERSION_MAJOR, - cOCTVC1_MAIN_VERSION_MINOR, cOCTVC1_MAIN_VERSION_MAINTENANCE, - cOCTVC1_MAIN_VERSION_BUILD); + snprintf(ver_hdr, sizeof(ver_hdr), "%02i.%02i.%02i-B%i", + cOCTVC1_MAIN_VERSION_MAJOR, cOCTVC1_MAIN_VERSION_MINOR, + cOCTVC1_MAIN_VERSION_MAINTENANCE, cOCTVC1_MAIN_VERSION_BUILD); mOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP_SWAP(air); @@ -1171,7 +1171,8 @@ talloc_replace(fl1h->info.app.name, fl1h, air->szName); talloc_replace(fl1h->info.app.description, fl1h, air->szDescription); talloc_replace(fl1h->info.app.version, fl1h, air->szVersion); - osmo_strlcpy(pinst->version, ver_hdr, sizeof(pinst->version)); + OSMO_ASSERT(strlen(ver_hdr) < sizeof(pinst->version)); + osmo_strlcpy(pinst->version, ver_hdr, strlen(ver_hdr)); /* in a completion call-back, we take msgb ownership and must * release it before returning */ @@ -1196,7 +1197,7 @@ LOGP(DL1C, LOGL_INFO, "Tx APP-INFO.req\n"); - return l1if_req_compl(fl1h, msg, app_info_compl_cb, 0); + return l1if_req_compl(fl1h, msg, app_info_compl_cb, pinst); } static int trx_close_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data) -- To view, visit https://gerrit.osmocom.org/2865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 9 14:12:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 14:12:35 +0000 Subject: osmo-bts[master]: octphy: fix segfault In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 9 14:31:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:31:01 +0000 Subject: osmo-bts[master]: octphy: fix segfault In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 9 14:31:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:31:03 +0000 Subject: [MERGED] osmo-bts[master]: octphy: fix segfault In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: fix segfault ...................................................................... octphy: fix segfault The priv pointer of the callback function app_info_compl_cb() is set to null by the pointer. It should be set to pinst instead. Besides of that there is a memory violation while accessing the local variable ver_hdr using osmo_strlcpy(). Both is fixed with this commit. Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806 --- M src/osmo-bts-octphy/l1_oml.c 1 file changed, 6 insertions(+), 5 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/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index ccef231..03ff547 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1151,9 +1151,9 @@ tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *air = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP *) resp->l2h; - sprintf(ver_hdr, "%02i.%02i.%02i-B%i", cOCTVC1_MAIN_VERSION_MAJOR, - cOCTVC1_MAIN_VERSION_MINOR, cOCTVC1_MAIN_VERSION_MAINTENANCE, - cOCTVC1_MAIN_VERSION_BUILD); + snprintf(ver_hdr, sizeof(ver_hdr), "%02i.%02i.%02i-B%i", + cOCTVC1_MAIN_VERSION_MAJOR, cOCTVC1_MAIN_VERSION_MINOR, + cOCTVC1_MAIN_VERSION_MAINTENANCE, cOCTVC1_MAIN_VERSION_BUILD); mOCTVC1_MAIN_MSG_APPLICATION_INFO_RSP_SWAP(air); @@ -1171,7 +1171,8 @@ talloc_replace(fl1h->info.app.name, fl1h, air->szName); talloc_replace(fl1h->info.app.description, fl1h, air->szDescription); talloc_replace(fl1h->info.app.version, fl1h, air->szVersion); - osmo_strlcpy(pinst->version, ver_hdr, sizeof(pinst->version)); + OSMO_ASSERT(strlen(ver_hdr) < sizeof(pinst->version)); + osmo_strlcpy(pinst->version, ver_hdr, strlen(ver_hdr)); /* in a completion call-back, we take msgb ownership and must * release it before returning */ @@ -1196,7 +1197,7 @@ LOGP(DL1C, LOGL_INFO, "Tx APP-INFO.req\n"); - return l1if_req_compl(fl1h, msg, app_info_compl_cb, 0); + return l1if_req_compl(fl1h, msg, app_info_compl_cb, pinst); } static int trx_close_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data) -- To view, visit https://gerrit.osmocom.org/2865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Fri Jun 9 14:32:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:32:05 +0000 Subject: osmo-bts[master]: cosmetic: remove unused variable In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 9 14:32:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:32:07 +0000 Subject: osmo-bts[master]: sysmobts: normalize frame number in measurement indication In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 9 14:32:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:32:09 +0000 Subject: osmo-bts[master]: Revert "measurement: exclude idle channels from uplink measu... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 9 14:33:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:33:19 +0000 Subject: [MERGED] osmo-bts[master]: Revert "measurement: exclude idle channels from uplink measu... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Revert "measurement: exclude idle channels from uplink measurement" ...................................................................... Revert "measurement: exclude idle channels from uplink measurement" The offsets used in the lookup tables may be phy dependand. So we will have to do the alignment in the layer 1 interface of the phy dependand code before we report the frame number up to the higher layers. This reverts commit e0fb3ae52d747b26b6487ec67c79eceaf37a125c. Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c --- M src/common/measurement.c 1 file changed, 24 insertions(+), 29 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/measurement.c b/src/common/measurement.c index a84cf7a..0c86faf 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -24,40 +24,35 @@ * 7 6 and 7 91 to 90 103, 25, 51, 77 */ /* measurement period ends at fn % 104 == ? */ -/* Added (-1) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103 - 1, - [1] = 12 - 1, - [2] = 25 - 1, - [3] = 38 - 1, - [4] = 51 - 1, - [5] = 64 - 1, - [6] = 77 - 1, - [7] = 90 - 1, + [0] = 103, + [1] = 12, + [2] = 25, + [3] = 38, + [4] = 51, + [5] = 64, + [6] = 77, + [7] = 90, }; - -/* Added (-2) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchh0_meas_rep_fn104[] = { - [0] = 103 - 2, - [1] = 103 - 2, - [2] = 25 - 2, - [3] = 25 - 2, - [4] = 51 - 2, - [5] = 51 - 2, - [6] = 77 - 2, - [7] = 77 - 2, + [0] = 103, + [1] = 103, + [2] = 25, + [3] = 25, + [4] = 51, + [5] = 51, + [6] = 77, + [7] = 77, }; - -/* Added (-1) offset in DATA-IND frame number to align with Meas period ends */ static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12 - 1, - [1] = 12 - 1, - [2] = 38 - 1, - [3] = 38 - 1, - [4] = 64 - 1, - [5] = 64 - 1, - [6] = 90 - 1, - [7] = 90 - 1, + [0] = 12, + [1] = 12, + [2] = 38, + [3] = 38, + [4] = 64, + [5] = 64, + [6] = 90, + [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan -- To view, visit https://gerrit.osmocom.org/2862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 9 14:33:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:33:20 +0000 Subject: [MERGED] osmo-bts[master]: sysmobts: normalize frame number in measurement indication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmobts: normalize frame number in measurement indication ...................................................................... sysmobts: normalize frame number in measurement indication The higher layers relay on a normalized version of frame number in order to detect the end of a measurement period. The frame number on which the measurement reports are sent may depend on the phy, so we need to normalize the frame number before we report it to the higher layers. Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 10 insertions(+), 2 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/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 79fccd9..a83816e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,12 +897,14 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_PhDataInd_t *data_ind) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_INDICATION, NULL); + GsmL1_MeasParam_t *m = &data_ind->measParam; + l1sap.u.info.type = PRIM_INFO_MEAS; l1sap.u.info.u.meas_ind.chan_nr = chan_nr; l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; @@ -913,6 +915,12 @@ * physical radio link, the uplink is delayed by 3 timeslots, we need * to compensate for that delay. */ l1sap.u.info.u.meas_ind.fn = fn + 3; + + /* Align frame number with measurement period ends */ + if (data_ind->sapi == GsmL1_Sapi_TchF) + l1sap.u.info.u.meas_ind.fn += 1; + else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == GsmL1_SubCh_0) + l1sap.u.info.u.meas_ind.fn += 1; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +949,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, data_ind); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Fri Jun 9 14:33:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 9 Jun 2017 14:33:20 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: remove unused variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: remove unused variable ...................................................................... cosmetic: remove unused variable Tha variable ms_timing_offset in lchan_meas_check_compute is not used anymore. Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c --- M src/common/measurement.c 1 file changed, 0 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/measurement.c b/src/common/measurement.c index 0c86faf..bd2af7e 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -245,7 +245,6 @@ int32_t taqb_sum = 0; unsigned int num_meas_sub = 0; int i; - int32_t ms_timing_offset = 0; /* if measurement period is not complete, abort */ if (!is_meas_complete(ts_pchan(lchan->ts), lchan->ts->nr, -- To view, visit https://gerrit.osmocom.org/2864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Fri Jun 9 14:34:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 14:34:06 +0000 Subject: [PATCH] osmo-bts[master]: OML: move BTS number check into separate function Message-ID: Review at https://gerrit.osmocom.org/2866 OML: move BTS number check into separate function * move code which checks for BTS number (obtained via OML) validity into separate function * adjust log messages to match the check * add spec reference and comments Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230 Related: OS#2317 --- M src/common/oml.c 1 file changed, 34 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/66/2866/1 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..8d5dd4a 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -980,6 +980,38 @@ return bts_model_chg_adm_state(bts, mo, obj, adm_state); } +/* Check and report if the BTS number received via OML is incorrect: + according to 3GPP TS 52.021 ?9.3 BTS number is used to distinguish between different BTS of the same Site Manager. + As we always have only single BTS per Site Manager (in case of Abis/IP with each BTS having dedicated OML connection + to BSC), the only valid values are 0 and 0xFF (means all BTS' of a given Site Manager). */ +static inline bool report_bts_number_incorrect(struct gsm_bts *bts, const struct abis_om_fom_hdr *foh, bool is_formatted) +{ + struct gsm_bts_trx *trx; + struct gsm_abis_mo *mo = &bts->mo; + const char *form = is_formatted ? + "Unexpected BTS %d in formatted O&M %s (exp. 0 or 0xFF)" : + "Unexpected BTS %d in manufacturer O&M %s (exp. 0 or 0xFF)"; + + if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { + LOGP(DOML, LOGL_ERROR, form, foh->obj_inst.bts_nr, get_value_string(abis_nm_msgtype_names, + foh->msg_type)); + LOGPC(DOML, LOGL_ERROR, "\n"); + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + mo = &trx->mo; + } + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UKWN_MSG, form, foh->obj_inst.bts_nr, + get_value_string(abis_nm_msgtype_names, foh->msg_type)); + + return true; + } + + return false; +} + static int down_fom(struct gsm_bts *bts, struct msgb *msg) { struct abis_om_fom_hdr *foh = msgb_l3(msg); @@ -999,20 +1031,8 @@ return -EIO; } - if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); - trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); - if (trx) { - trx->mo.obj_inst.bts_nr = 0; - trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; - trx->mo.obj_inst.ts_nr = 0xff; - oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, - "Formatted O&M with BTS %d out" - " of range (0:0xFF)", - foh->obj_inst.bts_nr); - } + if (report_bts_number_incorrect(bts, foh, true)) return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); - } switch (foh->msg_type) { case NM_MT_SET_BTS_ATTR: @@ -1302,10 +1322,8 @@ msg->l3h = oh->data + 1 + idstrlen; foh = (struct abis_om_fom_hdr *) msg->l3h; - if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Manufacturer O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + if (report_bts_number_incorrect(bts, foh, false)) return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); - } ret = oml_tlv_parse(&tp, foh->data, oh->length - sizeof(*foh)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/2866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 9 14:56:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 14:56:26 +0000 Subject: [PATCH] osmo-bts[master]: Extend Get Attribute responder 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/2786 to look at the new patch set (#6). Extend Get Attribute responder * detect if attributes are requested for BTS or TRX and act accordingly * report TRX phy version Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Related: OS#1614 --- M src/common/oml.c 1 file changed, 44 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/2786/6 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..5c711cf 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include #include #include +#include static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg); @@ -153,37 +154,60 @@ return mo_buf; } -static inline struct msgb *add_bts_attr(const struct gsm_bts *bts) +static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - struct msgb *a = oml_msgb_alloc(); - - if (!a) - return NULL; - - abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); - abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + abis_nm_put_sw_file(msg, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); + abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); if (strlen(bts->sub_model)) - abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); - - return a; + abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } -static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len, uint8_t *out) +static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + + abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown", + true); +} + +/* copy all the attributes accumulated in msg to out and return the total length of out buffer */ +static inline int cleanup_attr_msg(uint8_t *out, int out_offset, struct msgb *msg) +{ + int len = 0; + + if (msg) { + memcpy(out + out_offset, msgb_data(msg), msg->len); + len = msg->len; + msgb_free(msg); + } + + return len + out_offset + 1; +} + +/* assemble values of supported attributes and list of unsupported ones */ +static inline int handle_attrs(const struct gsm_bts *bts, const struct gsm_abis_mo *mo, + const uint8_t *attr, uint16_t attr_len, uint8_t *out) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *ba = NULL; - int length; + struct msgb *attr_buf = oml_msgb_alloc(); + + if (!attr_buf) + return -ENOMEM; for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: switch (mo->obj_class) { case NM_OC_BTS: - ba = add_bts_attr(mo->bts); + add_bts_attrs(attr_buf, mo->bts); + break; + case NM_OC_BASEB_TRANSC: + add_trx_attr(attr_buf, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr)); break; default: - LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute " + "Response(NM_ATT_SW_CONFIG)\n", get_value_string(abis_nm_obj_class_names, mo->obj_class)); return -EINVAL; } @@ -204,19 +228,11 @@ } else out[0] = attr_out_index - 1; /* Count number of unhandled attributes */ - length = attr_out_index + 1; - - if (ba) { - memcpy(out + attr_out_index, msgb_data(ba), ba->len); - length += ba->len; - msgb_free(ba); - } - - return length; + return cleanup_attr_msg(out, attr_out_index, attr_buf); } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ @@ -227,7 +243,7 @@ if (!nmsg) return -ENOMEM; - len = handle_attr(mo, attr, attr_len, resp); + len = handle_attrs(bts, mo, attr, attr_len, resp); if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); msgb_free(nmsg); @@ -489,7 +505,7 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 6 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 Fri Jun 9 14:57:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 14:57:25 +0000 Subject: osmo-bts[master]: Extend Get Attribute responder In-Reply-To: References: Message-ID: Patch Set 5: I'll move stuff related to nominal power into separate patch and will implement using new IE there. -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 5 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 Fri Jun 9 15:11:01 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 9 Jun 2017 15:11:01 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-octphy: normalize frame number in MEAS IND Message-ID: Review at https://gerrit.osmocom.org/2867 osmo-bts-octphy: normalize frame number in MEAS IND The higher layers will no longer care for the alignment of the frame number in order to detect when a measurement period ends. This patch normalizes the frame number directly in the measurement indication so that the higher layers can detect the end of a measurement period properly. Change-Id: I0d369ff9e6da34f4bd98afd3c5d030cac73e54c0 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/2867/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 042ecc3..24a8646 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -792,7 +792,7 @@ ***********************************************************************/ static void process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, uint32_t data_len, + uint8_t sc, uint32_t fn, uint32_t data_len, tOCTVC1_GSM_MEASUREMENT_INFO * m) { struct osmo_phsap_prim l1sap; @@ -830,6 +830,12 @@ /* copy logical frame number to MEAS IND data structure */ l1sap.u.info.u.meas_ind.fn = fn; + + /* Align frame number with measurement period ends */ + if (sc == 0) + l1sap.u.info.u.meas_ind.fn += 2; /* tchh0 */ + else + l1sap.u.info.u.meas_ind.fn += 1; /* tchh1 and tchf */ /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -1035,7 +1041,7 @@ memset(&l1sap, 0, sizeof(l1sap)); /* uplink measurement */ - process_meas_res(trx, chan_nr, fn, data_ind->Data.ulDataLength, + process_meas_res(trx, chan_nr, sc, fn, data_ind->Data.ulDataLength, &data_ind->MeasurementInfo); /* FIXME: check min_qual_norm! */ -- To view, visit https://gerrit.osmocom.org/2867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d369ff9e6da34f4bd98afd3c5d030cac73e54c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 9 15:23:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 15:23:17 +0000 Subject: [PATCH] osmo-bts[master]: Extend Get Attribute responder 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/2786 to look at the new patch set (#7). Extend Get Attribute responder * detect if attributes are requested for BTS or TRX and act accordingly * report TRX phy version Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Related: OS#1614 --- M src/common/oml.c 1 file changed, 48 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/2786/7 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..b5b4278 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include #include #include +#include static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg); @@ -153,37 +154,63 @@ return mo_buf; } -static inline struct msgb *add_bts_attr(const struct gsm_bts *bts) +static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - struct msgb *a = oml_msgb_alloc(); - - if (!a) - return NULL; - - abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); - abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + abis_nm_put_sw_file(msg, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); + abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); if (strlen(bts->sub_model)) - abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); - - return a; + abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } -static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len, uint8_t *out) +static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + + abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown", + true); +} + +/* copy all the attributes accumulated in msg to out and return the total length of out buffer */ +static inline int cleanup_attr_msg(uint8_t *out, int out_offset, struct msgb *msg) +{ + int len = 0; + + if (msg) { + memcpy(out + out_offset, msgb_data(msg), msg->len); + len = msg->len; + msgb_free(msg); + } + + return len + out_offset + 1; +} + +/* assemble values of supported attributes and list of unsupported ones */ +static inline int handle_attrs(const struct gsm_bts *bts, const struct gsm_abis_mo *mo, + const uint8_t *attr, uint16_t attr_len, uint8_t *out) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *ba = NULL; - int length; + struct msgb *attr_buf = oml_msgb_alloc(); + + if (!attr_buf) + return -ENOMEM; + + if (!mo) + return -EINVAL; for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: switch (mo->obj_class) { case NM_OC_BTS: - ba = add_bts_attr(mo->bts); + add_bts_attrs(attr_buf, mo->bts); + break; + case NM_OC_BASEB_TRANSC: + add_trx_attr(attr_buf, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr)); break; default: - LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute " + "Response(NM_ATT_SW_CONFIG)\n", get_value_string(abis_nm_obj_class_names, mo->obj_class)); return -EINVAL; } @@ -204,19 +231,11 @@ } else out[0] = attr_out_index - 1; /* Count number of unhandled attributes */ - length = attr_out_index + 1; - - if (ba) { - memcpy(out + attr_out_index, msgb_data(ba), ba->len); - length += ba->len; - msgb_free(ba); - } - - return length; + return cleanup_attr_msg(out, attr_out_index, attr_buf); } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ @@ -227,7 +246,7 @@ if (!nmsg) return -ENOMEM; - len = handle_attr(mo, attr, attr_len, resp); + len = handle_attrs(bts, mo, attr, attr_len, resp); if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); msgb_free(nmsg); @@ -483,13 +502,13 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - if (!TLVP_PRESENT(&tp, NM_ATT_LIST_REQ_ATTR)) { + if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) { LOGP(DOML, LOGL_ERROR, "O&M Get Attributes message without Attribute List?!\n"); oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 7 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 Fri Jun 9 15:37:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 15:37:45 +0000 Subject: [PATCH] osmo-bts[master]: Extend Get Attribute responder 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/2786 to look at the new patch set (#8). Extend Get Attribute responder * detect if attributes are requested for BTS or TRX and act accordingly * report TRX phy version Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Related: OS#1614 --- M src/common/oml.c 1 file changed, 49 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/2786/8 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..233da67 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include #include #include +#include static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg); @@ -153,37 +154,63 @@ return mo_buf; } -static inline struct msgb *add_bts_attr(const struct gsm_bts *bts) +static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - struct msgb *a = oml_msgb_alloc(); - - if (!a) - return NULL; - - abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); - abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + abis_nm_put_sw_file(msg, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); + abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); if (strlen(bts->sub_model)) - abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); - - return a; + abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } -static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len, uint8_t *out) +static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + + abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown", + true); +} + +/* copy all the attributes accumulated in msg to out and return the total length of out buffer */ +static inline int cleanup_attr_msg(uint8_t *out, int out_offset, struct msgb *msg) +{ + int len = 0; + + if (msg) { + memcpy(out + out_offset, msgb_data(msg), msg->len); + len = msg->len; + msgb_free(msg); + } + + return len + out_offset + 1; +} + +/* assemble values of supported attributes and list of unsupported ones */ +static inline int handle_attrs(const struct gsm_bts *bts, const struct gsm_abis_mo *mo, + const uint8_t *attr, uint16_t attr_len, uint8_t *out) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *ba = NULL; - int length; + struct msgb *attr_buf = oml_msgb_alloc(); + + if (!attr_buf) + return -ENOMEM; + + if (!mo) + return -EINVAL; for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: switch (mo->obj_class) { case NM_OC_BTS: - ba = add_bts_attr(mo->bts); + add_bts_attrs(attr_buf, mo->bts); + break; + case NM_OC_BASEB_TRANSC: + add_trx_attr(attr_buf, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr)); break; default: - LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute " + "Response(NM_ATT_SW_CONFIG)\n", get_value_string(abis_nm_obj_class_names, mo->obj_class)); return -EINVAL; } @@ -204,19 +231,11 @@ } else out[0] = attr_out_index - 1; /* Count number of unhandled attributes */ - length = attr_out_index + 1; - - if (ba) { - memcpy(out + attr_out_index, msgb_data(ba), ba->len); - length += ba->len; - msgb_free(ba); - } - - return length; + return cleanup_attr_msg(out, attr_out_index, attr_buf); } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ @@ -227,7 +246,7 @@ if (!nmsg) return -ENOMEM; - len = handle_attr(mo, attr, attr_len, resp); + len = handle_attrs(bts, mo, attr, attr_len, resp); if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); msgb_free(nmsg); @@ -467,13 +486,11 @@ { struct abis_om_fom_hdr *foh = msgb_l3(msg); struct tlv_parsed tp; - struct gsm_abis_mo *mo; int rc; - if (!foh) + if (!foh || !bts) return -EINVAL; - mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx GET ATTR\n"); @@ -483,13 +500,13 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - if (!TLVP_PRESENT(&tp, NM_ATT_LIST_REQ_ATTR)) { + if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) { LOGP(DOML, LOGL_ERROR, "O&M Get Attributes message without Attribute List?!\n"); oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, &bts->mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 8 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 Fri Jun 9 16:41:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 16:41:44 +0000 Subject: [PATCH] osmo-bts[master]: Extend Get Attribute responder 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/2786 to look at the new patch set (#9). Extend Get Attribute responder * detect if attributes are requested for BTS or TRX and act accordingly * report TRX phy version Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Related: OS#1614 --- M src/common/oml.c 1 file changed, 87 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/2786/9 diff --git a/src/common/oml.c b/src/common/oml.c index 9dddf57..f97823d 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include #include #include +#include static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg); @@ -153,70 +154,101 @@ return mo_buf; } -static inline struct msgb *add_bts_attr(const struct gsm_bts *bts) +static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - struct msgb *a = oml_msgb_alloc(); - - if (!a) - return NULL; - - abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); - abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + abis_nm_put_sw_file(msg, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); + abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); if (strlen(bts->sub_model)) - abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); - - return a; + abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } -static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len, uint8_t *out) +static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +{ + const struct phy_instance *pinst = trx_phy_instance(trx); + + abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown", + true); +} + +/* The number of attributes in ?9.4.26 List of Required Attributes is 2 bytes, + but the Count of not-reported attributes from ?9.4.64 is 1 byte */ +static inline uint8_t pack_num_unreported_attr(uint16_t attrs) +{ + if (attrs > 255) { + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes, Count of not-reported attributes is too big: %u\n", + attrs); + return 255; + } + return attrs; /* Return number of unhandled attributes */ +} + +/* copy all the attributes accumulated in msg to out and return the total length of out buffer */ +static inline int cleanup_attr_msg(uint8_t *out, int out_offset, struct msgb *msg) +{ + int len = 0; + + out[0] = pack_num_unreported_attr(out_offset - 1); + + if (msg) { + memcpy(out + out_offset, msgb_data(msg), msg->len); + len = msg->len; + msgb_free(msg); + } + + return len + out_offset + 1; +} + +static inline int handle_attrs_trx(uint8_t *out, struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *ba = NULL; - int length; + struct msgb *attr_buf = oml_msgb_alloc(); + + if (!attr_buf) + return -ENOMEM; for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: - switch (mo->obj_class) { - case NM_OC_BTS: - ba = add_bts_attr(mo->bts); - break; - default: - LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, mo->obj_class)); - return -EINVAL; - } + add_trx_attr(attr_buf, trx); break; default: - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported.\n", i, + 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]; + out[attr_out_index] = attr[i]; /* assemble values of supported attributes and list of unsupported ones */ attr_out_index++; } } - if (attr_out_index - 1 > 255) { /* The number of attributes in ?9.4.26 List of Required Attributes is 2 bytes, - but the Count of not-reported attributes from ?9.4.64 is 1 byte */ - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes, Count of not-reported attributes is too big: %u\n", - attr_out_index - 1); - out[0] = 255; - } else - out[0] = attr_out_index - 1; /* Count number of unhandled attributes */ + return cleanup_attr_msg(out, attr_out_index, attr_buf); +} - length = attr_out_index + 1; +static inline int handle_attrs_bts(uint8_t *out, const struct gsm_bts *bts, const uint8_t *attr, uint16_t attr_len) +{ + uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ + struct msgb *attr_buf = oml_msgb_alloc(); - if (ba) { - memcpy(out + attr_out_index, msgb_data(ba), ba->len); - length += ba->len; - msgb_free(ba); + if (!attr_buf) + return -ENOMEM; + + for (i = 0; i < attr_len; i++) { + switch (attr[i]) { + case NM_ATT_SW_CONFIG: + add_bts_attrs(attr_buf, bts); + break; + default: + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS.\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 */ + attr_out_index++; + } } - return length; + return cleanup_attr_msg(out, attr_out_index, attr_buf); } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ @@ -227,7 +259,19 @@ if (!nmsg) return -ENOMEM; - len = handle_attr(mo, attr, attr_len, resp); + switch (mo->obj_class) { + case NM_OC_BTS: + len = handle_attrs_bts(resp, bts, attr, attr_len); + break; + case NM_OC_BASEB_TRANSC: + len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr), attr, attr_len); + break; + default: + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", + get_value_string(abis_nm_obj_class_names, mo->obj_class)); + len = -EINVAL; + } + if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); msgb_free(nmsg); @@ -467,13 +511,11 @@ { struct abis_om_fom_hdr *foh = msgb_l3(msg); struct tlv_parsed tp; - struct gsm_abis_mo *mo; int rc; - if (!foh) + if (!foh || !bts) return -EINVAL; - mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx GET ATTR\n"); @@ -483,13 +525,13 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - if (!TLVP_PRESENT(&tp, NM_ATT_LIST_REQ_ATTR)) { + if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) { LOGP(DOML, LOGL_ERROR, "O&M Get Attributes message without Attribute List?!\n"); oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, &bts->mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 9 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 Fri Jun 9 16:41:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 16:41:44 +0000 Subject: [PATCH] osmo-bts[master]: Set and report BTS features In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2799 to look at the new patch set (#7). Set and report BTS features Set (possibly incomplete) list of BTS model-specific features and report them in response to attribute request via OML. Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Related: OS#1614 --- M src/common/oml.c M src/osmo-bts-litecell15/main.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/main.c M src/osmo-bts-trx/main.c 5 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/2799/7 diff --git a/src/common/oml.c b/src/common/oml.c index f97823d..982713e 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -163,6 +163,12 @@ abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } +/* Add BTS features as 3GPP TS 52.021 ?9.4.30 Manufacturer Id */ +static inline void add_bts_feat(struct msgb *msg, const struct gsm_bts *bts) +{ + msgb_tl16v_put(msg, NM_ATT_MANUF_ID, _NUM_BTS_FEAT/8 + 1, bts->_features_data); +} + static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) { const struct phy_instance *pinst = trx_phy_instance(trx); @@ -236,6 +242,9 @@ case NM_ATT_SW_CONFIG: add_bts_attrs(attr_buf, bts); break; + case NM_ATT_MANUF_ID: + add_bts_feat(attr_buf, bts); + break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS.\n", i, get_value_string(abis_nm_att_names, attr[i])); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ab13981..97b5359 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -91,6 +91,10 @@ exit(23); } + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP); + bts_model_vty_init(bts); return 0; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 042ecc3..85b5a86 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -782,6 +782,9 @@ /* FIXME: what is the nominal transmit power of the PHY/board? */ bts->c0->nominal_power = 15; + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + bts_model_vty_init(bts); return 0; diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index 547d084..a8b7b50 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -78,6 +78,11 @@ exit(23); } + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_EGPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP); + bts_model_vty_init(bts); return 0; diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index b2cbb39..da3dc60 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -106,6 +106,9 @@ * value */ bts->c0->nominal_power = 23; + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + bts_model_vty_init(bts); return 0; -- To view, visit https://gerrit.osmocom.org/2799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 9 16:54:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 9 Jun 2017 16:54:08 +0000 Subject: [PATCH] openbsc[master]: Fix BTS number in attribute requests Message-ID: Review at https://gerrit.osmocom.org/2868 Fix BTS number in attribute requests Use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 ?9.3. Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Fixes: OS#2317 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/2868/1 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index e5226a9..2a91b1c 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -343,12 +343,12 @@ generate_cell_chan_list(ca, trx->bts); /* Request generic BTS-level attributes */ - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; /* Request TRX-level attributes */ - abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF, trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 9 18:28:59 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 9 Jun 2017 18:28:59 +0000 Subject: [PATCH] osmo-trx[master]: build: Require and check for gcc C++11 support Message-ID: Review at https://gerrit.osmocom.org/2869 build: Require and check for gcc C++11 support It is now 2017. We can and should be able to use C++11 features now. Change-Id: I96477e4125390b17b43a3705bb1daf98fa01c9bb Signed-off-by: Tom Tsou --- A config/ax_cxx_compile_stdcxx.m4 A config/ax_cxx_compile_stdcxx_11.m4 M configure.ac 3 files changed, 1,022 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/69/2869/1 diff --git a/config/ax_cxx_compile_stdcxx.m4 b/config/ax_cxx_compile_stdcxx.m4 new file mode 100644 index 0000000..5032bba --- /dev/null +++ b/config/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1,982 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AX_REQUIRE_DEFINED([AC_MSG_WARN]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) + m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus <= 201402L + +#error "This is not a C++17 compiler" + +#else + +#if defined(__clang__) + #define REALLY_CLANG +#else + #if defined(__GNUC__) + #define REALLY_GCC + #endif +#endif + +#include +#include +#include + +namespace cxx17 +{ + +#if !defined(REALLY_CLANG) + namespace test_constexpr_lambdas + { + + // TODO: test it with clang++ from git + + constexpr int foo = [](){return 42;}(); + + } +#endif // !defined(REALLY_CLANG) + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + +#if !defined(REALLY_CLANG) + namespace test_template_argument_deduction_for_class_templates + { + + // TODO: test it with clang++ from git + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } +#endif // !defined(REALLY_CLANG) + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + +#if !defined(REALLY_CLANG) + namespace test_structured_bindings + { + + // TODO: test it with clang++ from git + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } +#endif // !defined(REALLY_CLANG) + +#if !defined(REALLY_CLANG) + namespace test_exception_spec_type_system + { + + // TODO: test it with clang++ from git + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } +#endif // !defined(REALLY_CLANG) + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus <= 201402L + +]]) diff --git a/config/ax_cxx_compile_stdcxx_11.m4 b/config/ax_cxx_compile_stdcxx_11.m4 new file mode 100644 index 0000000..1733fd8 --- /dev/null +++ b/config/ax_cxx_compile_stdcxx_11.m4 @@ -0,0 +1,39 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++11. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/configure.ac b/configure.ac index 8ddd07d..8cfd25d 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,7 @@ AM_PROG_AS AC_PROG_CXX +AX_CXX_COMPILE_STDCXX_11 AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_INSTALL -- To view, visit https://gerrit.osmocom.org/2869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I96477e4125390b17b43a3705bb1daf98fa01c9bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 9 19:43:18 2017 From: gerrit-no-reply at lists.osmocom.org (groos@xiplink.com) Date: Fri, 9 Jun 2017 19:43:18 +0000 Subject: [PATCH] openggsn[master]: IPv6 support Message-ID: Review at https://gerrit.osmocom.org/2870 IPv6 support Change-Id: If8ce8b4b8cd2ba97f7ba122de4703983111046e4 --- M ggsn/ggsn.c M ggsn/ippool.c M ggsn/ippool.h M ggsn/tun.c M ggsn/tun.h M gtp/gtp.c M gtp/gtp.h M gtp/pdp.c M gtp/pdp.h M gtp/queue.c M gtp/queue.h M sgsnemu/ippool.c M sgsnemu/ippool.h M sgsnemu/sgsnemu.c M sgsnemu/tun.c M sgsnemu/tun.h 16 files changed, 1,215 insertions(+), 480 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/70/2870/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 52a2022..3efba0b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -57,9 +57,11 @@ int end = 0; int maxfd = 0; /* For select() */ -struct in_addr listen_; -struct in_addr netaddr, destaddr, net, mask; /* Network interface */ -struct in_addr dns1, dns2; /* PCO DNS address */ +struct sockaddr_storage listen_; +struct in6_addr netaddr, destaddr, net; /* Network interface */ +size_t netaddrlen, destaddrlen, netlen, prefixlen; +struct in6_addr dns1, dns2; /* PCO DNS address */ +size_t dns1len, dns2len; char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ struct ul255_t pco; @@ -147,7 +149,8 @@ int create_context_ind(struct pdp_t *pdp) { - struct in_addr addr; + struct in6_addr addr; + size_t addrlen = 0; struct ippoolm_t *member; if (debug) printf("Received create PDP context request\n"); @@ -160,17 +163,23 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - - if (pdp_euaton(&pdp->eua, &addr)) { - addr.s_addr = 0; /* Request dynamic */ - } - if (ippool_newip(ippool, &member, &addr, 0)) { + if (pdp_euaton(&pdp->eua, (struct in_addr*)&addr) == 0) + addrlen = 4; + else if (pdp_euaton6(&pdp->eua, &addr) == 0) + addrlen = 16; + else + memset(&addr, 0, sizeof(addr)); /* Request dynamic */ + + if (ippool_newip(ippool, &member, (struct in_addr*)&addr, addrlen, 0)) { gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr, &pdp->eua); + if (member->addrlen == 4) + pdp_ntoeua((struct in_addr*)&member->addr, &pdp->eua); + else + pdp_ntoeua6(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -183,14 +192,23 @@ /* Callback for receiving messages from tun */ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct ippoolm_t *ipm; - struct in_addr dst; + struct in6_addr dst; + size_t dstlen; struct tun_packet_t *iph = (struct tun_packet_t*) pack; + struct tun_packet6_t *ip6h = (struct tun_packet6_t*) pack; - dst.s_addr = iph->dst; + if (iph->ver == 4) { + memcpy(&dst, &iph->dst, sizeof(struct in_addr)); + dstlen = 4; + } + else { + memcpy(&dst, ip6h->dst, sizeof(struct in6_addr)); + dstlen = 16; + } if (debug) printf("Received packet from tun!\n"); - if (ippool_getip(ippool, &ipm, &dst)) { + if (ippool_getip(ippool, &ipm, (struct in_addr*)&dst, dstlen)) { if (debug) printf("Received packet with no destination!!!\n"); return 0; } @@ -208,6 +226,16 @@ int main(int argc, char **argv) { + struct addrinfo* ai; + + struct addrinfo hints; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = 0; + hints.ai_protocol = 0; + + int err; + /* gengeopt declarations */ struct gengetopt_args_info args_info; @@ -291,13 +319,14 @@ /* Any port listening is not possible as a valid address is */ /* required for create_pdp_context_response messages */ if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { + if ((err = getaddrinfo(args_info.listen_arg, NULL, &hints, &ai))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid listening address: %s!", args_info.listen_arg); exit(1); } else { - memcpy(&listen_.s_addr, host->h_addr, host->h_length); + memcpy(&listen_, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); } } else { @@ -307,18 +336,22 @@ "edit %s configuration file\n", args_info.conf_arg); exit(1); } - /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if(ippool_aton(&net, &mask, args_info.net_arg, 0)) { + struct in6_addr net; + size_t netlen; + if(ippool_aton(&net, &netlen, &prefixlen, args_info.net_arg, 0)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + inc_addr((struct in_addr*)&net, netlen); + memcpy(&netaddr, &net, netlen); + netaddrlen = netlen; + memcpy(&destaddr, &net, netlen); + destaddrlen = netlen; } else { sys_err(LOG_ERR, __FILE__, __LINE__, 0, @@ -346,21 +379,37 @@ /* DNS1 and DNS2 */ #ifdef HAVE_INET_ATON - dns1.s_addr = 0; if (args_info.pcodns1_arg) { - if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) { + if ((err = getaddrinfo(args_info.pcodns1_arg, NULL, &hints, &ai))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to convert pcodns1!"); exit(1); } + if (ai->ai_family == AF_INET) { + dns1len = sizeof(struct in_addr); + memcpy(&dns1, &((struct sockaddr_in*)&ai->ai_addr)->sin_addr, dns1len); + } + else { + dns1len = sizeof(struct in6_addr); + memcpy(&dns1, &((struct sockaddr_in6*)&ai->ai_addr)->sin6_addr, dns1len); + } + freeaddrinfo(ai); } - dns2.s_addr = 0; if (args_info.pcodns2_arg) { - if (0 == inet_aton(args_info.pcodns2_arg, &dns2)) { + if ((err = getaddrinfo(args_info.pcodns2_arg, NULL, &hints, &ai))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to convert pcodns2!"); exit(1); } + if (ai->ai_family == AF_INET) { + dns2len = sizeof(struct in_addr); + memcpy(&dns2, &((struct sockaddr_in*)&ai->ai_addr)->sin_addr, dns2len); + } + else { + dns2len = sizeof(struct in6_addr); + memcpy(&dns2, &((struct sockaddr_in6*)&ai->ai_addr)->sin6_addr, dns2len); + } + freeaddrinfo(ai); } #else dns1.s_addr = 0; @@ -382,7 +431,6 @@ } } #endif - pco.l = 20; pco.v[0] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ @@ -450,7 +498,7 @@ if (debug) printf("gtpclient: Initialising GTP tunnel\n"); - if (gtp_new(&gsn, args_info.statedir_arg, &listen_, GTP_MODE_GGSN)) { + if (gtp_new(&gsn, args_info.statedir_arg, (struct sockaddr*)&listen_, GTP_MODE_GGSN)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to create gtp"); exit(1); @@ -474,7 +522,10 @@ } if (debug) printf("Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) { + struct in_addr mask; + mask.s_addr = htons(0xffffffff << (32 - prefixlen)); + if ((netaddrlen == 4 && tun_setaddr(tun, (struct in_addr*)&netaddr, (struct in_addr*)&destaddr, &mask)) + || (netaddrlen == 16 && tun_setaddr6(tun, &netaddr, &destaddr, prefixlen))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to set tun IP address"); if (debug) printf("Failed to set tun IP address\n"); diff --git a/ggsn/ippool.c b/ggsn/ippool.c index fa3d8af..5f25458 100644 --- a/ggsn/ippool.c +++ b/ggsn/ippool.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "syserr.h" #include "ippool.h" @@ -32,13 +33,16 @@ printf("Listsize %d\n", this->listsize); for (n=0; nlistsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s [1024]; + char s2 [1024]; + getnameinfo(&this->member[n].addr, this->member[n].addrlen, s, sizeof(s), s2, sizeof(s2), NI_NUMERICHOST); + + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr + s ); } return 0; @@ -50,12 +54,15 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + if (member->addrlen == 4) + hash = ippool_hash4((struct in_addr*)&member->addr) & this->hashmask; + else + hash = ippool_hash6(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) this->hash[hash] = member; - else + else p_prev->nexthash = member; return 0; /* Always OK to insert */ } @@ -66,7 +73,10 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + if (member->addrlen == 4) + hash = ippool_hash4((struct in_addr*)&member->addr) & this->hashmask; + else + hash = ippool_hash6(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -93,66 +103,80 @@ return lookup((unsigned char*) &addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char*) addr->u6_addr8, sizeof(addr->u6_addr8), 0); + // TODO: review hash spread for ipv6 + return lookup((unsigned char*) addr->s6_addr32, sizeof(addr->s6_addr32), 0); } -#endif - /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) { +int ippool_aton(struct in_addr *addr, size_t *addrlen, size_t* prefixlen, char *pool, int number) { + struct addrinfo* ai; - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + struct addrinfo hints; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = 0; + hints.ai_protocol = 0; - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, - &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Invalid mask */ - } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m)+1)); masklog++); - if (((~m)+1) != (1 << masklog)) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros)*/ - } - mask->s_addr = htonl(m); - break; - default: - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Invalid mask */ - } + // Find '/' + char* prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Empty prefix length specified"); + return -1; + } + } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Wrong IP address format"); - return -1; - } - else - addr->s_addr = htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + // Convert address + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Bad address"); + return -1; + } - return 0; + // Copy address, set lengths + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + *addrlen = sizeof(struct in_addr); + memcpy(addr, &((struct sockaddr_in*)ai->ai_addr)->sin_addr, sizeof(struct in_addr)); + } + else { + *prefixlen = 128; + *addrlen = sizeof(struct in6_addr); + memcpy(addr, &((struct sockaddr_in6*)ai->ai_addr)->sin6_addr, sizeof(struct in6_addr)); + } + + freeaddrinfo(ai); + + // Parse prefixlen + if (prefixlen_str) { + char* e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (*addrlen * 8)) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Prefixlen too big"); + return -1; + } + + return 0; +} + +/* Increases ip4/6 address by 1 */ +void inc_addr(struct in_addr* addr, size_t addrlen) +{ + uint8_t* a = (uint8_t*)&addr->s_addr; + for (; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -162,10 +186,12 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; + struct in6_addr addr; + size_t addrlen; + size_t addrprefixlen; + struct in6_addr stataddr; + size_t stataddrlen; + size_t stataddrprefixlen; unsigned int m; int listsize; int dynsize; @@ -175,7 +201,7 @@ dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton(&addr, &addrlen, &addrprefixlen, dyn, 0)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to parse dynamic pool"); return -1; @@ -186,8 +212,10 @@ flags |= IPPOOL_NONETWORK; } - m = ntohl(mask.s_addr); - dynsize = ((~m)+1); + dynsize = (1 << (addrlen - addrprefixlen + 1)) - 1; + + //m = ntohl(mask.s_addr); + //dynsize = ((~m)+1); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -198,18 +226,17 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddrlen = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton(&stataddr, &stataddrlen, &stataddrprefixlen, stat, 0)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m)+1); + statsize = (1 << (addrlen - addrprefixlen + 1)) - 1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -223,8 +250,10 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddrlen > 0) + memcpy(&(*this)->stataddr, &stataddr, stataddrlen); + (*this)->stataddrlen = stataddrlen; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))){ @@ -252,15 +281,20 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + + if (flags & IPPOOL_NOGATEWAY) { + inc_addr(&addr, addrlen); + inc_addr(&addr, addrlen); + } + else if (flags & IPPOOL_NONETWORK) + inc_addr(&addr, addrlen); + for (i = 0; imember[i].addr.s_addr = htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = htonl(ntohl(addr.s_addr) + i); - + memcpy(&(*this)->member[i].addr, &addr, addrlen); + (*this)->member[i].addrlen = addrlen; + inc_addr(&addr, addrlen); + (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -280,8 +314,10 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; imember[i].addr, 0, addrlen); + (*this)->member[i].addrlen = addrlen; - (*this)->member[i].addr.s_addr = 0; (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -312,14 +348,19 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) { + struct in_addr *addr, size_t addrlen) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + if (addrlen == 4) + hash = ippool_hash4(addr) & this->hashmask; + else + hash = ippool_hash6(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (p->addrlen == addrlen + && memcmp(&p->addr, addr, addrlen) == 0 + && (p->inuse)) { if (member) *member = p; return 0; } @@ -337,7 +378,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) { + struct in_addr *addr, size_t addrlen, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; uint32_t hash; @@ -357,15 +398,25 @@ if (0) (void)ippool_printaddr(this); /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + int specified = 0; + if (addr) { + if (addrlen == 4 && ((struct in_addr*)&addr)->s_addr) + specified = 1; + if (addrlen == 16 && !IN6_IS_ADDR_UNSPECIFIED(addr)) + specified = 1; + } + if (specified && statip) { /* IP address given */ if (!this->allowstat) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Static IP address not allowed"); return -1; } + // TODO: ipv6 mask check +/* if ((addr->s_addr & this->statmask.s_addr) != this->stataddr.s_addr) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Static out of range"); return -1; } +*/ } else { if (!this->allowdyn) { @@ -376,11 +427,14 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + if (addrlen == 4) + hash = ippool_hash4(addr) & this->hashmask; + else + hash = ippool_hash6(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (p->addrlen == addrlen && !memcmp(&p->addr, &addr, addrlen)) { p2 = p; break; } @@ -431,7 +485,7 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "No more IP addresses available"); @@ -452,7 +506,7 @@ p2->next = NULL; p2->prev = NULL; p2->inuse = 2; /* Static address in use */ - memcpy(&p2->addr, addr, sizeof(addr)); + memcpy(&p2->addr, addr, addrlen); *member = p2; (void)ippool_hashadd(this, *member); if (0) (void)ippool_printaddr(this); @@ -507,7 +561,8 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); + member->addrlen = 0; member->peer = NULL; member->nexthash = NULL; if (0) (void)ippool_printaddr(this); @@ -517,10 +572,3 @@ return -1; } } - - -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/ggsn/ippool.h b/ggsn/ippool.h index 02691a6..432fa8d 100644 --- a/ggsn/ippool.h +++ b/ggsn/ippool.h @@ -26,8 +26,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,7 +38,9 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ + struct in6_addr stataddr; /* Static address range network address */ + size_t stataddrlen; + size_t stataddrprefixlen; struct in_addr statmask; /* Static address range network mask */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ @@ -54,11 +54,8 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + size_t addrlen; int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -81,25 +78,22 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in_addr *addr, size_t addrlen); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in_addr *addr, size_t addrlen, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, +extern int ippool_aton(struct in_addr *addr, size_t *addrlen, size_t *prefixlen, char *pool, int number); - -#ifndef IPPOOL_NOIP6 extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif + +void inc_addr(struct in_addr* addr, size_t addrlen); #endif /* !_IPPOOL_H */ diff --git a/ggsn/tun.c b/ggsn/tun.c index 1cc706b..96ee7ca 100644 --- a/ggsn/tun.c +++ b/ggsn/tun.c @@ -71,6 +71,13 @@ #if defined(__linux__) +// From linux/ipv6.h +struct in6_ifreq { + struct in6_addr ifr6_addr; + __u32 ifr6_prefixlen; + int ifr6_ifindex; +}; + int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { int len = RTA_LENGTH(dlen); @@ -230,6 +237,9 @@ } */ +#ifdef foo +// None of this is currently required for IPv6 +// int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, @@ -396,6 +406,7 @@ #endif } +#endif //foo int tun_setaddr(struct tun_t *this, @@ -431,7 +442,7 @@ } if (addr) { /* Set the interface address */ - this->addr.s_addr = addr->s_addr; + ((struct in_addr*)&this->addr)->s_addr = addr->s_addr; ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = addr->s_addr; if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { if (errno != EEXIST) { @@ -448,7 +459,7 @@ } if (dstaddr) { /* Set the destination address */ - this->dstaddr.s_addr = dstaddr->s_addr; + ((struct in_addr*)&this->dstaddr)->s_addr = addr->s_addr; ((struct sockaddr_in *) &ifr.ifr_dstaddr)->sin_addr.s_addr = dstaddr->s_addr; if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) { @@ -501,6 +512,88 @@ return 0; } + +int tun_setaddr6(struct tun_t *this, + struct in6_addr *addr, + struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + struct ifreq namereq; + int fd; + + this->ip6 = 1; + + memset (&ifr, '\0', sizeof (ifr)); + memset (&namereq, '\0', sizeof (namereq)); + + /* Create a channel to the NET kernel. */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "socket() failed"); + return -1; + } + + // Get interface index + strncpy(namereq.ifr_name, this->devname, IFNAMSIZ); + namereq.ifr_name[IFNAMSIZ-1] = 0; /* Make sure to terminate */ + if (ioctl(fd, SIOGIFINDEX, &namereq) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, "Could not get ifindex"); + return -1; + } + ifr.ifr6_ifindex = namereq.ifr_ifindex; + + ifr.ifr6_prefixlen = prefixlen; + + if (addr) { /* Set the interface address */ + memcpy(&this->addr, addr, sizeof(struct in6_addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(struct in6_addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "ioctl(SIOCSIFADDR) failed"); + } + else { + sys_err(LOG_WARNING, __FILE__, __LINE__, errno, + "ioctl(SIOCSIFADDR): Address already exists"); + } + close(fd); + return -1; + } + } + +#ifdef xxx + // Looks like this is not possible/necessary for ipv6? + if (dstaddr) { /* Set the destination address */ + memcpy(&this->dstaddr, dstaddr, sizeof(struct in6_addr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(struct in6_addr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif //xxx + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute(this, dstaddr, addr, netmask); + this->routes = 1; +#endif + + return 0; +} + int tun_route(struct tun_t *this, struct in_addr *dst, @@ -666,6 +759,7 @@ (*tun)->cb_ind = NULL; (*tun)->addrs = 0; (*tun)->routes = 0; + (*tun)->ip6 = 0; #if defined(__linux__) /* Open the actual tun device */ @@ -797,8 +891,9 @@ int tun_free(struct tun_t *tun) { + // TODO: ipv6 if (tun->routes) { - tun_delroute(tun, &tun->dstaddr, &tun->addr, &tun->netmask); + //tun_delroute(tun, &tun->dstaddr, &tun->addr, &tun->netmask); } if (close(tun->fd)) { @@ -883,9 +978,10 @@ char snet[TUN_ADDRSIZE]; char smask[TUN_ADDRSIZE]; - strncpy(snet, inet_ntoa(tun->addr), sizeof(snet)); + //TODO: fix for IPv6 + //strncpy(snet, inet_ntoa(tun->addr), sizeof(snet)); snet[sizeof(snet)-1] = 0; - strncpy(smask, inet_ntoa(tun->netmask), sizeof(smask)); + //strncpy(smask, inet_ntoa(tun->netmask), sizeof(smask)); smask[sizeof(smask)-1] = 0; /* system("ipup /dev/tun0 192.168.0.10 255.255.255.0"); */ diff --git a/ggsn/tun.h b/ggsn/tun.h index 7972c53..1c239eb 100644 --- a/ggsn/tun.h +++ b/ggsn/tun.h @@ -17,9 +17,18 @@ #define TUN_ADDRSIZE 128 #define TUN_NLBUFSIZE 1024 +/* This should not be re-declared! Why not just use netinet/ip(6).h? + * It is not completely functional as it is here. Just the minimum + * amount of hacking has been done to make it work. */ struct tun_packet_t { +#if BYTE_ORDER == LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int ver:4; +#endif +#if BYTE_ORDER == BIG_ENDIAN unsigned int ver:4; unsigned int ihl:4; +#endif unsigned int dscp:6; unsigned int ecn:2; unsigned int length:16; @@ -29,8 +38,19 @@ unsigned int ttl:8; unsigned int protocol:8; unsigned int check:16; - unsigned int src:32; - unsigned int dst:32; + uint32_t src; + uint32_t dst; +}; + +struct tun_packet6_t { + unsigned int ver:4; + unsigned int tclass:8; + unsigned int flowlabel:20; + unsigned int payloadlen:16; + unsigned int nexthdr:8; + unsigned int hoplim:8; + unsigned char src[16]; + unsigned char dst[16]; }; @@ -39,10 +59,12 @@ *************************************************************/ struct tun_t { + int ip6; int fd; /* File descriptor to tun interface */ - struct in_addr addr; - struct in_addr dstaddr; - struct in_addr netmask; + struct in6_addr addr; + struct in6_addr dstaddr; + struct in_addr netmask; //ipv4 + size_t prefixlen; int addrs; /* Number of allocated IP addresses */ int routes; /* One if we allocated an automatic route */ char devname[IFNAMSIZ];/* Name of the tun device */ @@ -55,19 +77,13 @@ extern int tun_decaps(struct tun_t *this); extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); -extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask); - - extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, struct in_addr *his_adr, struct in_addr *net_mask); - -int tun_addroute(struct tun_t *this, struct in_addr *dst, - struct in_addr *gateway, struct in_addr *mask); +extern int tun_setaddr6(struct tun_t *this, struct in6_addr *our_adr, + struct in6_addr *his_adr, size_t prefixlen); extern int tun_set_cb_ind(struct tun_t *this, int (*cb_ind) (struct tun_t *tun, void *pack, unsigned len)); - extern int tun_runscript(struct tun_t *tun, char* script); diff --git a/gtp/gtp.c b/gtp/gtp.c index 5e6c4ab..cceabda 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -132,13 +133,13 @@ int gtp_set_cb_unsup_ind(struct gsn_t *gsn, - int (*cb) (struct sockaddr_in *peer)) { + int (*cb) (struct sockaddr *peer)) { gsn->cb_unsup_ind = cb; return 0; } int gtp_set_cb_extheader_ind(struct gsn_t *gsn, - int (*cb) (struct sockaddr_in *peer)) { + int (*cb) (struct sockaddr *peer)) { gsn->cb_extheader_ind = cb; return 0; } @@ -397,20 +398,13 @@ int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, union gtp_packet *packet, int len, - struct in_addr *inetaddr, void *cbp) { - struct sockaddr_in addr; + struct sockaddr *sockaddr, void *cbp) { struct qmsg_t *qmsg; int fd; - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_addr = *inetaddr; -#if defined(__FreeBSD__) || defined(__APPLE__) - addr.sin_len = sizeof(addr); -#endif - if ((packet->flags & 0xe0) == 0x00) { /* Version 0 */ - addr.sin_port = htons(GTP0_PORT); + // sin_port in same place for sockaddr_in and sockaddr_in6 + ((struct sockaddr_in*)sockaddr)->sin_port = htons(GTP0_PORT); packet->gtp0.h.length = hton16(len - GTP0_HEADER_SIZE); packet->gtp0.h.seq = hton16(gsn->seq_next); if (pdp) @@ -424,7 +418,7 @@ fd = gsn->fd0; } else if ((packet->flags & 0xe2) == 0x22) { /* Version 1 with seq */ - addr.sin_port = htons(GTP1C_PORT); + ((struct sockaddr_in*)sockaddr)->sin_port = htons(GTP1C_PORT); packet->gtp1l.h.length = hton16(len - GTP1_HEADER_SIZE_SHORT); packet->gtp1l.h.seq = hton16(gsn->seq_next); if (pdp && ((packet->gtp1l.h.type == GTP_GPDU) || @@ -439,14 +433,14 @@ } if (sendto(fd, packet, len, 0, - (struct sockaddr *) &addr, sizeof(addr)) < 0) { + sockaddr, sockaddr->sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)) < 0) { gsn->err_sendto++; gtp_err(LOG_ERR, __FILE__, __LINE__, "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s", fd, (unsigned long) &packet, len, strerror(errno)); return -1; } /* Use new queue structure */ - if (queue_newmsg(gsn->queue_req, &qmsg, &addr, gsn->seq_next)) { + if (queue_newmsg(gsn->queue_req, &qmsg, sockaddr, gsn->seq_next)) { gsn->err_queuefull++; gtp_err(LOG_ERR, __FILE__, __LINE__, "Retransmit queue is full"); } @@ -509,7 +503,7 @@ } else { if (sendto(qmsg->fd, &qmsg->p, qmsg->l, 0, - (struct sockaddr *) &qmsg->peer, sizeof(struct sockaddr_in)) < 0) { + (struct sockaddr *) &qmsg->peer, qmsg->peer.ss_family == AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)) < 0) { gsn->err_sendto++; gtp_err(LOG_ERR, __FILE__, __LINE__, "Sendto(fd0=%d, msg=%lx, len=%d) failed: Error = %s", gsn->fd0, (unsigned long) &qmsg->p, qmsg->l, strerror(errno)); } @@ -550,7 +544,7 @@ int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, union gtp_packet *packet, int len, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, uint16_t seq, uint64_t tid) { struct qmsg_t *qmsg; @@ -583,7 +577,7 @@ } if (sendto(fd, packet, len, 0, - (struct sockaddr *) peer, sizeof(struct sockaddr_in)) < 0) { + peer, peer->sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)) < 0) { gsn->err_sendto++; gtp_err(LOG_ERR, __FILE__, __LINE__, "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s", fd, (unsigned long) &packet, len, strerror(errno)); return -1; @@ -651,7 +645,7 @@ } int gtp_dublicate(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, uint16_t seq) { + struct sockaddr *peer, uint16_t seq) { struct qmsg_t *qmsg; if(queue_seqget(gsn->queue_resp, &qmsg, peer, seq)) { @@ -664,7 +658,7 @@ } if (sendto(qmsg->fd, &qmsg->p, qmsg->l, 0, - (struct sockaddr *) peer, sizeof(struct sockaddr_in)) < 0) { + peer, peer->sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)) < 0) { gsn->err_sendto++; gtp_err(LOG_ERR, __FILE__, __LINE__, "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s", qmsg->fd, (unsigned long) &qmsg->p, qmsg->l, strerror(errno)); } @@ -718,10 +712,10 @@ -int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen, +int gtp_new(struct gsn_t **gsn, char *statedir, struct sockaddr *listen, int mode) { - struct sockaddr_in addr; + struct sockaddr_storage addr; syslog(LOG_ERR, "GTP: gtp_newgsn() started"); @@ -748,71 +742,74 @@ (*gsn)->cb_data_ind = 0; /* Store function parameters */ - (*gsn)->gsnc = *listen; - (*gsn)->gsnu = *listen; + memcpy(&(*gsn)->gsnc, listen, listen->sa_family == AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)); + memcpy(&(*gsn)->gsnu, listen, listen->sa_family == AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)); (*gsn)->mode = mode; + int domain = AF_INET; + socklen_t sa_len = sizeof(struct sockaddr_in); + if (listen->sa_family == AF_INET6) { + domain = AF_INET6; + sa_len = sizeof(struct sockaddr_in6); + } /* Create GTP version 0 socket */ - if (((*gsn)->fd0 = socket(AF_INET, SOCK_DGRAM, 0)) < 0 ) { + if (((*gsn)->fd0 = socket(domain, SOCK_DGRAM, 0)) < 0 ) { (*gsn)->err_socket++; gtp_err(LOG_ERR, __FILE__, __LINE__, "socket(domain=%d, type=%d, protocol=%d) failed: Error = %s", AF_INET, SOCK_DGRAM, 0, strerror(errno)); return -1; } - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_addr = *listen; /* Same IP for user traffic and signalling*/ - addr.sin_port = htons(GTP0_PORT); #if defined(__FreeBSD__) || defined(__APPLE__) addr.sin_len = sizeof(addr); #endif + memcpy(&addr, listen, sa_len); + // port member in same position for sockaddr_in and sockaddr_in6 + ((struct sockaddr_in*)&addr)->sin_port = htons(GTP0_PORT); - if (bind((*gsn)->fd0, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + if (bind((*gsn)->fd0, (struct sockaddr *) &addr, sa_len) < 0) { (*gsn)->err_socket++; - gtp_err(LOG_ERR, __FILE__, __LINE__, "bind(fd0=%d, addr=%lx, len=%d) failed: Error = %s", (*gsn)->fd0, (unsigned long) &addr, sizeof(addr), strerror(errno)); + gtp_err(LOG_ERR, __FILE__, __LINE__, "bind(fd0=%d, addr=%lx, len=%d) failed: Error = %s", (*gsn)->fd0, (unsigned long) &addr, sa_len, strerror(errno)); return -1; } /* Create GTP version 1 control plane socket */ - if (((*gsn)->fd1c = socket(AF_INET, SOCK_DGRAM, 0)) < 0 ) { + if (((*gsn)->fd1c = socket(domain, SOCK_DGRAM, 0)) < 0 ) { (*gsn)->err_socket++; gtp_err(LOG_ERR, __FILE__, __LINE__, "socket(domain=%d, type=%d, protocol=%d) failed: Error = %s", AF_INET, SOCK_DGRAM, 0, strerror(errno)); return -1; } - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_addr = *listen; /* Same IP for user traffic and signalling*/ - addr.sin_port = htons(GTP1C_PORT); #if defined(__FreeBSD__) || defined(__APPLE__) addr.sin_len = sizeof(addr); #endif + memcpy(&addr, listen, sa_len); + // port member in same position for sockaddr_in and sockaddr_in6 + ((struct sockaddr_in*)&addr)->sin_port = htons(GTP1C_PORT); - if (bind((*gsn)->fd1c, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + if (bind((*gsn)->fd1c, (struct sockaddr *) &addr, sa_len) < 0) { (*gsn)->err_socket++; - gtp_err(LOG_ERR, __FILE__, __LINE__, "bind(fd1c=%d, addr=%lx, len=%d) failed: Error = %s", (*gsn)->fd1c, (unsigned long) &addr, sizeof(addr), strerror(errno)); + gtp_err(LOG_ERR, __FILE__, __LINE__, "bind(fd1c=%d, addr=%lx, len=%d) failed: Error = %s", (*gsn)->fd1c, (unsigned long) &addr, sa_len, strerror(errno)); return -1; } /* Create GTP version 1 user plane socket */ - if (((*gsn)->fd1u = socket(AF_INET, SOCK_DGRAM, 0)) < 0 ) { + if (((*gsn)->fd1u = socket(domain, SOCK_DGRAM, 0)) < 0 ) { (*gsn)->err_socket++; gtp_err(LOG_ERR, __FILE__, __LINE__, "socket(domain=%d, type=%d, protocol=%d) failed: Error = %s", AF_INET, SOCK_DGRAM, 0, strerror(errno)); return -1; } - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_addr = *listen; /* Same IP for user traffic and signalling*/ - addr.sin_port = htons(GTP1U_PORT); #if defined(__FreeBSD__) || defined(__APPLE__) addr.sin_len = sizeof(addr); #endif + memcpy(&addr, listen, sa_len); + // port member in same position for sockaddr_in and sockaddr_in6 + ((struct sockaddr_in*)&addr)->sin_port = htons(GTP1U_PORT); - if (bind((*gsn)->fd1u, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + if (bind((*gsn)->fd1u, (struct sockaddr *) &addr, sa_len) < 0) { (*gsn)->err_socket++; - gtp_err(LOG_ERR, __FILE__, __LINE__, "bind(fd1c=%d, addr=%lx, len=%d) failed: Error = %s", (*gsn)->fd1c, (unsigned long) &addr, sizeof(addr), strerror(errno)); + gtp_err(LOG_ERR, __FILE__, __LINE__, "bind(fd1c=%d, addr=%lx, len=%d) failed: Error = %s", (*gsn)->fd1c, (unsigned long) &addr, sa_len, strerror(errno)); return -1; } @@ -864,7 +861,7 @@ /* Send off an echo request */ int gtp_echo_req(struct gsn_t *gsn, int version, void *cbp, - struct in_addr *inetaddr) + struct sockaddr *inetaddr) { union gtp_packet packet; unsigned int length = get_default_gtp(version, GTP_ECHO_REQ, &packet); @@ -873,7 +870,7 @@ /* Send off an echo reply */ int gtp_echo_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -885,7 +882,7 @@ /* Handle a received echo request */ -int gtp_echo_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +int gtp_echo_ind(struct gsn_t *gsn, int version, struct sockaddr *peer, int fd, void *pack, unsigned len) { /* Check if it was a dublicate request */ @@ -896,7 +893,7 @@ } /* Handle a received echo reply */ -int gtp_echo_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +int gtp_echo_conf(struct gsn_t *gsn, int version, struct sockaddr *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; unsigned char recovery; @@ -942,7 +939,7 @@ * only listen to the GTP0 port, and therefore will never receive * anything else than GTP0 */ -int gtp_unsup_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +int gtp_unsup_req(struct gsn_t *gsn, int version, struct sockaddr *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -954,7 +951,7 @@ } /* Handle a Version Not Supported message */ -int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr_in *peer, +int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr *peer, void *pack, unsigned len) { if (gsn->cb_unsup_ind) gsn->cb_unsup_ind(peer); @@ -963,7 +960,7 @@ } /* Send off an Supported Extension Headers Notification */ -int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -983,7 +980,7 @@ } /* Handle a Supported Extension Headers Notification */ -int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, +int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr *peer, void *pack, unsigned len) { if (gsn->cb_extheader_ind) gsn->cb_extheader_ind(peer); @@ -1223,7 +1220,7 @@ /* Handle Create PDP Context Request */ int gtp_create_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len) { struct pdp_t *pdp, *pdp_old; struct pdp_t pdp_buf; @@ -1246,7 +1243,7 @@ } pdp->seq = seq; - pdp->sa_peer = *peer; + memcpy(&pdp->sa_peer, peer, peer->sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)); pdp->fd = fd; pdp->version = version; @@ -1473,9 +1470,32 @@ } /* Initialize our own IP addresses */ - in_addr2gsna(&pdp->gsnlc, &gsn->gsnc); - in_addr2gsna(&pdp->gsnlu, &gsn->gsnu); - + struct in6_addr* a; + size_t alen; + if (gsn->gsnc.ss_family == AF_INET) { + struct sockaddr_in* s = (struct sockaddr_in*)&gsn->gsnc; + a = (struct in6_addr*)&s->sin_addr; + alen = sizeof(struct in_addr); + } + else { + struct sockaddr_in6* s = (struct sockaddr_in6*)&gsn->gsnc; + a = &s->sin6_addr; + alen = sizeof(struct in6_addr); + } + in_addr2gsna(&pdp->gsnlc, a, alen); + + if (gsn->gsnu.ss_family == AF_INET) { + struct sockaddr_in* s = (struct sockaddr_in*)&gsn->gsnu; + a = (struct in6_addr*)&s->sin_addr; + alen = sizeof(struct in_addr); + } + else { + struct sockaddr_in6* s = (struct sockaddr_in6*)&gsn->gsnu; + a = &s->sin6_addr; + alen = sizeof(struct in6_addr); + } + in_addr2gsna(&pdp->gsnlu, a, alen); + if (GTP_DEBUG) printf("gtp_create_pdp_ind: Before pdp_tidget\n"); if (!pdp_getimsi(&pdp_old, pdp->imsi, pdp->nsapi)) { @@ -1550,7 +1570,7 @@ /* Handle Create PDP Context Response */ int gtp_create_pdp_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len) { struct pdp_t *pdp; union gtpie_member *ie[GTPIE_SIZE]; @@ -1741,7 +1761,7 @@ /* API: Send Update PDP Context Request */ int gtp_update_context(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp, - struct in_addr* inetaddr) { + struct sockaddr* inetaddr) { union gtp_packet packet; unsigned int length = get_default_gtp(pdp->version, GTP_UPDATE_PDP_REQ, &packet); @@ -1817,7 +1837,7 @@ /* Send Update PDP Context Response */ int gtp_update_pdp_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) { @@ -1878,7 +1898,7 @@ /* Handle Update PDP Context Request */ int gtp_update_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len) { struct pdp_t *pdp; struct pdp_t pdp_backup; @@ -2098,7 +2118,7 @@ /* Handle Update PDP Context Response */ int gtp_update_pdp_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len) { struct pdp_t *pdp; union gtpie_member *ie[GTPIE_SIZE]; @@ -2199,13 +2219,15 @@ int teardown) { union gtp_packet packet; unsigned int length = get_default_gtp(pdp->version, GTP_DELETE_PDP_REQ, &packet); - struct in_addr addr; + struct in6_addr addr; + size_t addrlen; struct pdp_t *linked_pdp; struct pdp_t *secondary_pdp; int n; int count = 0; - if (gsna2in_addr(&addr, &pdp->gsnrc)) { + addrlen = sizeof(addr); + if (gsna2in_addr(&addr, &addrlen, &pdp->gsnrc)) { gsn->err_address++; gtp_err(LOG_ERR, __FILE__, __LINE__, "GSN address conversion failed"); return EOF; @@ -2235,7 +2257,22 @@ pdp->nsapi); } - gtp_req(gsn, pdp->version, pdp, &packet, length, &addr, cbp); + struct sockaddr_storage sa_s; + struct sockaddr_in* sa_in = (struct sockaddr_in*)&sa_s; + struct sockaddr_in6* sa_in6 = (struct sockaddr_in*)&sa_s; + memset(&sa_s, 0, sizeof(sa_s)); + void* p; + if (addrlen == 4) { + sa_in->sin_family = AF_INET; + p = &sa_in->sin_addr; + } + else { + sa_in6->sin6_family = AF_INET6; + p = &sa_in6->sin6_addr; + } + memcpy(p, &addr, addrlen); + + gtp_req(gsn, pdp->version, pdp, &packet, length, (struct sockaddr*)&sa_s, cbp); if (teardown) { /* Remove all contexts */ for (n=0; n< PDP_MAXNSAPI; n++) { @@ -2268,7 +2305,7 @@ /* Send Delete PDP Context Response */ int gtp_delete_pdp_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, struct pdp_t *linked_pdp, uint8_t cause, int teardown) @@ -2317,7 +2354,7 @@ /* Handle Delete PDP Context Request */ int gtp_delete_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len) { struct pdp_t *pdp = NULL; struct pdp_t *linked_pdp = NULL; @@ -2399,7 +2436,7 @@ /* Handle Delete PDP Context Response */ int gtp_delete_pdp_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; uint8_t cause; @@ -2445,7 +2482,7 @@ /* Send Error Indication (response to a GPDU message */ int gtp_error_ind_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -2457,7 +2494,7 @@ /* Handle Error Indication */ int gtp_error_ind_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2479,7 +2516,7 @@ } int gtp_gpdu_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len) { int hlen = GTP1_HEADER_SIZE_SHORT; @@ -2516,7 +2553,16 @@ } /* If the GPDU was not from the peer GSN tell him to delete context */ - if (memcmp(&peer->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) { /* TODO Range? */ + struct sockaddr_in* peer4 = NULL; + struct sockaddr_in6* peer6 = NULL; + if (peer->sa_family == AF_INET) + peer4 = (struct sockaddr_in*)peer; + else + peer6 = (struct sockaddr_in6*)peer; + + if ((peer4 && memcmp(&peer4->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) + || (peer6 && memcmp(&peer6->sin6_addr, pdp->gsnru.v, pdp->gsnru.l)) ) { + gsn->err_unknownpdp++; gtp_errpack(LOG_ERR, __FILE__, __LINE__, peer, pack, len, "Unknown PDP context"); @@ -2540,7 +2586,7 @@ int gtp_decaps0(struct gsn_t *gsn) { unsigned char buffer[PACKET_MAX]; - struct sockaddr_in peer; + struct sockaddr_storage peer; size_t peerlen; int status; struct gtp0_header *pheader; @@ -2672,7 +2718,7 @@ int gtp_decaps1c(struct gsn_t *gsn) { unsigned char buffer[PACKET_MAX]; - struct sockaddr_in peer; + struct sockaddr_storage peer; size_t peerlen; int status; struct gtp1_header_short *pheader; @@ -2831,7 +2877,7 @@ int gtp_decaps1u(struct gsn_t *gsn) { unsigned char buffer[PACKET_MAX]; - struct sockaddr_in peer; + struct sockaddr_storage peer; size_t peerlen; int status; struct gtp1_header_short *pheader; @@ -2953,22 +2999,33 @@ void *pack, unsigned len) { union gtp_packet packet; - struct sockaddr_in addr; + struct sockaddr_storage addr_s; + struct sockaddr_in* addr = (struct sockaddr_in*)&addr_s; + struct sockaddr_in6* addr6 = (struct sockaddr_in6*)&addr_s; int fd; int length; - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; -#if defined(__FreeBSD__) || defined(__APPLE__) - addr.sin_len = sizeof(addr); -#endif + memset(&addr_s, 0, sizeof(addr_s)); - memcpy(&addr.sin_addr, pdp->gsnru.v,pdp->gsnru.l); /* TODO range check */ + if (pdp->gsnru.l == 4) { + addr->sin_family = AF_INET; + memcpy(&addr->sin_addr, pdp->gsnru.v,pdp->gsnru.l); /* TODO range check */ +#if defined(__FreeBSD__) || defined(__APPLE__) + addr->sin_len = sizeof(*addr); +#endif + } + else { + addr6->sin6_family = AF_INET6; + memcpy(&addr6->sin6_addr, pdp->gsnru.v,pdp->gsnru.l); /* TODO range check */ +#if defined(__FreeBSD__) || defined(__APPLE__) + addr6->sin6_len = sizeof(*addr6); +#endif + } if (pdp->version == 0) { length = GTP0_HEADER_SIZE+len; - addr.sin_port = htons(GTP0_PORT); + addr->sin_port = htons(GTP0_PORT); fd = gsn->fd0; get_default_gtp(0, GTP_GPDU, &packet); @@ -2989,7 +3046,7 @@ else if (pdp->version == 1) { length = GTP1_HEADER_SIZE_LONG+len; - addr.sin_port = htons(GTP1U_PORT); + addr->sin_port = htons(GTP1U_PORT); fd = gsn->fd1u; get_default_gtp(1, GTP_GPDU, &packet); @@ -3019,7 +3076,7 @@ } if (sendto(fd, &packet, length, 0, - (struct sockaddr *) &addr, sizeof(addr)) < 0) { + (struct sockaddr *) &addr_s, addr_s.ss_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)) < 0) { gsn->err_sendto++; gtp_err(LOG_ERR, __FILE__, __LINE__, "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s", fd, (unsigned long) &packet, GTP0_HEADER_SIZE+len, strerror(errno)); return EOF; @@ -3067,6 +3124,7 @@ return 0; } +// TODO: ipv6? int eua2ipv4(struct in_addr *dst, struct ul66_t *eua) { if ((eua->l != 6) || (eua->v[0] != 0xf1) || @@ -3076,16 +3134,21 @@ return 0; } -int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna) { - memset(dst, 0, sizeof(struct in_addr)); - if (gsna->l != 4) return EOF; /* Return if not IPv4 */ +int gsna2in_addr(struct in6_addr *dst, size_t* dstlen, struct ul16_t *gsna) { + memset(dst, 0, *dstlen); + if (gsna->l != 4 && gsna->l != 16) return EOF; /* Return if not IPv4 */ + if (*dstlen < gsna->l) { + gtp_err(LOG_ERR, __FILE__, __LINE__, "dstlen too short"); + return EOF; + } memcpy(dst, gsna->v, gsna->l); + *dstlen = gsna->l; return 0; } -int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src) { +int in_addr2gsna(struct ul16_t *gsna, struct in6_addr *src, size_t srclen) { memset(gsna, 0, sizeof(struct ul16_t)); - gsna->l = 4; + gsna->l = srclen; memcpy(gsna->v, src, gsna->l); return 0; } diff --git a/gtp/gtp.h b/gtp/gtp.h index 7b5083b..5ca22eb 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -239,8 +239,8 @@ int fd1c; /* GTP1 control plane file descriptor */ int fd1u; /* GTP0 user plane file descriptor */ int mode; /* Mode of operation: GGSN or SGSN */ - struct in_addr gsnc; /* IP address of this gsn for signalling */ - struct in_addr gsnu; /* IP address of this gsn for user traffic */ + struct sockaddr_storage gsnc; /* IP address of this gsn for signalling */ + struct sockaddr_storage gsnu; /* IP address of this gsn for user traffic */ /* Parameters related to signalling messages */ uint16_t seq_next; /* Next sequence number to use */ @@ -256,8 +256,8 @@ /* Call back functions */ int (*cb_delete_context) (struct pdp_t*); int (*cb_create_context_ind) (struct pdp_t*); - int (*cb_unsup_ind) (struct sockaddr_in *peer); - int (*cb_extheader_ind) (struct sockaddr_in *peer); + int (*cb_unsup_ind) (struct sockaddr *peer); + int (*cb_extheader_ind) (struct sockaddr *peer); int (*cb_conf) (int type, int cause, struct pdp_t *pdp, void* cbp); int (*cb_data_ind) (struct pdp_t* pdp, void* pack, unsigned len); @@ -290,7 +290,7 @@ /* External API functions */ extern const char* gtp_version(); -extern int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen, +extern int gtp_new(struct gsn_t **gsn, char *statedir, struct sockaddr *listen, int mode); extern int gtp_free(struct gsn_t *gsn); @@ -309,7 +309,7 @@ int cause); extern int gtp_update_context(struct gsn_t *gsn, struct pdp_t *pdp, - void *cbp, struct in_addr* inetaddr); + void *cbp, struct sockaddr* inetaddr); extern int gtp_delete_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp, int teardown); @@ -334,10 +334,10 @@ int (*cb_create_context) (struct pdp_t* pdp)); */ extern int gtp_set_cb_unsup_ind(struct gsn_t *gsn, - int (*cb) (struct sockaddr_in *peer)); + int (*cb) (struct sockaddr *peer)); extern int gtp_set_cb_extheader_ind(struct gsn_t *gsn, - int (*cb) (struct sockaddr_in *peer)); + int (*cb) (struct sockaddr *peer)); extern int gtp_set_cb_conf(struct gsn_t *gsn, @@ -347,58 +347,58 @@ /* Internal functions (not part of the API */ extern int gtp_echo_req(struct gsn_t *gsn, int version, void *cbp, - struct in_addr *inetaddrs); + struct sockaddr *inetaddrs); extern int gtp_echo_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len); extern int gtp_echo_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len); extern int gtp_echo_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len); extern int gtp_unsup_req(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, int fd, void *pack, unsigned len); -extern int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr_in *peer, +extern int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr *peer, void *pack, unsigned len); extern int gtp_create_pdp_resp(struct gsn_t *gsn, int version, struct pdp_t *pdp, uint8_t cause); extern int gtp_create_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len); extern int gtp_create_pdp_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len); extern int gtp_update_pdp_req(struct gsn_t *gsn, int version, void *cbp, - struct in_addr* inetaddr, struct pdp_t *pdp); + struct sockaddr* inetaddr, struct pdp_t *pdp); extern int gtp_delete_pdp_req(struct gsn_t *gsn, int version, void *cbp, struct pdp_t *pdp); extern int gtp_delete_pdp_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, struct pdp_t *linked_pdp, uint8_t cause, int teardown); extern int gtp_delete_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, + struct sockaddr *peer, int fd, void *pack, unsigned len); extern int gtp_delete_pdp_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, + struct sockaddr *peer, void *pack, unsigned len); extern int ipv42eua(struct ul66_t *eua, struct in_addr *src); extern int eua2ipv4(struct in_addr *dst, struct ul66_t *eua); -extern int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna); -extern int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src); +extern int gsna2in_addr(struct in6_addr *dst, size_t* dstlen, struct ul16_t *gsna); +extern int in_addr2gsna(struct ul16_t *gsna, struct in6_addr *src, size_t srclen); #endif /* !_GTP_H */ diff --git a/gtp/pdp.c b/gtp/pdp.c index 648d70d..642547c 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -328,6 +328,14 @@ return 0; } +int pdp_ntoeua6(struct in6_addr *src, struct ul66_t *eua) { + eua->l=18; + eua->v[0]=0xf1; /* IETF */ + eua->v[1]=0x57; /* IPv6 */ + memcpy(&eua->v[2], src, 16); /* Copy a 16 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)) { return EOF; @@ -335,6 +343,15 @@ memcpy(dst, &eua->v[2], 4); /* Copy a 4 byte address */ return 0; } + +int pdp_euaton6(struct ul66_t *eua, struct in6_addr *dst) { + if((eua->l!=18) || (eua->v[0]!=0xf1) || (eua->v[1]!=0x57)) { + return EOF; + } + memcpy(dst, &eua->v[2], 16); /* Copy a 16 byte address */ + return 0; +} + uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi) { return (imsi & 0x0fffffffffffffffull) + ((uint64_t)nsapi << 60); @@ -349,3 +366,18 @@ } else return EOF; } + +int pdp_testip(struct ul66_t* eua) { + unsigned char type = eua->v[1]; + + switch (type) { + case 0x21: /* IPv4 */ + return 4; + case 0x57: /* IPv6 */ + return 6; + case 0x8d: /* IPv4v6 */ + return 8; // for lack of anything better... + default: + return -1; + } +} diff --git a/gtp/pdp.h b/gtp/pdp.h index 624c4ac..6723b05 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -158,9 +158,13 @@ /*struct ul16_t ggsnu; * The IP address of the GGSN currently used. (User plane) */ struct ul16_t gsnlc; /* The IP address of the local GSN. (Control plane) */ + size_t gsnlc_len; struct ul16_t gsnlu; /* The IP address of the local GSN. (User plane) */ + size_t gsnlu_len; struct ul16_t gsnrc; /* The IP address of the remote GSN. (Control plane) */ + size_t gsnrc_len; struct ul16_t gsnru; /* The IP address of the remote GSN. (User plane) */ + size_t gsnru_len; uint8_t vplmn_allow; /* Specifies whether the MS is allowed to use the APN in the domain of the HPLMN only, or additionally the APN in the domain of the VPLMN. (1 bit) */ uint8_t qos_sub0[3]; /* The quality of service profile subscribed. */ @@ -195,7 +199,7 @@ uint64_t tid; /* Combination of imsi and nsapi */ uint16_t seq; /* Sequence number of last request */ - struct sockaddr_in sa_peer; /* Address of last request */ + struct sockaddr_storage sa_peer; /* Address of last request */ int fd; /* File descriptor request was received on */ uint8_t teic_confirmed; /* 0: Not confirmed. 1: Confirmed */ @@ -209,8 +213,8 @@ uint32_t secondary_tei[PDP_MAXNSAPI]; /* IP address used for Create and Update PDP Context Requests */ - struct in_addr hisaddr0; /* Server address */ - struct in_addr hisaddr1; /* Server address */ + struct sockaddr_storage hisaddr0; /* Server address */ + struct sockaddr_storage hisaddr1; /* Server address */ /* to be used by libgtp callers/users (to attach their own private state) */ void *priv; @@ -243,8 +247,12 @@ */ int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua); +int pdp_ntoeua6(struct in6_addr *src, struct ul66_t *eua); int pdp_euaton(struct ul66_t *eua, struct in_addr *dst); +int pdp_euaton6(struct ul66_t *eua, struct in6_addr *dst); uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi); int ulcpy(void* dst, void* src, size_t size); +int pdp_testip(struct ul66_t* eua); + #endif /* !_PDP_H */ diff --git a/gtp/queue.c b/gtp/queue.c index 7fdf9df..23804fb 100644 --- a/gtp/queue.c +++ b/gtp/queue.c @@ -57,7 +57,7 @@ } int queue_seqset(struct queue_t *queue, struct qmsg_t *qmsg, - struct sockaddr_in *peer, uint16_t seq) { + struct sockaddr *peer, uint16_t seq) { int hash = queue_seqhash(peer, seq); struct qmsg_t *qmsg2; struct qmsg_t *qmsg_prev = NULL; @@ -66,7 +66,7 @@ if (QUEUE_DEBUG) printf("SIZEOF PEER %d, *PEER %d\n", sizeof(peer), sizeof(*peer)); qmsg->seq = seq; - memcpy(&qmsg->peer, peer, sizeof(*peer)); + memcpy(&qmsg->peer, peer, sizeof(struct sockaddr_storage)); for (qmsg2 = queue->hashseq[hash]; qmsg2; qmsg2 = qmsg2->seqnext) qmsg_prev = qmsg2; @@ -123,7 +123,7 @@ } int queue_newmsg(struct queue_t *queue, struct qmsg_t **qmsg, - struct sockaddr_in *peer, uint16_t seq) { + struct sockaddr *peer, uint16_t seq) { if (QUEUE_DEBUG) printf("queue_newmsg %d\n", (int) seq); if (queue->qmsga[queue->next].state == 1) { return EOF; /* Queue is full */ @@ -204,13 +204,13 @@ } int queue_getseqx(struct queue_t *queue, struct qmsg_t **qmsg, - struct sockaddr_in *peer, uint16_t seq) { + struct sockaddr *peer, uint16_t seq) { int n; if (QUEUE_DEBUG) printf("queue_getseq, %d\n", (int) seq); if (QUEUE_DEBUG) queue_print(queue); for (n=0; nqmsga[n].seq == seq) && - (!memcmp(&queue->qmsga[n].peer, peer, sizeof(*peer)))) { + (!memcmp(&queue->qmsga[n].peer, peer, peer->sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)))) { *qmsg = &queue->qmsga[n]; return 0; } @@ -219,13 +219,13 @@ } int queue_seqget(struct queue_t *queue, struct qmsg_t **qmsg, - struct sockaddr_in *peer, uint16_t seq) { + struct sockaddr *peer, uint16_t seq) { int hash = queue_seqhash(peer, seq); struct qmsg_t *qmsg2; if (QUEUE_DEBUG) printf("Begin queue_seqget seq = %d\n", (int) seq); for (qmsg2 = queue->hashseq[hash]; qmsg2; qmsg2 = qmsg2->seqnext) { if ((qmsg2->seq == seq) && - (!memcmp(&qmsg2->peer, peer, sizeof(*peer)))) { + (!memcmp(&qmsg2->peer, peer, peer->sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)))) { *qmsg = qmsg2; if (QUEUE_DEBUG) printf("End queue_seqget. Found\n"); return 0; @@ -235,7 +235,7 @@ return EOF; /* End of linked list and not found */ } -int queue_freemsg_seq(struct queue_t *queue, struct sockaddr_in *peer, +int queue_freemsg_seq(struct queue_t *queue, struct sockaddr *peer, uint16_t seq, uint8_t *type, void **cbp) { struct qmsg_t *qmsg; if (queue_seqget(queue, &qmsg, peer, seq)) { diff --git a/gtp/queue.h b/gtp/queue.h index 46fa22d..11978c1 100644 --- a/gtp/queue.h +++ b/gtp/queue.h @@ -30,7 +30,7 @@ union gtp_packet p; /* The packet stored */ int l; /* Length of the packet */ int fd; /* Socket packet was sent to / received from */ - struct sockaddr_in peer;/* Address packet was sent to / received from */ + struct sockaddr_storage peer;/* Address packet was sent to / received from */ struct qmsg_t *seqnext; /* Pointer to next in sequence hash list */ int next; /* Pointer to the next in queue. -1: Last */ int prev; /* Pointer to the previous in queue. -1: First */ @@ -54,7 +54,7 @@ int queue_free(struct queue_t *queue); /* Find a new queue element. Return EOF if allready full */ int queue_newmsg(struct queue_t *queue, struct qmsg_t **qmsg, - struct sockaddr_in *peer, uint16_t seq); + struct sockaddr *peer, uint16_t seq); /* Remove an element from the queue. */ int queue_freemsg(struct queue_t *queue, struct qmsg_t *qmsg); /* Move an element to the back of the queue */ @@ -63,9 +63,9 @@ int queue_getfirst(struct queue_t *queue, struct qmsg_t **qmsg); /* Get the element with a particular sequence number */ int queue_seqget(struct queue_t *queue, struct qmsg_t **qmsg, - struct sockaddr_in *peer, uint16_t seq); + struct sockaddr *peer, uint16_t seq); /* Free message based on sequence number */ -int queue_freemsg_seq(struct queue_t *queue, struct sockaddr_in *peer, +int queue_freemsg_seq(struct queue_t *queue, struct sockaddr *peer, uint16_t seq, uint8_t *type, void **cbp); diff --git a/sgsnemu/ippool.c b/sgsnemu/ippool.c index fa3d8af..9408d47 100644 --- a/sgsnemu/ippool.c +++ b/sgsnemu/ippool.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "syserr.h" #include "ippool.h" @@ -32,13 +33,32 @@ printf("Listsize %d\n", this->listsize); for (n=0; nlistsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s [1024]; + char s2 [1024]; + struct sockaddr_storage ss; + + size_t addrlen = this->member[n].addrlen; + size_t sockaddrlen; + + memcpy(((struct sockaddr*)&ss)->sa_data, &this->member[n].addr, addrlen); + + if (addrlen == 4) { + ss.ss_family = AF_INET; + sockaddrlen = sizeof(struct sockaddr_in); + } + else { + ss.ss_family = AF_INET6; + sockaddrlen = sizeof(struct sockaddr_in6); + } + + getnameinfo((struct sockaddr*)&ss, sockaddrlen, s, sizeof(s), s2, sizeof(s2), NI_NUMERICHOST); + + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr + s ); } return 0; @@ -50,12 +70,15 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + if (member->addrlen == 4) + hash = ippool_hash4((struct in_addr*)&member->addr) & this->hashmask; + else + hash = ippool_hash6(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) this->hash[hash] = member; - else + else p_prev->nexthash = member; return 0; /* Always OK to insert */ } @@ -66,7 +89,10 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + if (member->addrlen == 4) + hash = ippool_hash4((struct in_addr*)&member->addr) & this->hashmask; + else + hash = ippool_hash6(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -93,66 +119,80 @@ return lookup((unsigned char*) &addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char*) addr->u6_addr8, sizeof(addr->u6_addr8), 0); + // TODO: review hash spread for ipv6 + return lookup((unsigned char*) addr->s6_addr32, sizeof(addr->s6_addr32), 0); } -#endif - /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) { +int ippool_aton(struct in_addr *addr, size_t *addrlen, size_t* prefixlen, char *pool, int number) { + struct addrinfo* ai; - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + struct addrinfo hints; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = 0; + hints.ai_protocol = 0; - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, - &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Invalid mask */ - } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m)+1)); masklog++); - if (((~m)+1) != (1 << masklog)) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros)*/ - } - mask->s_addr = htonl(m); - break; - default: - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid mask"); - return -1; /* Invalid mask */ - } + // Find '/' + char* prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Empty prefix length specified"); + return -1; + } + } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Wrong IP address format"); - return -1; - } - else - addr->s_addr = htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + // Convert address + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Bad address"); + return -1; + } - return 0; + // Copy address, set lengths + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + *addrlen = sizeof(struct in_addr); + memcpy(addr, &((struct sockaddr_in*)ai->ai_addr)->sin_addr, sizeof(struct in_addr)); + } + else { + *prefixlen = 128; + *addrlen = sizeof(struct in6_addr); + memcpy(addr, &((struct sockaddr_in6*)ai->ai_addr)->sin6_addr, sizeof(struct in6_addr)); + } + + freeaddrinfo(ai); + + // Parse prefixlen + if (prefixlen_str) { + char* e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (*addrlen * 8)) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Prefixlen too big"); + return -1; + } + + return 0; +} + +/* Increases ip4/6 address by 1 */ +void inc_addr(struct in_addr* addr, size_t addrlen) +{ + uint8_t* a = (uint8_t*)&addr->s_addr; + for (; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -162,10 +202,12 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; + struct in6_addr addr; + size_t addrlen; + size_t addrprefixlen; + struct in6_addr stataddr; + size_t stataddrlen; + size_t stataddrprefixlen; unsigned int m; int listsize; int dynsize; @@ -175,7 +217,7 @@ dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton((struct in_addr*)&addr, &addrlen, &addrprefixlen, dyn, 0)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to parse dynamic pool"); return -1; @@ -185,9 +227,11 @@ if (flags & IPPOOL_NOGATEWAY) { flags |= IPPOOL_NONETWORK; } - - m = ntohl(mask.s_addr); - dynsize = ((~m)+1); + + dynsize = (1 << (addrlen - addrprefixlen + 1)) - 1; + + //m = ntohl(mask.s_addr); + //dynsize = ((~m)+1); if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -198,18 +242,17 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddrlen = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton((struct in_addr*)&stataddr, &stataddrlen, &stataddrprefixlen, stat, 0)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m)+1); + statsize = (1 << (addrlen - addrprefixlen + 1)) - 1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -223,8 +266,10 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddrlen > 0) + memcpy(&(*this)->stataddr, &stataddr, stataddrlen); + (*this)->stataddrlen = stataddrlen; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))){ @@ -252,15 +297,20 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + + if (flags & IPPOOL_NOGATEWAY) { + inc_addr((struct in_addr*)&addr, addrlen); + inc_addr((struct in_addr*)&addr, addrlen); + } + else if (flags & IPPOOL_NONETWORK) + inc_addr((struct in_addr*)&addr, addrlen); + for (i = 0; imember[i].addr.s_addr = htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = htonl(ntohl(addr.s_addr) + i); - + memcpy(&(*this)->member[i].addr, &addr, addrlen); + (*this)->member[i].addrlen = addrlen; + inc_addr((struct in_addr*)&addr, addrlen); + (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -280,8 +330,10 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; imember[i].addr, 0, addrlen); + (*this)->member[i].addrlen = addrlen; - (*this)->member[i].addr.s_addr = 0; (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -312,14 +364,19 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) { + struct in_addr *addr, size_t addrlen) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + if (addrlen == 4) + hash = ippool_hash4(addr) & this->hashmask; + else + hash = ippool_hash6(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (p->addrlen == addrlen + && memcmp(&p->addr, addr, addrlen) == 0 + && (p->inuse)) { if (member) *member = p; return 0; } @@ -337,7 +394,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) { + struct in_addr *addr, size_t addrlen, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; uint32_t hash; @@ -357,15 +414,25 @@ if (0) (void)ippool_printaddr(this); /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + int specified = 0; + if (addr) { + if (addrlen == 4 && ((struct in_addr*)&addr)->s_addr) + specified = 1; + if (addrlen == 16 && !IN6_IS_ADDR_UNSPECIFIED(addr)) + specified = 1; + } + if (specified && statip) { /* IP address given */ if (!this->allowstat) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Static IP address not allowed"); return -1; } + // TODO: ipv6 mask check +/* if ((addr->s_addr & this->statmask.s_addr) != this->stataddr.s_addr) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Static out of range"); return -1; } +*/ } else { if (!this->allowdyn) { @@ -376,11 +443,14 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + if (addrlen == 4) + hash = ippool_hash4(addr) & this->hashmask; + else + hash = ippool_hash6(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (p->addrlen == addrlen && !memcmp(&p->addr, &addr, addrlen)) { p2 = p; break; } @@ -431,7 +501,7 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "No more IP addresses available"); @@ -452,7 +522,7 @@ p2->next = NULL; p2->prev = NULL; p2->inuse = 2; /* Static address in use */ - memcpy(&p2->addr, addr, sizeof(addr)); + memcpy(&p2->addr, addr, addrlen); *member = p2; (void)ippool_hashadd(this, *member); if (0) (void)ippool_printaddr(this); @@ -507,7 +577,8 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); + member->addrlen = 0; member->peer = NULL; member->nexthash = NULL; if (0) (void)ippool_printaddr(this); @@ -519,8 +590,3 @@ } -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/sgsnemu/ippool.h b/sgsnemu/ippool.h index 02691a6..432fa8d 100644 --- a/sgsnemu/ippool.h +++ b/sgsnemu/ippool.h @@ -26,8 +26,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,7 +38,9 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ + struct in6_addr stataddr; /* Static address range network address */ + size_t stataddrlen; + size_t stataddrprefixlen; struct in_addr statmask; /* Static address range network mask */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ @@ -54,11 +54,8 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + size_t addrlen; int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -81,25 +78,22 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in_addr *addr, size_t addrlen); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in_addr *addr, size_t addrlen, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, +extern int ippool_aton(struct in_addr *addr, size_t *addrlen, size_t *prefixlen, char *pool, int number); - -#ifndef IPPOOL_NOIP6 extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif + +void inc_addr(struct in_addr* addr, size_t addrlen); #endif /* !_IPPOOL_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 9b5c2e2..42350e5 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -59,7 +59,8 @@ uint8_t inuse; /* 0=free. 1=used by somebody */ struct iphash_t *ipnext; struct pdp_t *pdp; - struct in_addr addr; + struct in6_addr addr; + size_t addrlen; }; struct iphash_t iparr[MAXCONTEXTS]; struct iphash_t *iphash[MAXCONTEXTS]; @@ -82,17 +83,20 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ - struct in_addr netaddr, destaddr, net, mask; /* Network interface */ + struct sockaddr_storage netaddr; + struct sockaddr_storage destaddr; + struct sockaddr_storage net; + size_t net_prefixlen; char *ipup, *ipdown; /* Filename of scripts */ int defaultroute; /* Set up default route */ - struct in_addr pinghost; /* Remote ping host */ + struct sockaddr_storage pinghost; /* Remote ping host */ int pingrate; int pingsize; int pingcount; int pingquiet; - struct in_addr listen; - struct in_addr remote; - struct in_addr dns; + struct sockaddr_storage listen; + struct sockaddr_storage remote; + struct sockaddr_storage dns; int contexts; /* Number of contexts to create */ int timelimit; /* Number of seconds to be connected */ char *statedir; @@ -145,12 +149,17 @@ int pingseq = 0; /* Ping sequence counter */ struct timeval firstping; -int ipset(struct iphash_t *ipaddr, struct in_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; +int ipset(struct iphash_t *ipaddr, struct in_addr *addr, size_t addrlen) { + int hash; + if (addrlen == 4) + hash = ippool_hash4(addr) % MAXCONTEXTS; + else + hash = ippool_hash6((struct in6_addr*)addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; ipaddr->ipnext = NULL; - ipaddr->addr.s_addr = addr->s_addr; + memcpy(&ipaddr->addr, addr, addrlen); + ipaddr->addrlen = addrlen; for (h = iphash[hash]; h; h = h->ipnext) prev = h; if (!prev) @@ -161,7 +170,11 @@ } int ipdel(struct iphash_t *ipaddr) { - int hash = ippool_hash4(&ipaddr->addr) % MAXCONTEXTS; + int hash; + if (ipaddr->addrlen == 4) + hash = ippool_hash4((struct in_addr*)&ipaddr->addr) % MAXCONTEXTS; + else + hash = ippool_hash6(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; for (h = iphash[hash]; h; h = h->ipnext) { @@ -177,18 +190,21 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; +int ipget(struct iphash_t **ipaddr, struct in_addr *addr, size_t addrlen) { + int hash; + if (addrlen == 4) + hash = ippool_hash4(addr) % MAXCONTEXTS; + else + hash = ippool_hash6((struct in6_addr*)addr) % MAXCONTEXTS; struct iphash_t *h; for (h = iphash[hash]; h; h = h->ipnext) { - if ((h->addr.s_addr == addr->s_addr)) { + if (h->addrlen == addrlen && memcmp(&h->addr, addr, addrlen) == 0) { *ipaddr = h; return 0; } } return EOF; /* End of linked list and not found */ } - /* Used to write process ID to file. Assume someone else will delete */ void log_pid(char *pidfile) { @@ -209,8 +225,16 @@ /* gengeopt declarations */ struct gengetopt_args_info args_info; - struct hostent *host; + struct addrinfo* ai; unsigned int n; + + struct addrinfo hints; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = 0; + hints.ai_protocol = 0; + + int err; if (cmdline_parser (argc, argv, &args_info) != 0) return -1; @@ -306,21 +330,26 @@ /* Do hostname lookup to translate hostname to IP address */ printf("\n"); if (args_info.dns_arg) { - if (!(host = gethostbyname(args_info.dns_arg))) { + if ((err = getaddrinfo(args_info.dns_arg, NULL, &hints, &ai))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, - "Invalid DNS address: %s!", args_info.dns_arg); + "Invalid DNS address: %s! %s %i", args_info.dns_arg, gai_strerror(err), err); return -1; } else { - memcpy(&options.dns.s_addr, host->h_addr, host->h_length); - _res.nscount = 1; - _res.nsaddr_list[0].sin_addr = options.dns; - printf("Using DNS server: %s (%s)\n", - args_info.dns_arg, inet_ntoa(options.dns)); + memcpy(&options.dns, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); + + // TODO: ipv6 + if (options.dns.ss_family == AF_INET) { + _res.nscount = 1; + _res.nsaddr_list[0].sin_addr = ((struct sockaddr_in*)&options.dns)->sin_addr; + //printf("Using DNS server: %s (%s)\n", + //args_info.dns_arg, inet_ntoa(options.dns)); + } } } else { - options.dns.s_addr= 0; + options.dns.ss_family = 0; // Indicates not specified printf("Using default DNS server\n"); } @@ -328,15 +357,17 @@ /* If no listen option is specified listen to any local port */ /* Do hostname lookup to translate hostname to IP address */ if (args_info.listen_arg) { - if (!(host = gethostbyname(args_info.listen_arg))) { + if ((err = getaddrinfo(args_info.listen_arg, NULL, &hints, &ai))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, - "Invalid listening address: %s!", args_info.listen_arg); + "Invalid listening address: %s! %s %i", args_info.listen_arg, gai_strerror(err), err); return -1; } else { - memcpy(&options.listen.s_addr, host->h_addr, host->h_length); - printf("Local IP address is: %s (%s)\n", - args_info.listen_arg, inet_ntoa(options.listen)); + memcpy(&options.listen, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); + // TODO: ipv6 + //printf("Local IP address is: %s (%s)\n", + //args_info.listen_arg, inet_ntoa(options.listen)); } } else { @@ -350,15 +381,17 @@ /* If no remote option is specified terminate */ /* Do hostname lookup to translate hostname to IP address */ if (args_info.remote_arg) { - if (!(host = gethostbyname(args_info.remote_arg))) { + if ((err = getaddrinfo(args_info.remote_arg, NULL, &hints, &ai))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, - "Invalid remote address: %s!", args_info.remote_arg); + "Invalid remote address: %s! %s %i", args_info.remote_arg, gai_strerror(err), err); return -1; } else { - memcpy(&options.remote.s_addr, host->h_addr, host->h_length); - printf("Remote IP address is: %s (%s)\n", - args_info.remote_arg, inet_ntoa(options.remote)); + memcpy(&options.remote, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); + // TODO: ipv6 + //printf("Remote IP address is: %s (%s)\n", + //args_info.remote_arg, inet_ntoa(options.remote)); } } else { @@ -498,26 +531,31 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if(ippool_aton(&options.net, &options.mask, args_info.net_arg, 0)) { + size_t addrlen; + if(ippool_aton(&(((struct sockaddr_in*)&options.net)->sin_addr), &addrlen, &options.net_prefixlen, args_info.net_arg, 0)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + if (addrlen == 4) + options.net.ss_family = AF_INET; + else + options.net.ss_family = AF_INET6; #if defined (__sun__) options.netaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); #else - options.netaddr.s_addr = options.net.s_addr; - options.destaddr.s_addr = options.net.s_addr; + memcpy(&options.netaddr, &options.net, sizeof(options.net)); + memcpy(&options.destaddr, &options.net, sizeof(options.net)); #endif } else { - options.net.s_addr = 0; - options.mask.s_addr = 0; - options.netaddr.s_addr = 0; - options.destaddr.s_addr = 0; + options.net.ss_family = 0; + options.net_prefixlen = 0; + options.netaddr.ss_family = 0; + options.destaddr.ss_family = 0; } /* ipup */ @@ -536,16 +574,21 @@ /* pinghost */ /* Store ping host as in_addr */ if (args_info.pinghost_arg) { - if (!(host = gethostbyname(args_info.pinghost_arg))) { + if ((err = getaddrinfo(args_info.pinghost_arg, NULL, &hints, &ai))) { + //if (!(host = gethostbyname(args_info.pinghost_arg))) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, - "Invalid ping host: %s!", args_info.pinghost_arg); + "Invalid ping host: %s! %s %i", args_info.pinghost_arg, gai_strerror(err), err); return -1; } else { - memcpy(&options.pinghost.s_addr, host->h_addr, host->h_length); - printf("Using ping host: %s (%s)\n", - args_info.pinghost_arg, inet_ntoa(options.pinghost)); + memcpy(&options.pinghost, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); + //printf("Using ping host: %s (%s)\n", +// args_info.pinghost_arg, inet_ntoa(options.pinghost)); } + } + else { + options.pinghost.ss_family = 0; // Indicates not specified } /* Other ping parameters */ @@ -687,7 +730,7 @@ struct timezone tz; struct timeval tv; int diff; - if ((options.pinghost.s_addr) && (2 == state) && + if ((options.pinghost.ss_family) && (2 == state) && ((pingseq < options.pingcount) || (options.pingcount == 0))) { gettimeofday(&tv, &tz); diff = 1000000 / options.pingrate * pingseq - @@ -715,7 +758,8 @@ elapsed = 1000000 * (tv.tv_sec - firstping.tv_sec) + (tv.tv_usec - firstping.tv_usec); /* Microseconds */ printf("\n"); - printf("\n----%s PING Statistics----\n", inet_ntoa(options.pinghost)); + //TODO: ipv6 + //printf("\n----%s PING Statistics----\n", inet_ntoa(options.pinghost)); printf("%d packets transmitted in %.3f seconds, ", ntransmitted, elapsed / 1000000.0); printf("%d packets received, ", nreceived ); @@ -899,12 +943,21 @@ /* Callback for receiving messages from tun */ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; - struct in_addr src; + struct in6_addr src; + size_t srclen; struct tun_packet_t *iph = (struct tun_packet_t*) pack; + struct tun_packet6_t *ip6h = (struct tun_packet6_t*) pack; - src.s_addr = iph->src; + if (iph->ver == 4) { + memcpy(&src, &iph->src, sizeof(struct in_addr)); + srclen = 4; + } + else { + memcpy(&src, ip6h->src, sizeof(struct in6_addr)); + srclen = 16; + } - if (ipget(&ipm, &src)) { + if (ipget(&ipm, (struct in_addr*)&src, srclen)) { printf("Received packet without a valid source address!!!\n"); return 0; } @@ -916,6 +969,8 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { struct in_addr addr; + struct in6_addr addr6; + int ip6 = 0; struct iphash_t *iph = (struct iphash_t*) cbp; @@ -944,17 +999,20 @@ } if (pdp_euaton(&pdp->eua, &addr)) { - printf("Received create PDP context response. Cause value: %d\n", cause); - pdp_freepdp(iph->pdp); - iph->pdp = NULL; - state = 0; - return EOF; /* Not a valid IP address */ + if (pdp_euaton6(&pdp->eua, &addr6)) { + printf("Received create PDP context response. Cause value: %d\n", cause); + pdp_freepdp(iph->pdp); + iph->pdp = NULL; + state = 0; + return EOF; /* Not a valid IP address */ + } + ip6 = 1; } printf("Received create PDP context response. IP address: %s\n", inet_ntoa(addr)); - if ((options.createif) && (!options.net.s_addr)) { + if ((options.createif) && (!options.net.ss_family)) { struct in_addr m; #ifdef HAVE_INET_ATON inet_aton("255.255.255.255", &m); @@ -962,7 +1020,10 @@ m.s_addr = -1; #endif /* printf("Setting up interface and routing\n");*/ - tun_addaddr(tun, &addr, &addr, &m); + if (ip6) + tun_addaddr6(tun, &addr6, &addr6, 128); + else + tun_addaddr(tun, &addr, &addr, &m); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; @@ -971,7 +1032,10 @@ if (options.ipup) tun_runscript(tun, options.ipup); } - ipset((struct iphash_t*) pdp->peer, &addr); + if (ip6) + ipset((struct iphash_t*) pdp->peer, (struct in_addr*)&addr6, sizeof(addr6)); + else + ipset((struct iphash_t*) pdp->peer, &addr, sizeof(addr)); state = 2; /* Connected */ @@ -990,7 +1054,7 @@ if (echoversion == 1) { printf("Retrying with version 0\n"); echoversion = 0; - gtp_echo_req(gsn, echoversion, NULL, &options.remote); + gtp_echo_req(gsn, echoversion, NULL, (struct sockaddr*)&options.remote); return 0; } else { @@ -1056,7 +1120,7 @@ exit(1); printf("\nInitialising GTP library\n"); - if (gtp_new(&gsn, options.statedir, &options.listen, GTP_MODE_SGSN)) { + if (gtp_new(&gsn, options.statedir, (struct sockaddr*)&options.listen, GTP_MODE_SGSN)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "Failed to create gtp"); exit(1); @@ -1084,13 +1148,23 @@ if (tun->fd > maxfd) maxfd = tun->fd; } - if ((options.createif) && (options.net.s_addr)) { + if ((options.createif) && (options.net.ss_family)) { /* printf("Setting up interface and routing\n");*/ - tun_addaddr(tun, &options.netaddr, &options.destaddr, &options.mask); + if (options.net.ss_family == AF_INET) { + struct in_addr mask; + mask.s_addr = 0xFFFFFFFF << (32-options.net_prefixlen); + tun_addaddr(tun, &((struct sockaddr_in*)&options.netaddr)->sin_addr, &((struct sockaddr_in*)&options.destaddr)->sin_addr, &mask); + } + else { + tun_addaddr6(tun, &((struct sockaddr_in6*)&options.netaddr)->sin6_addr, &((struct sockaddr_in6*)&options.destaddr)->sin6_addr, options.net_prefixlen); + } if (options.defaultroute) { - struct in_addr rm; - rm.s_addr = 0; - tun_addroute(tun, &rm, &options.destaddr, &rm); + if (options.destaddr.ss_family == AF_INET) { + struct in_addr rm; + rm.s_addr = 0; + tun_addroute(tun, &rm, &((struct sockaddr_in*)&options.destaddr)->sin_addr, &rm); + } + // TODO: IPv6 default route } if (options.ipup) tun_runscript(tun, options.ipup); } @@ -1105,7 +1179,7 @@ /* See if anybody is there */ printf("Sending off echo request\n"); echoversion = options.gtpversion; - gtp_echo_req(gsn, echoversion, NULL, &options.remote); /* Is remote alive? */ + gtp_echo_req(gsn, echoversion, NULL, (struct sockaddr*)&options.remote); /* Is remote alive? */ for(n=0; napn_use.v, options.apn.v, options.apn.l); } - pdp->gsnlc.l = sizeof(options.listen); - memcpy(pdp->gsnlc.v, &options.listen, sizeof(options.listen)); - pdp->gsnlu.l = sizeof(options.listen); - memcpy(pdp->gsnlu.v, &options.listen, sizeof(options.listen)); + if (options.listen.ss_family == AF_INET) { + struct sockaddr_in* s = (struct sockaddr_in*)&options.listen; + memcpy(pdp->gsnlc.v, &s->sin_addr, sizeof(s->sin_addr)); + memcpy(pdp->gsnlu.v, &s->sin_addr, sizeof(s->sin_addr)); + pdp->gsnlc.l = sizeof(s->sin_addr); + pdp->gsnlu.l = sizeof(s->sin_addr); + } + else { + struct sockaddr_in6* s = (struct sockaddr_in6*)&options.listen; + memcpy(pdp->gsnlc.v, &s->sin6_addr, sizeof(s->sin6_addr)); + memcpy(pdp->gsnlu.v, &s->sin6_addr, sizeof(s->sin6_addr)); + pdp->gsnlc.l = sizeof(s->sin6_addr); + pdp->gsnlu.l = sizeof(s->sin6_addr); + } if (options.msisdn.l > sizeof(pdp->msisdn.v)) { sys_err(LOG_ERR, __FILE__, __LINE__, 0, "MSISDN length too big"); @@ -1173,8 +1257,9 @@ pdp->version = options.gtpversion; - pdp->hisaddr0 = options.remote; - pdp->hisaddr1 = options.remote; + memcpy(&pdp->hisaddr0, &options.remote, options.remote.ss_family == AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)); + memcpy(&pdp->hisaddr1, &options.remote, options.remote.ss_family == AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)); + pdp->cch_pdp = options.cch; /* 2048 = Normal, 1024 = Prepaid, 512 = Flat rate, 256 = Hot billing */ @@ -1231,7 +1316,7 @@ /* Delete context */ printf("Disconnecting PDP context #%d\n", n); gtp_delete_context_req(gsn, iparr[n].pdp, NULL, 1); - if ((options.pinghost.s_addr !=0) && ntransmitted) ping_finish(); + if ((options.pinghost.ss_family !=0) && ntransmitted) ping_finish(); } } @@ -1239,7 +1324,7 @@ diff = 0; while (( diff<=0 ) && /* Send off an ICMP ping packet */ - /*if (*/(options.pinghost.s_addr) && (2 == state) && + /*if (*/(options.pinghost.ss_family) && (2 == state) && ((pingseq < options.pingcount) || (options.pingcount == 0))) { if (!pingseq) gettimeofday(&firstping, &tz); /* Set time of first ping */ gettimeofday(&tv, &tz); @@ -1249,7 +1334,7 @@ if (diff <=0) { if (options.debug) printf("Create_ping %d\n", diff); create_ping(gsn, iparr[pingseq % options.contexts].pdp, - &options.pinghost, pingseq, options.pingsize); + &((struct sockaddr_in*)&options.pinghost)->sin_addr, pingseq, options.pingsize); pingseq++; } } diff --git a/sgsnemu/tun.c b/sgsnemu/tun.c index 1cc706b..2bb852f 100644 --- a/sgsnemu/tun.c +++ b/sgsnemu/tun.c @@ -71,6 +71,13 @@ #if defined(__linux__) +// From linux/ipv6.h +struct in6_ifreq { + struct in6_addr ifr6_addr; + __u32 ifr6_prefixlen; + int ifr6_ifindex; +}; + int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { int len = RTA_LENGTH(dlen); @@ -397,6 +404,174 @@ } +int tun_addaddr6(struct tun_t *this, + struct in6_addr *addr, + struct in6_addr *dstaddr, + size_t prefixlen) { + +#if defined(__linux__) + struct { + struct nlmsghdr n; + struct ifaddrmsg i; + char buf[TUN_NLBUFSIZE]; + } req; + + struct sockaddr_nl local; + socklen_t addr_len; + int fd; + int status; + + struct sockaddr_nl nladdr; + struct iovec iov; + struct msghdr msg; + + if (!this->addrs) /* Use ioctl for first addr to make ping work */ + return tun_setaddr6(this, addr, dstaddr, prefixlen); + + memset(&req, 0, sizeof(req)); + req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); + req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; + req.n.nlmsg_type = RTM_NEWADDR; + req.i.ifa_family = AF_INET6; + req.i.ifa_prefixlen = 128; /* 128 FOR IPv6 */ + req.i.ifa_flags = 0; + req.i.ifa_scope = RT_SCOPE_HOST; /* TODO or 0 */ + if (tun_gifindex(this, &req.i.ifa_index)) { + return -1; + } + + tun_nlattr(&req.n, sizeof(req), IFA_ADDRESS, addr, sizeof(addr)); + tun_nlattr(&req.n, sizeof(req), IFA_LOCAL, dstaddr, sizeof(dstaddr)); + + if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "socket() failed"); + return -1; + } + + memset(&local, 0, sizeof(local)); + local.nl_family = AF_NETLINK; + local.nl_groups = 0; + + if (bind(fd, (struct sockaddr*)&local, sizeof(local)) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "bind() failed"); + close(fd); + return -1; + } + + addr_len = sizeof(local); + if (getsockname(fd, (struct sockaddr*)&local, &addr_len) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "getsockname() failed"); + close(fd); + return -1; + } + + if (addr_len != sizeof(local)) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, + "Wrong address length %d", addr_len); + close(fd); + return -1; + } + + if (local.nl_family != AF_NETLINK) { + sys_err(LOG_ERR, __FILE__, __LINE__, 0, + "Wrong address family %d", local.nl_family); + close(fd); + return -1; + } + + iov.iov_base = (void*)&req.n; + iov.iov_len = req.n.nlmsg_len; + + msg.msg_name = (void*)&nladdr; + msg.msg_namelen = sizeof(nladdr), + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + + memset(&nladdr, 0, sizeof(nladdr)); + nladdr.nl_family = AF_NETLINK; + nladdr.nl_pid = 0; + nladdr.nl_groups = 0; + + req.n.nlmsg_seq = 0; + req.n.nlmsg_flags |= NLM_F_ACK; + + status = sendmsg(fd, &msg, 0); /* TODO Error check */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); /* TODO */ + close(fd); + this->addrs++; + return 0; + + + +#elif defined (__FreeBSD__) || defined (__APPLE__) + + int fd; + struct ifaliasreq areq; + + /* TODO: Is this needed on FreeBSD? */ + if (!this->addrs) /* Use ioctl for first addr to make ping work */ + return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + + memset(&areq, 0, sizeof(areq)); + + /* Set up interface name */ + strncpy(areq.ifra_name, this->devname, IFNAMSIZ); + areq.ifra_name[IFNAMSIZ-1] = 0; /* Make sure to terminate */ + + ((struct sockaddr_in*) &areq.ifra_addr)->sin_family = AF_INET; + ((struct sockaddr_in*) &areq.ifra_addr)->sin_len = sizeof(areq.ifra_addr); + ((struct sockaddr_in*) &areq.ifra_addr)->sin_addr.s_addr = addr->s_addr; + + ((struct sockaddr_in*) &areq.ifra_mask)->sin_family = AF_INET; + ((struct sockaddr_in*) &areq.ifra_mask)->sin_len = sizeof(areq.ifra_mask); + ((struct sockaddr_in*) &areq.ifra_mask)->sin_addr.s_addr = netmask->s_addr; + + /* For some reason FreeBSD uses ifra_broadcast for specifying dstaddr */ + ((struct sockaddr_in*) &areq.ifra_broadaddr)->sin_family = AF_INET; + ((struct sockaddr_in*) &areq.ifra_broadaddr)->sin_len = + sizeof(areq.ifra_broadaddr); + ((struct sockaddr_in*) &areq.ifra_broadaddr)->sin_addr.s_addr = + dstaddr->s_addr; + + /* Create a channel to the NET kernel. */ + if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "socket() failed"); + return -1; + } + + if (ioctl(fd, SIOCAIFADDR, (void *) &areq) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "ioctl(SIOCAIFADDR) failed"); + close(fd); + return -1; + } + + close(fd); + this->addrs++; + return 0; + +#elif defined (__sun__) + + if (!this->addrs) /* Use ioctl for first addr to make ping work */ + return tun_setaddr(this, addr, dstaddr, netmask); + + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "Setting multiple addresses not possible on Solaris"); + return -1; + +#else +#error "Unknown platform!" +#endif +} + int tun_setaddr(struct tun_t *this, struct in_addr *addr, @@ -431,7 +606,7 @@ } if (addr) { /* Set the interface address */ - this->addr.s_addr = addr->s_addr; + ((struct in_addr*)&this->addr)->s_addr = addr->s_addr; ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr = addr->s_addr; if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { if (errno != EEXIST) { @@ -448,7 +623,7 @@ } if (dstaddr) { /* Set the destination address */ - this->dstaddr.s_addr = dstaddr->s_addr; + ((struct in_addr*)&this->dstaddr)->s_addr = dstaddr->s_addr; ((struct sockaddr_in *) &ifr.ifr_dstaddr)->sin_addr.s_addr = dstaddr->s_addr; if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) { @@ -487,6 +662,87 @@ close(fd); this->addrs++; + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute(this, dstaddr, addr, netmask); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr6(struct tun_t *this, + struct in6_addr *addr, + struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + struct ifreq namereq; + int fd; + + this->ip6 = 1; + + memset (&ifr, '\0', sizeof (ifr)); + memset (&namereq, '\0', sizeof (namereq)); + + /* Create a channel to the NET kernel. */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "socket() failed"); + return -1; + } + + // Get interface index + strncpy(namereq.ifr_name, this->devname, IFNAMSIZ); + namereq.ifr_name[IFNAMSIZ-1] = 0; /* Make sure to terminate */ + if (ioctl(fd, SIOGIFINDEX, &namereq) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, "Could not get ifindex"); + return -1; + } + ifr.ifr6_ifindex = namereq.ifr_ifindex; + + ifr.ifr6_prefixlen = prefixlen; + + if (addr) { /* Set the interface address */ + memcpy(&this->addr, addr, sizeof(struct in6_addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(struct in6_addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "ioctl(SIOCSIFADDR) failed"); + } + else { + sys_err(LOG_WARNING, __FILE__, __LINE__, errno, + "ioctl(SIOCSIFADDR): Address already exists"); + } + close(fd); + return -1; + } + } + +#ifdef xxx + // Looks like this is not possible/necessary for ipv6? + if (dstaddr) { /* Set the destination address */ + memcpy(&this->dstaddr, dstaddr, sizeof(struct in6_addr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(struct in6_addr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif //xxx + + close(fd); + this->addrs++; + /* On linux the route to the interface is set automatically on FreeBSD we have to do this manually */ @@ -883,9 +1139,10 @@ char snet[TUN_ADDRSIZE]; char smask[TUN_ADDRSIZE]; - strncpy(snet, inet_ntoa(tun->addr), sizeof(snet)); + //TODO: fix for IPv6 + //strncpy(snet, inet_ntoa(tun->addr), sizeof(snet)); snet[sizeof(snet)-1] = 0; - strncpy(smask, inet_ntoa(tun->netmask), sizeof(smask)); + //strncpy(smask, inet_ntoa(tun->netmask), sizeof(smask)); smask[sizeof(smask)-1] = 0; /* system("ipup /dev/tun0 192.168.0.10 255.255.255.0"); */ diff --git a/sgsnemu/tun.h b/sgsnemu/tun.h index 7972c53..a75cc43 100644 --- a/sgsnemu/tun.h +++ b/sgsnemu/tun.h @@ -17,9 +17,18 @@ #define TUN_ADDRSIZE 128 #define TUN_NLBUFSIZE 1024 +/* This should not be re-declared! Why not just use netinet/ip(6).h? + * It is not completely functional as it is here. Just the minimum + * amount of hacking has been done to make it work. */ struct tun_packet_t { +#if BYTE_ORDER == LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int ver:4; +#endif +#if BYTE_ORDER == BIG_ENDIAN unsigned int ver:4; unsigned int ihl:4; +#endif unsigned int dscp:6; unsigned int ecn:2; unsigned int length:16; @@ -29,8 +38,19 @@ unsigned int ttl:8; unsigned int protocol:8; unsigned int check:16; - unsigned int src:32; - unsigned int dst:32; + uint32_t src; + uint32_t dst; +}; + +struct tun_packet6_t { + unsigned int ver:4; + unsigned int tclass:8; + unsigned int flowlabel:20; + unsigned int payloadlen:16; + unsigned int nexthdr:8; + unsigned int hoplim:8; + unsigned char src[16]; + unsigned char dst[16]; }; @@ -39,10 +59,12 @@ *************************************************************/ struct tun_t { + int ip6; int fd; /* File descriptor to tun interface */ - struct in_addr addr; - struct in_addr dstaddr; - struct in_addr netmask; + struct in6_addr addr; + struct in6_addr dstaddr; + struct in_addr netmask; //ipv4 + size_t prefixlen; int addrs; /* Number of allocated IP addresses */ int routes; /* One if we allocated an automatic route */ char devname[IFNAMSIZ];/* Name of the tun device */ @@ -57,10 +79,13 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); - +extern int tun_addaddr6(struct tun_t *this, struct in6_addr *addr, + struct in6_addr *dstaddr, size_t prefixlen); extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr6(struct tun_t *this, struct in6_addr *our_adr, + struct in6_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/2870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8ce8b4b8cd2ba97f7ba122de4703983111046e4 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: groos at xiplink.com From gerrit-no-reply at lists.osmocom.org Fri Jun 9 22:53:44 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 9 Jun 2017 22:53:44 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Use map container for for device parameter access Message-ID: Review at https://gerrit.osmocom.org/2871 uhd: Use map container for for device parameter access OsmoTRX is written in C++ so we might as well use built-in container types when applicable. Map access allows removal of significant amounts of special device handling code. Aggregate device rates and timing offsets into a single table with access keyed by device/tx-sps/rx-sps tuples. Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 83 insertions(+), 273 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/71/2871/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ce6d1be..0436265 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -21,6 +21,7 @@ * See the COPYING file in the main directory for details. */ +#include #include "radioDevice.h" #include "Threads.h" #include "Logger.h" @@ -37,12 +38,6 @@ #include #endif -#define B2XX_CLK_RT 26e6 -#define B2XX_MCBTS_CLK_RT 51.2e6 -#define E1XX_CLK_RT 52e6 -#define LIMESDR_CLK_RT (GSMRATE*32) -#define B100_BASE_RT 400000 -#define USRP2_BASE_RT 390625 #define USRP_TX_AMPL 0.3 #define UMTRX_TX_AMPL 0.7 #define LIMESDR_TX_AMPL 0.3 @@ -73,15 +68,6 @@ X3XX, UMTRX, LIMESDR, - NUM_USRP_TYPES, -}; - -struct uhd_dev_offset { - enum uhd_dev_type type; - size_t tx_sps; - size_t rx_sps; - double offset; - const std::string desc; }; /* @@ -109,76 +95,44 @@ * Notes: * USRP1 with timestamps is not supported by UHD. */ -static struct uhd_dev_offset uhd_offsets[] = { - { USRP1, 1, 1, 0.0, "USRP1 not supported" }, - { USRP1, 4, 1, 0.0, "USRP1 not supported"}, - { USRP2, 1, 1, 1.2184e-4, "N2XX 1 SPS" }, - { USRP2, 4, 1, 7.6547e-5, "N2XX 4/1 SPS" }, - { B100, 1, 1, 1.2104e-4, "B100 1 SPS" }, - { B100, 4, 1, 7.9307e-5, "B100 4 SPS" }, - { B200, 1, 1, B2XX_TIMING_1SPS, "B200 1 SPS" }, - { B200, 4, 1, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" }, - { B210, 1, 1, B2XX_TIMING_1SPS, "B210 1 SPS" }, - { B210, 4, 1, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" }, - { B2XX_MCBTS, 4, 4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" }, - { E1XX, 1, 1, 9.5192e-5, "E1XX 1 SPS" }, - { E1XX, 4, 1, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" }, - { E3XX, 1, 1, 1.84616e-4, "E3XX 1 SPS" }, - { E3XX, 4, 1, 1.29231e-4, "E3XX 4/1 Tx/Rx SPS" }, - { X3XX, 1, 1, 1.5360e-4, "X3XX 1 SPS"}, - { X3XX, 4, 1, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS"}, - { UMTRX, 1, 1, 9.9692e-5, "UmTRX 1 SPS" }, - { UMTRX, 4, 1, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS" }, - { USRP2, 4, 4, 4.6080e-5, "N2XX 4 SPS" }, - { B200, 4, 4, B2XX_TIMING_4_4SPS, "B200 4 SPS" }, - { B210, 4, 4, B2XX_TIMING_4_4SPS, "B210 4 SPS" }, - { X3XX, 4, 4, 5.6567e-5, "X3XX 4 SPS"}, - { UMTRX, 4, 4, 5.1503e-5, "UmTRX 4 SPS" }, - { LIMESDR, 4, 4, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" }, + +/* Device Type, Tx-SPS, Rx-SPS */ +typedef std::tuple dev_key; + +/* Device parameter descriptor */ +struct dev_desc { + unsigned channels; + double mcr; + double rate; + double offset; + std::string str; }; -#define NUM_UHD_OFFSETS (sizeof(uhd_offsets)/sizeof(uhd_offsets[0])) -/* - * Select sample rate based on device type and requested samples-per-symbol. - * The base rate is either GSM symbol rate, 270.833 kHz, or the minimum - * usable channel spacing of 400 kHz. - */ -static double select_rate(uhd_dev_type type, int sps, - RadioDevice::InterfaceType iface) -{ - if ((sps != 4) && (sps != 1)) - return -9999.99; - - if (iface == RadioDevice::MULTI_ARFCN) { - switch (type) { - case B2XX_MCBTS: - return 4 * MCBTS_SPACING; - default: - LOG(ALERT) << "Invalid device combination"; - return -9999.99; - } - } - - switch (type) { - case USRP2: - case X3XX: - return USRP2_BASE_RT * sps; - case B100: - return B100_BASE_RT * sps; - case B200: - case B210: - case E1XX: - case E3XX: - case UMTRX: - case LIMESDR: - return GSMRATE * sps; - default: - break; - } - - LOG(ALERT) << "Unknown device type " << type; - return -9999.99; -} +static const std::map dev_param_map { + { std::make_tuple(USRP2, 1, 1), { 1, 0.0, 390625, 1.2184e-4, "N2XX 1 SPS" } }, + { std::make_tuple(USRP2, 4, 1), { 1, 0.0, 390625, 7.6547e-5, "N2XX 4/1 SPS" } }, + { std::make_tuple(USRP2, 4, 4), { 1, 0.0, 390625, 4.6080e-5, "N2XX 4 SPS" } }, + { std::make_tuple(B100, 1, 1), { 1, 0.0, 400000, 1.2104e-4, "B100 1 SPS" } }, + { std::make_tuple(B100, 4, 1), { 1, 0.0, 400000, 7.9307e-5, "B100 4 SPS" } }, + { std::make_tuple(B200, 1, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B200 1 SPS" } }, + { std::make_tuple(B200, 4, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B200, 4, 4), { 1, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B200 4 SPS" } }, + { std::make_tuple(B210, 1, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B210 1 SPS" } }, + { std::make_tuple(B210, 4, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B210, 4, 4), { 2, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B210 4 SPS" } }, + { std::make_tuple(E1XX, 1, 1), { 1, 52e6, GSMRATE, 9.5192e-5, "E1XX 1 SPS" } }, + { std::make_tuple(E1XX, 4, 1), { 1, 52e6, GSMRATE, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(E3XX, 1, 1), { 2, 26e6, GSMRATE, 1.8462e-4, "E3XX 1 SPS" } }, + { std::make_tuple(E3XX, 4, 1), { 2, 26e6, GSMRATE, 1.2923e-4, "E3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 1, 1), { 2, 0.0, 390625, 1.5360e-4, "X3XX 1 SPS" } }, + { std::make_tuple(X3XX, 4, 1), { 2, 0.0, 390625, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 4, 4), { 2, 0.0, 390625, 5.6567e-5, "X3XX 4 SPS" } }, + { std::make_tuple(UMTRX, 1, 1), { 2, 0.0, GSMRATE, 9.9692e-5, "UmTRX 1 SPS" } }, + { std::make_tuple(UMTRX, 4, 1), { 2, 0.0, GSMRATE, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS"} }, + { std::make_tuple(UMTRX, 4, 4), { 2, 0.0, GSMRATE, 5.1503e-5, "UmTRX 4 SPS" } }, + { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" } }, + { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, +}; /* Sample Buffer - Allows reading and writing of timed samples using osmo-trx @@ -339,9 +293,7 @@ std::vector rx_buffers; void init_gains(); - double get_dev_offset(); - int set_master_clk(double rate); - int set_rates(double tx_rate, double rx_rate); + void set_rates(); bool parse_dev_type(); bool flush_recv(size_t num_pkts); int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls); @@ -470,105 +422,22 @@ } -double uhd_device::get_dev_offset() +void uhd_device::set_rates() { - struct uhd_dev_offset *offset = NULL; + dev_desc desc = dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)); + if (desc.mcr != 0.0) + usrp_dev->set_master_clock_rate(desc.mcr); - /* Reject USRP1 */ - if (dev_type == USRP1) { - LOG(ERR) << "Invalid device type"; - return 0.0; - } + tx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * tx_sps : desc.rate; + rx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * rx_sps : desc.rate; - /* Search for matching offset value */ - for (size_t i = 0; i < NUM_UHD_OFFSETS; i++) { - if ((dev_type == uhd_offsets[i].type) && - (tx_sps == uhd_offsets[i].tx_sps) && - (rx_sps == uhd_offsets[i].rx_sps)) { - offset = &uhd_offsets[i]; - break; - } - } + usrp_dev->set_tx_rate(tx_rate); + usrp_dev->set_rx_rate(rx_rate); + tx_rate = usrp_dev->get_tx_rate(); + rx_rate = usrp_dev->get_rx_rate(); - if (!offset) { - LOG(ERR) << "Invalid device configuration"; - return 0.0; - } - - std::cout << "-- Setting " << offset->desc << std::endl; - - return offset->offset; -} - -int uhd_device::set_master_clk(double clk_rate) -{ - double actual, offset, limit = 1.0; - - try { - usrp_dev->set_master_clock_rate(clk_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD clock rate setting failed: " << clk_rate; - LOG(ALERT) << ex.what(); - return -1; - } - - actual = usrp_dev->get_master_clock_rate(); - offset = fabs(clk_rate - actual); - - if (offset > limit) { - LOG(ALERT) << "Failed to set master clock rate"; - LOG(ALERT) << "Requested clock rate " << clk_rate; - LOG(ALERT) << "Actual clock rate " << actual; - return -1; - } - - return 0; -} - -int uhd_device::set_rates(double tx_rate, double rx_rate) -{ - double offset_limit = 1.0; - double tx_offset, rx_offset; - - /* B2XX and E1xx are the only device where we set FPGA clocking */ - if ((dev_type == B200) || (dev_type == B210) || (dev_type == E3XX)) { - if (set_master_clk(B2XX_CLK_RT) < 0) - return -1; - } else if (dev_type == E1XX) { - if (set_master_clk(E1XX_CLK_RT) < 0) - return -1; - } else if (dev_type == B2XX_MCBTS) { - if (set_master_clk(B2XX_MCBTS_CLK_RT) < 0) - return -1; - } - else if (dev_type == LIMESDR) { - if (set_master_clk(LIMESDR_CLK_RT) < 0) - return -1; - } - - - // Set sample rates - try { - usrp_dev->set_tx_rate(tx_rate); - usrp_dev->set_rx_rate(rx_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD rate setting failed"; - LOG(ALERT) << ex.what(); - return -1; - } - this->tx_rate = usrp_dev->get_tx_rate(); - this->rx_rate = usrp_dev->get_rx_rate(); - - tx_offset = fabs(this->tx_rate - tx_rate); - rx_offset = fabs(this->rx_rate - rx_rate); - if ((tx_offset > offset_limit) || (rx_offset > offset_limit)) { - LOG(ALERT) << "Actual sample rate differs from desired rate"; - LOG(ALERT) << "Tx/Rx (" << this->tx_rate << "/" - << this->rx_rate << ")"; - return -1; - } - - return 0; + ts_offset = (TIMESTAMP) desc.offset * rx_rate; + LOG(INFO) << "Rates configured for " << desc.str; } double uhd_device::setTxGain(double db, size_t chan) @@ -641,85 +510,39 @@ */ bool uhd_device::parse_dev_type() { - std::string mboard_str, dev_str; - uhd::property_tree::sptr prop_tree; - size_t usrp1_str, usrp2_str, e100_str, e110_str, e310_str, e3xx_str, - b100_str, b200_str, b210_str, x300_str, x310_str, umtrx_str, limesdr_str; + uhd::property_tree::sptr prop_tree = usrp_dev->get_device()->get_tree(); + std::string devString = prop_tree->access("/name").get(); + std::string mboardString = usrp_dev->get_mboard_name(); - prop_tree = usrp_dev->get_device()->get_tree(); - dev_str = prop_tree->access("/name").get(); - mboard_str = usrp_dev->get_mboard_name(); + std::map> devStringMap { + { "B100", { B100, TX_WINDOW_USRP1 } }, + { "B200", { B200, TX_WINDOW_USRP1 } }, + { "B200mini", { B200, TX_WINDOW_USRP1 } }, + { "B210", { B210, TX_WINDOW_USRP1 } }, + { "E100", { E1XX, TX_WINDOW_FIXED } }, + { "E110", { E1XX, TX_WINDOW_FIXED } }, + { "E310", { E3XX, TX_WINDOW_FIXED } }, + { "E3XX", { E3XX, TX_WINDOW_FIXED } }, + { "X300", { X3XX, TX_WINDOW_FIXED } }, + { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, + { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, + }; - usrp1_str = dev_str.find("USRP1"); - usrp2_str = dev_str.find("USRP2"); - b100_str = mboard_str.find("B100"); - b200_str = mboard_str.find("B200"); - b210_str = mboard_str.find("B210"); - e100_str = mboard_str.find("E100"); - e110_str = mboard_str.find("E110"); - e310_str = mboard_str.find("E310"); - e3xx_str = mboard_str.find("E3XX"); - x300_str = mboard_str.find("X300"); - x310_str = mboard_str.find("X310"); - umtrx_str = dev_str.find("UmTRX"); - // LimeSDR is based on STREAM board, so it's advertized as such - limesdr_str = dev_str.find("STREAM"); + // Compare UHD motherboard and device strings */ + std::string found; + if (devStringMap.find(devString) != devStringMap.end()) + found = devString; + else if (devStringMap.find(mboardString) != devStringMap.end()) + found = mboardString; - if (usrp1_str != std::string::npos) { - LOG(ALERT) << "USRP1 is not supported using the UHD driver"; - LOG(ALERT) << "Please compile with GNU Radio libusrp support"; - dev_type = USRP1; + if (found.empty()) { + LOG(ALERT) << "Unsupported device " << devString; return false; } - if (b100_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B100; - } else if (b200_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B200; - } else if (b210_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B210; - } else if (e100_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (e110_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (usrp2_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = USRP2; - } else if ((e310_str != std::string::npos) || - (e3xx_str != std::string::npos)) { - tx_window = TX_WINDOW_FIXED; - dev_type = E3XX; - } else if (x300_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (x310_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (umtrx_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = UMTRX; - } else if (limesdr_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = LIMESDR; - } else { - LOG(ALERT) << "Unknown UHD device type " - << dev_str << " " << mboard_str; - return false; - } - - if (tx_window == TX_WINDOW_USRP1) { - LOG(INFO) << "Using USRP1 type transmit window for " - << dev_str << " " << mboard_str; - } else { - LOG(INFO) << "Using fixed transmit window for " - << dev_str << " " << mboard_str; - } - + dev_type = std::get<0>(devStringMap[found]); + tx_window = std::get<1>(devStringMap[found]); return true; } @@ -820,14 +643,12 @@ usrp_dev->set_clock_source(refstr); - // Set rates - double _rx_rate = select_rate(dev_type, rx_sps, iface); - double _tx_rate = select_rate(dev_type, tx_sps, iface); - - if ((_tx_rate < 0.0) || (_rx_rate < 0.0)) + try { + set_rates(); + } catch (const std::exception &e) { + LOG(ALERT) << "UHD rate setting failed - " << e.what(); return -1; - if (set_rates(_tx_rate, _rx_rate) < 0) - return -1; + } // Set RF frontend bandwidth if (dev_type == UMTRX) { @@ -859,17 +680,6 @@ size_t buf_len = SAMPLE_BUF_SZ / sizeof(uint32_t); for (size_t i = 0; i < rx_buffers.size(); i++) rx_buffers[i] = new smpl_buf(buf_len, rx_rate); - - // Set receive chain sample offset. Trigger the EDGE offset - // table by checking for 4 SPS on the receive path. No other - // configuration supports using 4 SPS. - double offset = get_dev_offset(); - if (offset == 0.0) { - LOG(ERR) << "Unsupported configuration, no correction applied"; - ts_offset = 0; - } else { - ts_offset = (TIMESTAMP) (offset * rx_rate); - } // Initialize and shadow gain values init_gains(); @@ -1236,7 +1046,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > B2XX_CLK_RT) { + if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 9 22:53:44 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 9 Jun 2017 22:53:44 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Add non-UmTRX channel swap support Message-ID: Review at https://gerrit.osmocom.org/2872 uhd: Add non-UmTRX channel swap support Previously an UmTRX-only feature. Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 44 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/72/2872/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 0436265..5b62b75 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -293,6 +293,7 @@ std::vector rx_buffers; void init_gains(); + void set_channels(bool swap); void set_rates(); bool parse_dev_type(); bool flush_recv(size_t num_pkts); @@ -566,6 +567,45 @@ return true; } +void uhd_device::set_channels(bool swap) +{ + if (iface == MULTI_ARFCN) { + if (dev_type != B200 && dev_type != B210) + throw std::invalid_argument("Device does not support MCBTS"); + dev_type = B2XX_MCBTS; + chans = 1; + } + + if (chans > dev_param_map.at(dev_key(dev_type, 1, 1)).channels) + throw std::invalid_argument("Device does not support number of requested channels"); + + std::string subdev_string; + switch (dev_type) { + case B210: + case E3XX: + if (chans == 1) + subdev_string = swap ? "A:B" : "A:A"; + else if (chans == 2) + subdev_string = swap ? "A:B A:A" : "A:A A:B"; + break; + case X3XX: + case UMTRX: + if (chans == 1) + subdev_string = swap ? "B:0" : "A:0"; + else if (chans == 2) + subdev_string = swap ? "B:0 A:0" : "A:0 B:0"; + break; + default: + break; + } + + if (!subdev_string.empty()) { + uhd::usrp::subdev_spec_t spec(subdev_string); + usrp_dev->set_tx_subdev_spec(spec); + usrp_dev->set_rx_subdev_spec(spec); + } +} + int uhd_device::open(const std::string &args, int ref, bool swap_channels) { const char *refstr; @@ -596,27 +636,10 @@ return -1; } - // Verify and set channels - if (iface == MULTI_ARFCN) { - if ((dev_type != B200) && (dev_type != B210)) { - LOG(ALERT) << "Unsupported device configuration"; - return -1; - } - - dev_type = B2XX_MCBTS; - chans = 1; - } else if (chans == 2) { - if (dev_type == B210) { - } else if (dev_type == UMTRX) { - uhd::usrp::subdev_spec_t subdev_spec(swap_channels?"B:0 A:0":"A:0 B:0"); - usrp_dev->set_tx_subdev_spec(subdev_spec); - usrp_dev->set_rx_subdev_spec(subdev_spec); - } else { - LOG(ALERT) << "Invalid device configuration"; - return -1; - } - } else if (chans != 1) { - LOG(ALERT) << "Invalid channel combination for device"; + try { + set_channels(swap_channels); + } catch (const std::exception &e) { + LOG(ALERT) << "Channel setting failed - " << e.what(); return -1; } -- To view, visit https://gerrit.osmocom.org/2872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Sat Jun 10 09:12:44 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 10 Jun 2017 09:12:44 +0000 Subject: osmo-trx[master]: uhd: Add non-UmTRX channel swap support In-Reply-To: References: Message-ID: Patch Set 1: Should we correct the help message: "Swap channels (UmTRX only)" to "Swap channels"? -- To view, visit https://gerrit.osmocom.org/2872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 11 08:36:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 08:36:20 +0000 Subject: [PATCH] osmo-pcu[master]: lc15: fix configure.ac variable substitution causing compile... Message-ID: Review at https://gerrit.osmocom.org/2873 lc15: fix configure.ac variable substitution causing compile error When "--enable-lc15bts-phy" is passed to './configure' without specifying an explicit header file path using "--with-litecell15=", we ended up generating an empty string as LITECELL15_INCDIR and rendered something like "-DENABLE_DIRECT_PHY -I -I../../git/src/osmo-bts-litecell15" as part of the compiler invocation, where the -I with no argument will hide the second -I, as the second one is supposed to be the optarg for the first include. This in turn made the "#include " fail, when using separate source and build directories. This patch fixes the configur script to use $includedir, rather than the non-existant $incdir as default for LITECELL15_INCDIR Change-Id: I483e62f8331e7867a92f8055c4d450fdd5288cb6 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/73/2873/1 diff --git a/configure.ac b/configure.ac index 54c70ca..7b7f9c4 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ [enable code for Litecell 1.5 PHY [default=no]]), [enable_lc15bts_phy="$enableval"],[enable_lc15bts_phy="no"]) AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])], - [litecell15_incdir="$withval"],[litecell15_incdir="$incdir"]) + [litecell15_incdir="$withval"],[litecell15_incdir="$includedir"]) AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) AC_MSG_RESULT([$enable_lc15bts_phy]) AM_CONDITIONAL(ENABLE_LC15BTS_PHY, test "x$enable_lc15bts_phy" = "xyes") -- To view, visit https://gerrit.osmocom.org/2873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I483e62f8331e7867a92f8055c4d450fdd5288cb6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jun 11 08:48:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 08:48:48 +0000 Subject: osmo-pcu[master]: lc15: fix configure.ac variable substitution causing compile... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I483e62f8331e7867a92f8055c4d450fdd5288cb6 Gerrit-PatchSet: 1 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 Jun 11 08:48:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 08:48:56 +0000 Subject: [MERGED] osmo-pcu[master]: lc15: fix configure.ac variable substitution causing compile... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: fix configure.ac variable substitution causing compile error ...................................................................... lc15: fix configure.ac variable substitution causing compile error When "--enable-lc15bts-phy" is passed to './configure' without specifying an explicit header file path using "--with-litecell15=", we ended up generating an empty string as LITECELL15_INCDIR and rendered something like "-DENABLE_DIRECT_PHY -I -I../../git/src/osmo-bts-litecell15" as part of the compiler invocation, where the -I with no argument will hide the second -I, as the second one is supposed to be the optarg for the first include. This in turn made the "#include " fail, when using separate source and build directories. This patch fixes the configur script to use $includedir, rather than the non-existant $incdir as default for LITECELL15_INCDIR Change-Id: I483e62f8331e7867a92f8055c4d450fdd5288cb6 --- 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 54c70ca..7b7f9c4 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ [enable code for Litecell 1.5 PHY [default=no]]), [enable_lc15bts_phy="$enableval"],[enable_lc15bts_phy="no"]) AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])], - [litecell15_incdir="$withval"],[litecell15_incdir="$incdir"]) + [litecell15_incdir="$withval"],[litecell15_incdir="$includedir"]) AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) AC_MSG_RESULT([$enable_lc15bts_phy]) AM_CONDITIONAL(ENABLE_LC15BTS_PHY, test "x$enable_lc15bts_phy" = "xyes") -- To view, visit https://gerrit.osmocom.org/2873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I483e62f8331e7867a92f8055c4d450fdd5288cb6 Gerrit-PatchSet: 1 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 Jun 11 08:49:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 08:49:48 +0000 Subject: osmo-trx[master]: uhd: Add non-UmTRX channel swap support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 11 08:52:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 08:52:03 +0000 Subject: osmo-trx[master]: uhd: Use map container for for device parameter access In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 11 08:57:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 08:57:06 +0000 Subject: osmo-trx[master]: build: Require and check for gcc C++11 support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I'm always on the conservative side here. For me, the absolute minimum requirement is to build on debian stable, which ships gcc-4.9.2. Oldstable would be a plus, which would be gcc-4.7.2. According to http://en.cppreference.com/w/cpp/compiler_support most C++11 features are in gcc since 4.8, so it seems we'd still be building on stable (must) but possibly no longer on oldstable (which is tolerable) -- To view, visit https://gerrit.osmocom.org/2869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96477e4125390b17b43a3705bb1daf98fa01c9bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 11 09:18:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 09:18:54 +0000 Subject: openggsn[master]: IPv6 support In-Reply-To: References: Message-ID: Patch Set 1: (12 comments) Hi Gerrie, first of all thanks a lot for your patch submission to OpenGGSN. IPv6 support has been on the wishlist for a long time, but we have virtually received no outside contributions to OpenGGSN for a long time. Here are some initial review comments. For more extensive discussions, we can also always use the mailing list. One general comment on commenting: Please use /* */ style commenting, rather than // style. If you think that's too much to ask, I will fix those up after we're done with the other review. https://gerrit.osmocom.org/#/c/2870/1/ggsn/tun.c File ggsn/tun.c: Line 74: // From linux/ipv6.h why not #include instead of copying? We're in a #ifdef(__linux__) section anyway. Line 241: // None of this is currently required for IPv6 if it's not required for ipv6, we can simply remove/disable the code, even in the v4 case? Line 894: // TODO: ipv6 do you still intend to address those TODO items (in several places) in future versions of this patch? https://gerrit.osmocom.org/#/c/2870/1/ggsn/tun.h File ggsn/tun.h: Line 20: /* This should not be re-declared! Why not just use netinet/ip(6).h? feel free to submit a separate patch(set) if you think there is some clean-up with re-use of system header files. https://gerrit.osmocom.org/#/c/2870/1/gtp/gtp.c File gtp/gtp.c: Line 1473: struct in6_addr* a; I think we don't declare variables in the middle of functions but still the classic way on top of the function (or block). https://gerrit.osmocom.org/#/c/2870/1/gtp/gtp.h File gtp/gtp.h: Line 401: extern int gsna2in_addr(struct in6_addr *dst, size_t* dstlen, struct ul16_t *gsna); the function now appears to convert to in6_addr, so the name might change to reflect that, too? https://gerrit.osmocom.org/#/c/2870/1/gtp/pdp.c File gtp/pdp.c: Line 332: eua->l=18; even if the existing code is not a good example in this case, it would be great if there were not more magic numbers bu t less. the '16' below could possibly be a sizeof(struct in6addr) or something similar, and the 18 coudl be 2+sizeof()? Applies to other places, too. Line 374: case 0x21: /* IPv4 */ I'd also appreciate if we could introduce some #defines for those magic numbers. a comment above the #define should point to the specific section and 3GPP spec number. https://gerrit.osmocom.org/#/c/2870/1/gtp/pdp.h File gtp/pdp.h: Line 161: size_t gsnlc_len; maybe it makes sense to introduce a new (sub)struct or typedef that encapsulates both the ul16_t for the address as well as the length? It seems a bit "copy+paste style" to add a length member for each of the GSN addresses? https://gerrit.osmocom.org/#/c/2870/1/sgsnemu/ippool.c File sgsnemu/ippool.c: Line 45: if (addrlen == 4) { might make sense to factor this addrlen2sockaddrlen into a separate function? https://gerrit.osmocom.org/#/c/2870/1/sgsnemu/tun.c File sgsnemu/tun.c: Line 74: // From linux/ipv6.h please simply #include the related header, or explain in the comment why this is not / cannot be done. https://gerrit.osmocom.org/#/c/2870/1/sgsnemu/tun.h File sgsnemu/tun.h: Line 20: /* This should not be re-declared! Why not just use netinet/ip(6).h? same comment as before: If you think we can clean-up by using system level header files, a separate patch(set) about that is much appreciated. -- To view, visit https://gerrit.osmocom.org/2870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8ce8b4b8cd2ba97f7ba122de4703983111046e4 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: groos at xiplink.com Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 11 09:41:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 09:41:16 +0000 Subject: [PATCH] osmo-pcu[master]: lc15: further fixes regarding --with-litecell15 Message-ID: Review at https://gerrit.osmocom.org/2874 lc15: further fixes regarding --with-litecell15 The fix in 0fb294a8dd45a86b8f9eb93211b69b6dbf0a6853 was only partially valid, as it unconditionally used $includedir, without any prefix. This polluted the include path with host include files in cross-compiling builds. Let's take a different approach and simply define LITECELL15_CFLAGS (similar to what pkgconfig does), which makes the "-I" go away if no --with-litecell15 has been specified. Change-Id: I63393decfe42a24dab56c7654f716c1580416ab2 --- M configure.ac M src/Makefile.am 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/74/2874/1 diff --git a/configure.ac b/configure.ac index 7b7f9c4..3b13469 100644 --- a/configure.ac +++ b/configure.ac @@ -51,15 +51,15 @@ [enable code for Litecell 1.5 PHY [default=no]]), [enable_lc15bts_phy="$enableval"],[enable_lc15bts_phy="no"]) AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])], - [litecell15_incdir="$withval"],[litecell15_incdir="$includedir"]) -AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) + [litecell15_cflags="-I$withval"],[litecell15_cflags=""]) +AC_SUBST([LITECELL15_CFLAGS], $litecell15_cflags) AC_MSG_RESULT([$enable_lc15bts_phy]) AM_CONDITIONAL(ENABLE_LC15BTS_PHY, test "x$enable_lc15bts_phy" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + CPPFLAGS="$CPPFLAGS $LITECELL15_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], - [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], + [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found using $litecell15_cflags])], [#include ]) CPPFLAGS=$oldCPPFLAGS fi diff --git a/src/Makefile.am b/src/Makefile.am index 97de06d..1543851 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -137,7 +137,7 @@ endif if ENABLE_LC15BTS_PHY -AM_CPPFLAGS += -I$(LITECELL15_INCDIR) -I$(srcdir)/osmo-bts-litecell15 +AM_CPPFLAGS += $(LITECELL15_CFLAGS) -I$(srcdir)/osmo-bts-litecell15 EXTRA_DIST = \ osmo-bts-litecell15/lc15_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/2874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63393decfe42a24dab56c7654f716c1580416ab2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jun 11 09:41:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 09:41:17 +0000 Subject: [PATCH] osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs() Message-ID: Review at https://gerrit.osmocom.org/2875 use tlvp_val16be() rather than manual pointer-cast + ntohs() Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/75/2875/1 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index aeb0942..d3c8491 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -155,9 +155,8 @@ if (TLVP_PRESENT(tp, BSSGP_IE_PDU_LIFETIME)) { uint8_t lt_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME); - uint16_t *lt = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_PDU_LIFETIME); if (lt_len == 2) - delay_csec = ntohs(*lt); + delay_csec = tlvp_val16be(tp, BSSGP_IE_PDU_LIFETIME); else LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of " "PDU_LIFETIME IE\n"); @@ -169,9 +168,8 @@ if (TLVP_PRESENT(tp, BSSGP_IE_TLLI)) { uint8_t tlli_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME); - uint16_t *e_tlli_old = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_TLLI); if (tlli_len == 2) - tlli_old = ntohs(*e_tlli_old); + tlli_old = tlvp_val16be(tp, BSSGP_IE_TLLI); else LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of " "TLLI (old) IE\n"); -- To view, visit https://gerrit.osmocom.org/2875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jun 11 09:44:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 09:44:34 +0000 Subject: osmo-pcu[master]: lc15: further fixes regarding --with-litecell15 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63393decfe42a24dab56c7654f716c1580416ab2 Gerrit-PatchSet: 1 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 Jun 11 09:44:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 11 Jun 2017 09:44:36 +0000 Subject: [MERGED] osmo-pcu[master]: lc15: further fixes regarding --with-litecell15 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: further fixes regarding --with-litecell15 ...................................................................... lc15: further fixes regarding --with-litecell15 The fix in 0fb294a8dd45a86b8f9eb93211b69b6dbf0a6853 was only partially valid, as it unconditionally used $includedir, without any prefix. This polluted the include path with host include files in cross-compiling builds. Let's take a different approach and simply define LITECELL15_CFLAGS (similar to what pkgconfig does), which makes the "-I" go away if no --with-litecell15 has been specified. Change-Id: I63393decfe42a24dab56c7654f716c1580416ab2 --- M configure.ac M src/Makefile.am 2 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 7b7f9c4..3b13469 100644 --- a/configure.ac +++ b/configure.ac @@ -51,15 +51,15 @@ [enable code for Litecell 1.5 PHY [default=no]]), [enable_lc15bts_phy="$enableval"],[enable_lc15bts_phy="no"]) AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])], - [litecell15_incdir="$withval"],[litecell15_incdir="$includedir"]) -AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) + [litecell15_cflags="-I$withval"],[litecell15_cflags=""]) +AC_SUBST([LITECELL15_CFLAGS], $litecell15_cflags) AC_MSG_RESULT([$enable_lc15bts_phy]) AM_CONDITIONAL(ENABLE_LC15BTS_PHY, test "x$enable_lc15bts_phy" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + CPPFLAGS="$CPPFLAGS $LITECELL15_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], - [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], + [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found using $litecell15_cflags])], [#include ]) CPPFLAGS=$oldCPPFLAGS fi diff --git a/src/Makefile.am b/src/Makefile.am index 97de06d..1543851 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -137,7 +137,7 @@ endif if ENABLE_LC15BTS_PHY -AM_CPPFLAGS += -I$(LITECELL15_INCDIR) -I$(srcdir)/osmo-bts-litecell15 +AM_CPPFLAGS += $(LITECELL15_CFLAGS) -I$(srcdir)/osmo-bts-litecell15 EXTRA_DIST = \ osmo-bts-litecell15/lc15_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/2874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63393decfe42a24dab56c7654f716c1580416ab2 Gerrit-PatchSet: 1 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 Jun 11 21:39:42 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 11 Jun 2017 21:39:42 +0000 Subject: [PATCH] libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference Message-ID: Review at https://gerrit.osmocom.org/2876 core/conv/viterbi.c: fix possible NULL-pointer reference Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 --- M src/viterbi.c 1 file changed, 29 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/2876/1 diff --git a/src/viterbi.c b/src/viterbi.c index 854754c..f66986e 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -371,9 +371,15 @@ if (!trellis) return; - vdec_free(trellis->outputs); - vdec_free(trellis->sums); - free(trellis->vals); + if (trellis->outputs != NULL) + vdec_free(trellis->outputs); + + if (trellis->sums != NULL) + vdec_free(trellis->sums); + + if (trellis->vals != NULL) + free(trellis->vals); + free(trellis); } @@ -394,12 +400,15 @@ int olen = (code->N == 2) ? 2 : 4; trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + if (!trellis) + goto fail; + trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs) + if (!trellis->sums || !trellis->outputs || !trellis->vals) goto fail; /* Populate the trellis state objects */ @@ -507,9 +516,16 @@ if (!dec) return; - vdec_free(dec->paths[0]); - free(dec->paths); - free_trellis(dec->trellis); + if (dec->trellis != NULL) + free_trellis(dec->trellis); + + if (dec->paths != NULL) { + if (dec->paths[0] != NULL) + vdec_free(dec->paths[0]); + + free(dec->paths); + } + free(dec); } @@ -572,7 +588,13 @@ goto fail; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + if (!dec->paths) + goto fail; + dec->paths[0] = vdec_malloc(ns * dec->len); + if (!dec->paths[0]) + goto fail; + for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 11 21:39:43 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 11 Jun 2017 21:39:43 +0000 Subject: [PATCH] libosmocore[master]: sim/core.c: drop useless double assignment Message-ID: Review at https://gerrit.osmocom.org/2877 sim/core.c: drop useless double assignment Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a --- M src/sim/core.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/2877/1 diff --git a/src/sim/core.c b/src/sim/core.c index 2f129c9..1ce2fed 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -306,7 +306,7 @@ const struct osim_card_sw **sw_lists = cp->sws; const struct osim_card_sw *sw_list, *sw; - for (sw_list = *sw_lists++; sw_list != NULL; sw = sw_list = *sw_lists++) { + for (sw_list = *sw_lists++; sw_list != NULL; sw_list = *sw_lists++) { for (sw = sw_list; sw->code != 0 && sw->mask != 0; sw++) { if ((sw_in & sw->mask) == sw->code) return sw; -- To view, visit https://gerrit.osmocom.org/2877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 11 21:39:43 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 11 Jun 2017 21:39:43 +0000 Subject: [PATCH] libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage Message-ID: Review at https://gerrit.osmocom.org/2878 gb/gprs_bssgp.c: avoid valueless goto usage Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d --- M src/gb/gprs_bssgp.c 1 file changed, 3 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/2878/1 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index aa6e37b..142f589 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -698,24 +698,17 @@ /* ... and subtract the number of leaked bytes */ bucket_predicted -= leaked; - if (bucket_predicted < pdu_len) { - /* this is just to make sure the bucket doesn't underflow */ - bucket_predicted = pdu_len; - goto pass; - } + if (bucket_predicted < pdu_len) + return 0; if (bucket_predicted <= fc->bucket_size_max) { /* the bucket is not full yet, we can pass the packet */ fc->bucket_counter = bucket_predicted; - goto pass; + return 0; } /* bucket is full, PDU needs to be delayed */ return 1; - -pass: - /* if we reach here, the PDU can pass */ - return 0; } /* output callback for BVC flow control */ -- To view, visit https://gerrit.osmocom.org/2878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 11 21:39:43 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 11 Jun 2017 21:39:43 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv.c: drop useless assignment Message-ID: Review at https://gerrit.osmocom.org/2879 core/conv/conv.c: drop useless assignment Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206 --- M src/conv.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/2879/1 diff --git a/src/conv.c b/src/conv.c index 79b3a7c..aebb9b4 100644 --- a/src/conv.c +++ b/src/conv.c @@ -625,7 +625,7 @@ l = osmo_conv_decode_scan(&decoder, input, code->len); if (code->term == CONV_TERM_FLUSH) - l = osmo_conv_decode_flush(&decoder, &input[l]); + osmo_conv_decode_flush(&decoder, &input[l]); rv = osmo_conv_decode_get_output(&decoder, output, code->term == CONV_TERM_FLUSH, /* has_flush */ -- To view, visit https://gerrit.osmocom.org/2879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 11 21:39:44 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 11 Jun 2017 21:39:44 +0000 Subject: [PATCH] libosmocore[master]: vty/command.c: drop useless assignment Message-ID: Review at https://gerrit.osmocom.org/2880 vty/command.c: drop useless assignment Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7 --- M src/vty/command.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/2880/1 diff --git a/src/vty/command.c b/src/vty/command.c index 587bd62..0f1b9a0 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1654,7 +1654,7 @@ /* Make sure that cmd_vector is filtered based on current word */ command = vector_slot(vline, index); if (command) - match = cmd_filter(command, cmd_vector, index, any_match); + cmd_filter(command, cmd_vector, index, any_match); /* Make description vector. */ for (i = 0; i < vector_active(cmd_vector); i++) { -- To view, visit https://gerrit.osmocom.org/2880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 11 21:39:44 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 11 Jun 2017 21:39:44 +0000 Subject: [PATCH] libosmocore[master]: gsm/gsm48.c: drop useless assignment Message-ID: Review at https://gerrit.osmocom.org/2881 gsm/gsm48.c: drop useless assignment Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4 --- M src/gsm/gsm48.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/2881/1 diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 543c9c0..f7ad67c 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -410,7 +410,6 @@ bcd[1] = val % 10; val = val / 10; bcd[0] = val % 10; - val = val / 10; } /*! \brief Checks is particular message is cipherable in A/Gb mode according to -- To view, visit https://gerrit.osmocom.org/2881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 12 00:08:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 00:08:29 +0000 Subject: [MERGED] libosmocore[master]: Add header file with definitions for GSM TS 04.14 / 3GPP TS ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add header file with definitions for GSM TS 04.14 / 3GPP TS 44.014 ...................................................................... Add header file with definitions for GSM TS 04.14 / 3GPP TS 44.014 Change-Id: I1f4fc2761b55a4f83544c1c3793ab67fec9fc120 --- M include/Makefile.am A include/osmocom/gsm/protocol/gsm_04_14.h M src/gsm/Makefile.am A src/gsm/gsm0414.c M src/gsm/libosmogsm.map 5 files changed, 125 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/include/Makefile.am b/include/Makefile.am index 161bbca..e0c1a2b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -99,6 +99,7 @@ osmocom/gsm/protocol/gsm_04_08_gprs.h \ osmocom/gsm/protocol/gsm_04_11.h \ osmocom/gsm/protocol/gsm_04_12.h \ + osmocom/gsm/protocol/gsm_04_14.h \ osmocom/gsm/protocol/gsm_04_80.h \ osmocom/gsm/protocol/gsm_08_08.h \ osmocom/gsm/protocol/gsm_08_58.h \ diff --git a/include/osmocom/gsm/protocol/gsm_04_14.h b/include/osmocom/gsm/protocol/gsm_04_14.h new file mode 100644 index 0000000..421b56f --- /dev/null +++ b/include/osmocom/gsm/protocol/gsm_04_14.h @@ -0,0 +1,101 @@ +#pragma once + +#include +#include +#include + +/* According to 3GPP TS 44.014 / GSM TS 04.14 */ + +#define GSM414_MT_CLOSE_TCH_LOOP_CMD 0x00 /* 8.1 */ +enum gsm414_tch_loop_mode { + GSM414_LOOP_A = 0x00, + GSM414_LOOP_B = 0x01, + GSM414_LOOP_C = 0x02, + GSM414_LOOP_D = 0x04, + GSM414_LOOP_E = 0x08, + GSM414_LOOP_F = 0x0c, + GSM414_LOOP_I = 0x1c, +}; + +#define GSM414_MT_CLOSE_TCH_LOOP_ACK 0x01 /* 8.2 */ +#define GSM414_MT_OPEN_LOOP_CMD 0x02 /* 8.3 */ +#define GSM414_OPEN_LOOP_ACK_IE 0x81 + +#define GSM414_MT_CLOSE_MSLOT_LOOP_CMD 0x20 /* 8.4 */ +struct gsm414_close_mslot_loop_cmd { +#if OSMO_IS_LITTLE_ENDIAN == 1 + uint8_t chc:2, + loop_mech:3, + tn:3; +#else + uint8_t tn:3, + loop_mech:3, + chc:2; +#endif +} __attribute__((packed)); + +#define GSM414_MT_CLOSE_MSLOT_LOOP_ACK 0x21 /* 8.5 */ +struct gsm414_close_mslot_loop_ack { +#if OSMO_IS_LITTLE_ENDIAN == 1 + uint8_t err_ind:1, + loop_mech:3, + chc:2, + spare:2; +#else + uint8_t spare:2, + chc:2, + loop_mech:3, + err_ind:1; +#endif +} __attribute__((packed)); + +#define GSM414_MT_OPEN_MSLOT_LOOP_CMD 0x22 /* 8.6 */ +#define GSM414_MT_OPEN_MSLOT_LOOP_ACK 0x23 /* 8.7 */ +#define GSM414_MT_ACT_EMMI_CMD 0x0c /* 8.8 */ +#define GSM414_MT_ACT_EMMI_ACK 0x0d /* 8.9 */ +#define GSM414_MT_DEACT_EMMI_CMD 0x80 /* 8.10 */ +#define GSM414_MT_TEST_INTERFACE 0x84 /* 8.11 */ + +/* 8.12 Timers (milli-seconds) */ +#define GSM414_TT01_MS 2500 +#define GSM414_TT02_MS 2500 +#define GSM414_TT03_MS 50 + +#define GSM414_MT_GPRS_TEST_MODE_CMD 0x24 /* 8.13 */ +struct gsm414_gprs_test_mode_cmd { +#if OSMO_IS_LITTLE_ENDIAN == 1 + uint16_t d:12, + spare:3, + l:1; + uint8_t m:1, + dl_tx_offset:3, + _spare:4; +#else + uint16_t l:1, + spare:3, + d:12; + uint8_t _spare:4, + dl_tx_offset:3, + m:1; +#endif +} __attribute__((packed)); + + +#define GSM414_MT_EGPRS_ST_RB_LOOP_CMD 0x25 /* 8.14 */ +struct gsm414_egprs_st_sb_loop_cmd { +#if OSMO_IS_LITTLE_ENDIAN == 1 + uint8_t _spare:4, + dl_tx_offset:3, + m:1; +#else + uint8_t m:1, + dl_tx_offset:3, + _spare:4; +#endif +} __attribute__((packed)); + +#define GSM414_MT_RESET_MS_POS_STORED 0x26 /* 8.15 */ +#define GSM414_MS_POS_TECH_AGPS 0x00 +#define GSM414_MS_POS_TECH_AGNSS 0x01 + +extern const struct value_string gsm414_msgt_names[]; diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index d15174a..08cd5e6 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -23,7 +23,7 @@ libgsmint_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \ gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm0808.c sysinfo.c \ gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c gsm0502.c \ - gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c \ + gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \ lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \ auth_core.c auth_comp128v1.c auth_comp128v23.c \ auth_milenage.c milenage/aes-encblock.c gea.c \ diff --git a/src/gsm/gsm0414.c b/src/gsm/gsm0414.c new file mode 100644 index 0000000..84d393d --- /dev/null +++ b/src/gsm/gsm0414.c @@ -0,0 +1,20 @@ +#include +#include + +const struct value_string gsm414_msgt_names[] = { + { GSM414_MT_CLOSE_TCH_LOOP_CMD, "CLOSE_TCH_LOOP_CMD" }, + { GSM414_MT_CLOSE_TCH_LOOP_ACK, "CLOSE_TCH_LOOP_ACK" }, + { GSM414_MT_OPEN_LOOP_CMD, "OPEN_LOOP_CMD" }, + { GSM414_MT_CLOSE_MSLOT_LOOP_CMD, "CLOSE_MSLOT_LOOP_CMD" }, + { GSM414_MT_CLOSE_MSLOT_LOOP_ACK, "CLOSE_MSLOT_LOOP_ACK" }, + { GSM414_MT_OPEN_MSLOT_LOOP_CMD, "OPEN_MSLOT_LOOP_CMD" }, + { GSM414_MT_OPEN_MSLOT_LOOP_ACK, "OPEN_MSLOT_LOOP_ACK" }, + { GSM414_MT_ACT_EMMI_CMD, "ACT_EMMI_CMD" }, + { GSM414_MT_ACT_EMMI_ACK, "ACT_EMMI_ACK" }, + { GSM414_MT_DEACT_EMMI_CMD, "DEACT_EMMI_CMD" }, + { GSM414_MT_TEST_INTERFACE, "TEST_INTERFACE" }, + { GSM414_MT_GPRS_TEST_MODE_CMD, "GPRS_TEST_MODE_CMD" }, + { GSM414_MT_EGPRS_ST_RB_LOOP_CMD, "EGPRS_START_RB_LOOP_CMD" }, + { GSM414_MT_RESET_MS_POS_STORED, "RESET_MS_POS_STORED" }, + { 0, NULL } +}; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 8fb9878..9613c4e 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -188,6 +188,8 @@ gsm411_cp_cause_strs; gsm411_rp_cause_strs; +gsm414_msgt_names; + gsm48_att_tlvdef; gsm48_cc_msg_name; gsm48_rr_msg_name; -- To view, visit https://gerrit.osmocom.org/2788 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f4fc2761b55a4f83544c1c3793ab67fec9fc120 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 01:51:44 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 12 Jun 2017 01:51:44 +0000 Subject: libosmocore[master]: core/conv/conv.c: drop useless assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 02:06:20 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 12 Jun 2017 02:06:20 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Use map container for for device parameter access 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/2871 to look at the new patch set (#2). uhd: Use map container for for device parameter access OsmoTRX is written in C++ so we might as well use built-in container types when applicable. Map access allows removal of significant amounts of special device handling code. Aggregate device rates and timing offsets into a single table with access keyed by device/tx-sps/rx-sps tuples. Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 83 insertions(+), 273 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/71/2871/2 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ce6d1be..c58f244 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -21,6 +21,7 @@ * See the COPYING file in the main directory for details. */ +#include #include "radioDevice.h" #include "Threads.h" #include "Logger.h" @@ -37,12 +38,6 @@ #include #endif -#define B2XX_CLK_RT 26e6 -#define B2XX_MCBTS_CLK_RT 51.2e6 -#define E1XX_CLK_RT 52e6 -#define LIMESDR_CLK_RT (GSMRATE*32) -#define B100_BASE_RT 400000 -#define USRP2_BASE_RT 390625 #define USRP_TX_AMPL 0.3 #define UMTRX_TX_AMPL 0.7 #define LIMESDR_TX_AMPL 0.3 @@ -73,15 +68,6 @@ X3XX, UMTRX, LIMESDR, - NUM_USRP_TYPES, -}; - -struct uhd_dev_offset { - enum uhd_dev_type type; - size_t tx_sps; - size_t rx_sps; - double offset; - const std::string desc; }; /* @@ -109,76 +95,44 @@ * Notes: * USRP1 with timestamps is not supported by UHD. */ -static struct uhd_dev_offset uhd_offsets[] = { - { USRP1, 1, 1, 0.0, "USRP1 not supported" }, - { USRP1, 4, 1, 0.0, "USRP1 not supported"}, - { USRP2, 1, 1, 1.2184e-4, "N2XX 1 SPS" }, - { USRP2, 4, 1, 7.6547e-5, "N2XX 4/1 SPS" }, - { B100, 1, 1, 1.2104e-4, "B100 1 SPS" }, - { B100, 4, 1, 7.9307e-5, "B100 4 SPS" }, - { B200, 1, 1, B2XX_TIMING_1SPS, "B200 1 SPS" }, - { B200, 4, 1, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" }, - { B210, 1, 1, B2XX_TIMING_1SPS, "B210 1 SPS" }, - { B210, 4, 1, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" }, - { B2XX_MCBTS, 4, 4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" }, - { E1XX, 1, 1, 9.5192e-5, "E1XX 1 SPS" }, - { E1XX, 4, 1, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" }, - { E3XX, 1, 1, 1.84616e-4, "E3XX 1 SPS" }, - { E3XX, 4, 1, 1.29231e-4, "E3XX 4/1 Tx/Rx SPS" }, - { X3XX, 1, 1, 1.5360e-4, "X3XX 1 SPS"}, - { X3XX, 4, 1, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS"}, - { UMTRX, 1, 1, 9.9692e-5, "UmTRX 1 SPS" }, - { UMTRX, 4, 1, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS" }, - { USRP2, 4, 4, 4.6080e-5, "N2XX 4 SPS" }, - { B200, 4, 4, B2XX_TIMING_4_4SPS, "B200 4 SPS" }, - { B210, 4, 4, B2XX_TIMING_4_4SPS, "B210 4 SPS" }, - { X3XX, 4, 4, 5.6567e-5, "X3XX 4 SPS"}, - { UMTRX, 4, 4, 5.1503e-5, "UmTRX 4 SPS" }, - { LIMESDR, 4, 4, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" }, + +/* Device Type, Tx-SPS, Rx-SPS */ +typedef std::tuple dev_key; + +/* Device parameter descriptor */ +struct dev_desc { + unsigned channels; + double mcr; + double rate; + double offset; + std::string str; }; -#define NUM_UHD_OFFSETS (sizeof(uhd_offsets)/sizeof(uhd_offsets[0])) -/* - * Select sample rate based on device type and requested samples-per-symbol. - * The base rate is either GSM symbol rate, 270.833 kHz, or the minimum - * usable channel spacing of 400 kHz. - */ -static double select_rate(uhd_dev_type type, int sps, - RadioDevice::InterfaceType iface) -{ - if ((sps != 4) && (sps != 1)) - return -9999.99; - - if (iface == RadioDevice::MULTI_ARFCN) { - switch (type) { - case B2XX_MCBTS: - return 4 * MCBTS_SPACING; - default: - LOG(ALERT) << "Invalid device combination"; - return -9999.99; - } - } - - switch (type) { - case USRP2: - case X3XX: - return USRP2_BASE_RT * sps; - case B100: - return B100_BASE_RT * sps; - case B200: - case B210: - case E1XX: - case E3XX: - case UMTRX: - case LIMESDR: - return GSMRATE * sps; - default: - break; - } - - LOG(ALERT) << "Unknown device type " << type; - return -9999.99; -} +static const std::map dev_param_map { + { std::make_tuple(USRP2, 1, 1), { 1, 0.0, 390625, 1.2184e-4, "N2XX 1 SPS" } }, + { std::make_tuple(USRP2, 4, 1), { 1, 0.0, 390625, 7.6547e-5, "N2XX 4/1 SPS" } }, + { std::make_tuple(USRP2, 4, 4), { 1, 0.0, 390625, 4.6080e-5, "N2XX 4 SPS" } }, + { std::make_tuple(B100, 1, 1), { 1, 0.0, 400000, 1.2104e-4, "B100 1 SPS" } }, + { std::make_tuple(B100, 4, 1), { 1, 0.0, 400000, 7.9307e-5, "B100 4 SPS" } }, + { std::make_tuple(B200, 1, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B200 1 SPS" } }, + { std::make_tuple(B200, 4, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B200, 4, 4), { 1, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B200 4 SPS" } }, + { std::make_tuple(B210, 1, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B210 1 SPS" } }, + { std::make_tuple(B210, 4, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B210, 4, 4), { 2, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B210 4 SPS" } }, + { std::make_tuple(E1XX, 1, 1), { 1, 52e6, GSMRATE, 9.5192e-5, "E1XX 1 SPS" } }, + { std::make_tuple(E1XX, 4, 1), { 1, 52e6, GSMRATE, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(E3XX, 1, 1), { 2, 26e6, GSMRATE, 1.8462e-4, "E3XX 1 SPS" } }, + { std::make_tuple(E3XX, 4, 1), { 2, 26e6, GSMRATE, 1.2923e-4, "E3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 1, 1), { 2, 0.0, 390625, 1.5360e-4, "X3XX 1 SPS" } }, + { std::make_tuple(X3XX, 4, 1), { 2, 0.0, 390625, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 4, 4), { 2, 0.0, 390625, 5.6567e-5, "X3XX 4 SPS" } }, + { std::make_tuple(UMTRX, 1, 1), { 2, 0.0, GSMRATE, 9.9692e-5, "UmTRX 1 SPS" } }, + { std::make_tuple(UMTRX, 4, 1), { 2, 0.0, GSMRATE, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS"} }, + { std::make_tuple(UMTRX, 4, 4), { 2, 0.0, GSMRATE, 5.1503e-5, "UmTRX 4 SPS" } }, + { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" } }, + { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, +}; /* Sample Buffer - Allows reading and writing of timed samples using osmo-trx @@ -339,9 +293,7 @@ std::vector rx_buffers; void init_gains(); - double get_dev_offset(); - int set_master_clk(double rate); - int set_rates(double tx_rate, double rx_rate); + void set_rates(); bool parse_dev_type(); bool flush_recv(size_t num_pkts); int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls); @@ -470,105 +422,22 @@ } -double uhd_device::get_dev_offset() +void uhd_device::set_rates() { - struct uhd_dev_offset *offset = NULL; + dev_desc desc = dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)); + if (desc.mcr != 0.0) + usrp_dev->set_master_clock_rate(desc.mcr); - /* Reject USRP1 */ - if (dev_type == USRP1) { - LOG(ERR) << "Invalid device type"; - return 0.0; - } + tx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * tx_sps : desc.rate; + rx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * rx_sps : desc.rate; - /* Search for matching offset value */ - for (size_t i = 0; i < NUM_UHD_OFFSETS; i++) { - if ((dev_type == uhd_offsets[i].type) && - (tx_sps == uhd_offsets[i].tx_sps) && - (rx_sps == uhd_offsets[i].rx_sps)) { - offset = &uhd_offsets[i]; - break; - } - } + usrp_dev->set_tx_rate(tx_rate); + usrp_dev->set_rx_rate(rx_rate); + tx_rate = usrp_dev->get_tx_rate(); + rx_rate = usrp_dev->get_rx_rate(); - if (!offset) { - LOG(ERR) << "Invalid device configuration"; - return 0.0; - } - - std::cout << "-- Setting " << offset->desc << std::endl; - - return offset->offset; -} - -int uhd_device::set_master_clk(double clk_rate) -{ - double actual, offset, limit = 1.0; - - try { - usrp_dev->set_master_clock_rate(clk_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD clock rate setting failed: " << clk_rate; - LOG(ALERT) << ex.what(); - return -1; - } - - actual = usrp_dev->get_master_clock_rate(); - offset = fabs(clk_rate - actual); - - if (offset > limit) { - LOG(ALERT) << "Failed to set master clock rate"; - LOG(ALERT) << "Requested clock rate " << clk_rate; - LOG(ALERT) << "Actual clock rate " << actual; - return -1; - } - - return 0; -} - -int uhd_device::set_rates(double tx_rate, double rx_rate) -{ - double offset_limit = 1.0; - double tx_offset, rx_offset; - - /* B2XX and E1xx are the only device where we set FPGA clocking */ - if ((dev_type == B200) || (dev_type == B210) || (dev_type == E3XX)) { - if (set_master_clk(B2XX_CLK_RT) < 0) - return -1; - } else if (dev_type == E1XX) { - if (set_master_clk(E1XX_CLK_RT) < 0) - return -1; - } else if (dev_type == B2XX_MCBTS) { - if (set_master_clk(B2XX_MCBTS_CLK_RT) < 0) - return -1; - } - else if (dev_type == LIMESDR) { - if (set_master_clk(LIMESDR_CLK_RT) < 0) - return -1; - } - - - // Set sample rates - try { - usrp_dev->set_tx_rate(tx_rate); - usrp_dev->set_rx_rate(rx_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD rate setting failed"; - LOG(ALERT) << ex.what(); - return -1; - } - this->tx_rate = usrp_dev->get_tx_rate(); - this->rx_rate = usrp_dev->get_rx_rate(); - - tx_offset = fabs(this->tx_rate - tx_rate); - rx_offset = fabs(this->rx_rate - rx_rate); - if ((tx_offset > offset_limit) || (rx_offset > offset_limit)) { - LOG(ALERT) << "Actual sample rate differs from desired rate"; - LOG(ALERT) << "Tx/Rx (" << this->tx_rate << "/" - << this->rx_rate << ")"; - return -1; - } - - return 0; + ts_offset = (TIMESTAMP) desc.offset * rx_rate; + LOG(INFO) << "Rates configured for " << desc.str; } double uhd_device::setTxGain(double db, size_t chan) @@ -641,85 +510,39 @@ */ bool uhd_device::parse_dev_type() { - std::string mboard_str, dev_str; - uhd::property_tree::sptr prop_tree; - size_t usrp1_str, usrp2_str, e100_str, e110_str, e310_str, e3xx_str, - b100_str, b200_str, b210_str, x300_str, x310_str, umtrx_str, limesdr_str; + uhd::property_tree::sptr prop_tree = usrp_dev->get_device()->get_tree(); + std::string devString = prop_tree->access("/name").get(); + std::string mboardString = usrp_dev->get_mboard_name(); - prop_tree = usrp_dev->get_device()->get_tree(); - dev_str = prop_tree->access("/name").get(); - mboard_str = usrp_dev->get_mboard_name(); + const std::map> devStringMap { + { "B100", { B100, TX_WINDOW_USRP1 } }, + { "B200", { B200, TX_WINDOW_USRP1 } }, + { "B200mini", { B200, TX_WINDOW_USRP1 } }, + { "B210", { B210, TX_WINDOW_USRP1 } }, + { "E100", { E1XX, TX_WINDOW_FIXED } }, + { "E110", { E1XX, TX_WINDOW_FIXED } }, + { "E310", { E3XX, TX_WINDOW_FIXED } }, + { "E3XX", { E3XX, TX_WINDOW_FIXED } }, + { "X300", { X3XX, TX_WINDOW_FIXED } }, + { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, + { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, + }; - usrp1_str = dev_str.find("USRP1"); - usrp2_str = dev_str.find("USRP2"); - b100_str = mboard_str.find("B100"); - b200_str = mboard_str.find("B200"); - b210_str = mboard_str.find("B210"); - e100_str = mboard_str.find("E100"); - e110_str = mboard_str.find("E110"); - e310_str = mboard_str.find("E310"); - e3xx_str = mboard_str.find("E3XX"); - x300_str = mboard_str.find("X300"); - x310_str = mboard_str.find("X310"); - umtrx_str = dev_str.find("UmTRX"); - // LimeSDR is based on STREAM board, so it's advertized as such - limesdr_str = dev_str.find("STREAM"); + // Compare UHD motherboard and device strings */ + std::string found; + if (devStringMap.find(devString) != devStringMap.end()) + found = devString; + else if (devStringMap.find(mboardString) != devStringMap.end()) + found = mboardString; - if (usrp1_str != std::string::npos) { - LOG(ALERT) << "USRP1 is not supported using the UHD driver"; - LOG(ALERT) << "Please compile with GNU Radio libusrp support"; - dev_type = USRP1; + if (found.empty()) { + LOG(ALERT) << "Unsupported device " << devString; return false; } - if (b100_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B100; - } else if (b200_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B200; - } else if (b210_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B210; - } else if (e100_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (e110_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (usrp2_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = USRP2; - } else if ((e310_str != std::string::npos) || - (e3xx_str != std::string::npos)) { - tx_window = TX_WINDOW_FIXED; - dev_type = E3XX; - } else if (x300_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (x310_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (umtrx_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = UMTRX; - } else if (limesdr_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = LIMESDR; - } else { - LOG(ALERT) << "Unknown UHD device type " - << dev_str << " " << mboard_str; - return false; - } - - if (tx_window == TX_WINDOW_USRP1) { - LOG(INFO) << "Using USRP1 type transmit window for " - << dev_str << " " << mboard_str; - } else { - LOG(INFO) << "Using fixed transmit window for " - << dev_str << " " << mboard_str; - } - + dev_type = devStringMap.at(found).first; + tx_window = devStringMap.at(found).second; return true; } @@ -820,14 +643,12 @@ usrp_dev->set_clock_source(refstr); - // Set rates - double _rx_rate = select_rate(dev_type, rx_sps, iface); - double _tx_rate = select_rate(dev_type, tx_sps, iface); - - if ((_tx_rate < 0.0) || (_rx_rate < 0.0)) + try { + set_rates(); + } catch (const std::exception &e) { + LOG(ALERT) << "UHD rate setting failed - " << e.what(); return -1; - if (set_rates(_tx_rate, _rx_rate) < 0) - return -1; + } // Set RF frontend bandwidth if (dev_type == UMTRX) { @@ -859,17 +680,6 @@ size_t buf_len = SAMPLE_BUF_SZ / sizeof(uint32_t); for (size_t i = 0; i < rx_buffers.size(); i++) rx_buffers[i] = new smpl_buf(buf_len, rx_rate); - - // Set receive chain sample offset. Trigger the EDGE offset - // table by checking for 4 SPS on the receive path. No other - // configuration supports using 4 SPS. - double offset = get_dev_offset(); - if (offset == 0.0) { - LOG(ERR) << "Unsupported configuration, no correction applied"; - ts_offset = 0; - } else { - ts_offset = (TIMESTAMP) (offset * rx_rate); - } // Initialize and shadow gain values init_gains(); @@ -1236,7 +1046,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > B2XX_CLK_RT) { + if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 07:47:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 07:47:43 +0000 Subject: [PATCH] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' Message-ID: Review at https://gerrit.osmocom.org/2882 gsm0503_{coding,mapping}: Mark input arguments as 'const' It is generally our coding style to mark pointers to constant input data as 'const *'. For some reason the gsm0503 coding and mapping was not adhering to this, so let's bring it into compliance. Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_mapping.h M src/coding/gsm0503_coding.c M src/coding/gsm0503_mapping.c 4 files changed, 73 insertions(+), 74 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2882/1 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index b8eb205..f6591f5 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -21,43 +21,43 @@ EGPRS_NUM_MCS, }; -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data); -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data); +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data, +int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order); -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total); -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len); -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len); +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total); -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic); -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic); +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic); +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic); -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info); -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst); +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 4c6550a..7dac766 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -7,8 +7,8 @@ void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn); -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd); -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd); +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); void gsm0503_mcs5_ul_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, int B); diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index baf1ce1..d752454 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -490,7 +490,7 @@ return res; } -static int _xcch_decode_cB(uint8_t *l2_data, sbit_t *cB, +static int _xcch_decode_cB(uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) { ubit_t conv[224]; @@ -509,7 +509,7 @@ return 0; } -static int _xcch_encode_cB(ubit_t *cB, uint8_t *l2_data) +static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data) { ubit_t conv[224]; @@ -525,7 +525,7 @@ /* * GSM xCCH block transcoding */ -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[456]; @@ -539,7 +539,7 @@ return _xcch_decode_cB(l2_data, cB, n_errors, n_bits_total); } -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data) +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data) { ubit_t iB[456], cB[456], hl = 1, hn = 1; int i; @@ -748,7 +748,7 @@ * 3. CRC check * 4. Block combining (MCS-7,8,9 only) */ -static int egprs_decode_data(uint8_t *l2_data, sbit_t *c, +static int egprs_decode_data(uint8_t *l2_data, const sbit_t *c, int mcs, int p, int blk, int *n_errors, int *n_bits_total) { ubit_t u[EGPRS_DATA_U_MAX]; @@ -809,7 +809,7 @@ * 3. Burst unmapping and deinterleaving * 4. Data section decoding */ -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, uint16_t nbits, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t dc[EGPRS_DATA_DC_MAX]; @@ -879,7 +879,7 @@ * GSM PDTCH block transcoding */ -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[676], hl_hn[8]; @@ -1031,7 +1031,7 @@ /* * EGPRS PDTCH UL block encoding */ -static int egprs_type3_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type3_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; ubit_t iB[456]; @@ -1047,7 +1047,7 @@ return 0; } -static int egprs_type2_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type2_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; const ubit_t *up; @@ -1065,8 +1065,8 @@ return 0; } -static int egprs_type1_map(ubit_t *bursts, ubit_t *hc, - ubit_t *c1, ubit_t *c2, int usf, int mcs) +static int egprs_type1_map(ubit_t *bursts, const ubit_t *hc, + const ubit_t *c1, const ubit_t *c2, int usf, int mcs) { int i; const ubit_t *up; @@ -1088,7 +1088,7 @@ return 0; } -static int egprs_encode_hdr(ubit_t *hc, uint8_t *l2_data, int mcs) +static int egprs_encode_hdr(ubit_t *hc, const uint8_t *l2_data, int mcs) { int i, j; ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX]; @@ -1122,7 +1122,7 @@ return 0; } -static int egprs_encode_data(ubit_t *c, uint8_t *l2_data, +static int egprs_encode_data(ubit_t *c, const uint8_t *l2_data, int mcs, int p, int blk) { int i, j, data_len; @@ -1168,7 +1168,7 @@ * Type 3 - MCS-1,2,3,4 */ static int egprs_parse_dl_cps(struct egprs_cps *cps, - union gprs_rlc_dl_hdr_egprs *hdr, int type) + const union gprs_rlc_dl_hdr_egprs *hdr, int type) { uint8_t bits; @@ -1193,7 +1193,7 @@ * EGPRS DL message encoding */ int gsm0503_pdtch_egprs_encode(ubit_t *bursts, - uint8_t *l2_data, uint8_t l2_len) + const uint8_t *l2_data, uint8_t l2_len) { ubit_t hc[EGPRS_DATA_C_MAX], dc[EGPRS_DATA_DC_MAX]; ubit_t c1[EGPRS_DATA_C1], c2[EGPRS_DATA_C2]; @@ -1282,7 +1282,7 @@ return -1; } -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len) +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { ubit_t iB[456], cB[676]; const ubit_t *hl_hn; @@ -1367,7 +1367,7 @@ */ static void tch_fr_reassemble(uint8_t *tch_data, - ubit_t *b_bits, int net_order) + const ubit_t *b_bits, int net_order) { int i, j, k, l, o; @@ -1399,7 +1399,7 @@ } static void tch_fr_disassemble(ubit_t *b_bits, - uint8_t *tch_data, int net_order) + const uint8_t *tch_data, int net_order) { int i, j, k, l, o; @@ -1426,7 +1426,7 @@ } } -static void tch_hr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1437,7 +1437,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_hr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_hr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1445,7 +1445,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_efr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1456,7 +1456,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_efr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_efr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1464,7 +1464,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_amr_reassemble(uint8_t *tch_data, ubit_t *d_bits, int len) +static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len) { int i, j; @@ -1474,7 +1474,7 @@ tch_data[j >> 3] |= (d_bits[i] << (7 - (j & 7))); } -static void tch_amr_disassemble(ubit_t *d_bits, uint8_t *tch_data, int len) +static void tch_amr_disassemble(ubit_t *d_bits, const uint8_t *tch_data, int len) { int i, j; @@ -1482,7 +1482,7 @@ d_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_fr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1490,7 +1490,7 @@ b_bits[gsm610_bitorder[i]] = d_bits[i]; } -static void tch_fr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1498,7 +1498,7 @@ d_bits[i] = b_bits[gsm610_bitorder[i]]; } -static void tch_hr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1513,7 +1513,7 @@ b_bits[map[i]] = d_bits[i]; } -static void tch_hr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; const uint16_t *map; @@ -1527,7 +1527,7 @@ d_bits[i] = b_bits[map[i]]; } -static void tch_efr_d_to_w(ubit_t *b_bits, ubit_t *d_bits) +static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1535,7 +1535,7 @@ b_bits[gsm660_bitorder[i]] = d_bits[i]; } -static void tch_efr_w_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1543,7 +1543,7 @@ d_bits[i] = b_bits[gsm660_bitorder[i]]; } -static void tch_efr_protected(ubit_t *s_bits, ubit_t *b_bits) +static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits) { int i; @@ -1551,7 +1551,7 @@ b_bits[i] = s_bits[gsm0503_gsm_efr_protected_bits[i] - 1]; } -static void tch_fr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_fr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { int i; @@ -1564,7 +1564,7 @@ p[i] = u[91 + i]; } -static void tch_fr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_fr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { int i; @@ -1577,19 +1577,19 @@ u[91 + i] = p[i]; } -static void tch_hr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_hr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { memcpy(d, u, 95); memcpy(p, u + 95, 3); } -static void tch_hr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_hr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { memcpy(u, d, 95); memcpy(u + 95, p, 3); } -static void tch_efr_reorder(ubit_t *w, ubit_t *s, ubit_t *p) +static void tch_efr_reorder(ubit_t *w, const ubit_t *s, const ubit_t *p) { memcpy(w, s, 71); w[71] = w[72] = s[69]; @@ -1603,7 +1603,7 @@ memcpy(w + 252, p, 8); } -static void tch_efr_unreorder(ubit_t *s, ubit_t *p, ubit_t *w) +static void tch_efr_unreorder(ubit_t *s, ubit_t *p, const ubit_t *w) { int sum; @@ -1623,22 +1623,21 @@ memcpy(p, w + 252, 8); } -static void tch_amr_merge(ubit_t *u, ubit_t *d, ubit_t *p, int len, int prot) +static void tch_amr_merge(ubit_t *u, const ubit_t *d, const ubit_t *p, int len, int prot) { memcpy(u, d, prot); memcpy(u + prot, p, 6); memcpy(u + prot + 6, d + prot, len - prot); } -static void tch_amr_unmerge(ubit_t *d, ubit_t *p, - ubit_t *u, int len, int prot) +static void tch_amr_unmerge(ubit_t *d, ubit_t *p, const ubit_t *u, int len, int prot) { memcpy(d, u, prot); memcpy(p, u + prot, 6); memcpy(d + prot, u + prot + 6, len - prot); } -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1703,7 +1702,7 @@ return len; } -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) { ubit_t iB[912], cB[456], h; @@ -1761,7 +1760,7 @@ return 0; } -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1831,7 +1830,7 @@ return 15; } -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len) +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len) { ubit_t iB[912], cB[456], h; ubit_t conv[98], b[112], d[112], p[3]; @@ -1886,7 +1885,7 @@ return 0; } -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2081,7 +2080,7 @@ return len; } -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2241,7 +2240,7 @@ return -1; } -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2444,7 +2443,7 @@ return len; } -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2618,7 +2617,7 @@ return 0; } -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic) +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) { ubit_t conv[14]; int rv; @@ -2636,7 +2635,7 @@ return 0; } -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic) +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) { ubit_t conv[14]; @@ -2654,7 +2653,7 @@ /* * GSM SCH transcoding */ -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst) +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst) { ubit_t conv[35]; int rv; @@ -2670,7 +2669,7 @@ return 0; } -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info) +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info) { ubit_t conv[35]; diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 366eeb4..87bbb33 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -50,7 +50,7 @@ eB[58] = *hn; } -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd) +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd) { int i; @@ -70,7 +70,7 @@ } } -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) { int i; -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 12 08:34:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 08:34:51 +0000 Subject: osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 8 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 09:00:12 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 12 Jun 2017 09:00:12 +0000 Subject: libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2882/1/include/osmocom/coding/gsm0503_mapping.h File include/osmocom/coding/gsm0503_mapping.h: Line 7: void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, What about this one? -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 09:18:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 09:18:22 +0000 Subject: libosmocore[master]: gsm/gsm48.c: drop useless assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 09:19:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 09:19:29 +0000 Subject: libosmocore[master]: sim/core.c: drop useless double assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 09:20:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 09:20:02 +0000 Subject: libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 09:21:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 09:21:28 +0000 Subject: osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jun 12 10:13:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 10:13:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: test: Remove unused variable Failure Message-ID: Review at https://gerrit.osmocom.org/2883 test: Remove unused variable Failure Commit 6ccda11a98afd6f4459e9ff1c24de4ad4450de23 removed its use but forgot to remove it on this line. Change-Id: I90375ce1e4b8e0b7e140df908323bc269e0baf40 --- M src/osmo_gsm_tester/test.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/83/2883/1 diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 45ac602..2958501 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -35,7 +35,7 @@ Timeout = None def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout trial = suite_run.trial suite = suite_run test = _test -- To view, visit https://gerrit.osmocom.org/2883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90375ce1e4b8e0b7e140df908323bc269e0baf40 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 12 10:13:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 10:13:04 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add support for SMPP testing Message-ID: Review at https://gerrit.osmocom.org/2884 Add support for SMPP testing As defined in [1], the different related actors are implemented in this commit: ESME and SMSC. SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or the MSC. A new Smsc abstract class is created to shared code between the NITB and the MSC, and also makes it easier for later when the SMSC is splitted. ESMEs can be dynamically added to its configuration in a similar way to how the BTSs are added. ESME: A new class Esme is created which can be used by tests to control an ESME to interact with the SMSC. The ESME functionalities are implemented using python-smpplib. Required version of this library is at least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support for python 3 and some required features to poll the socket. This commit already contains a few tests which checks different features and tests the API. Extending tested features or scenarios can be later done quite easily. The tests are not enabled by default right now, because there are several of them in a suite and the ip_address resources are not freed after every tests which ends up in the suite failing due to missing reserved resources. All the tests run alone work though. When the issue is fixed they can then be added to the default list of tests to be run. [1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da --- M selftest/template_test/osmo-nitb.cfg.tmpl A src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/sms.py A src/osmo_gsm_tester/smsc.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/test.py A suites/aoip_smpp/esme_connect_policy_acceptall.py A suites/aoip_smpp/esme_connect_policy_closed.py A suites/aoip_smpp/esme_ms_sms.py A suites/aoip_smpp/suite.conf A suites/smpp/esme_connect_policy_acceptall.py A suites/smpp/esme_connect_policy_closed.py A suites/smpp/esme_ms_sms.py A suites/smpp/suite.conf 18 files changed, 493 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/2884/1 diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 3404b7f..14f65d6 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -50,9 +50,11 @@ local-tcp-ip ${smpp_bind_ip} 2775 system-id test policy closed - esme test - password test +%for esme in esme_list: + esme ${esme.system_id} + password ${esme.password} default-route +%endfor ctrl bind ${ctrl_bind_ip} %for bts in bts_list: diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py new file mode 100644 index 0000000..db39ab3 --- /dev/null +++ b/src/osmo_gsm_tester/esme.py @@ -0,0 +1,132 @@ +# osmo_gsm_tester: SMPP ESME to talk to SMSC +# +# Copyright (C) 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 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 . + +import smpplib.gsm +import smpplib.client +import smpplib.consts +import smpplib.exceptions + +from . import log, util, event_loop, sms + +# if you want to know what's happening inside python-smpplib +#import logging +#logging.basicConfig(level='DEBUG') + +class Esme(log.Origin): + + def __init__(self): + self.msisdn = None + self.client = None + self.system_id = 'esme-id' + self.password = 'esme-pwd' + self.connected = False + self.binded = False + self.listen_flag = False + self.smsc = None + + def __del__(self): + try: + self.disconnect() + except smpplib.exceptions.ConnectionError: + pass + + def set_smsc(self, smsc): + self.smsc = smsc + + def set_system_id(self, name=None): + self.system_id = name + + def set_password(self, password=None): + self.password = password + + def conf_for_smsc(self): + config = { 'system_id': self.system_id, 'password': self.password } + return config + + def poll_handler(self): + self.client.poll() + + def start_listening(self): + self.listen_flag = True + event_loop.register_poll_func(self.poll_handler) + + def stop_listening(self): + if self.listen_flag: + self.listen_flag = False + # Empty the queue before processing the unbind + disconnect PDUs + event_loop.unregister_poll_func(self.poll_handler) + self.poll_handler() + + def connect(self): + host, port = self.smsc.smpp_addr_port() + if self.client: + self.disconnect() + self.client = smpplib.client.Client(host, port, timeout=None) + self.client.set_message_sent_handler( + lambda pdu: self.dbg('message sent:', repr(pdu)) ) + self.client.set_message_received_handler( + lambda pdu: self.dbg('message received:', repr(pdu)) ) + self.client.connect() + self.connected = True + self.client.bind_transceiver(system_id=self.system_id, password=self.password) + self.binded = True + self.log('Connected and binded successfully. Start listening') + self.start_listening() + + def disconnect(self): + self.stop_listening() + if self.binded: + self.client.unbind() + self.binded = False + if self.connected: + self.client.disconnect() + self.connected = False + + def set_msisdn(self, msisdn): + self.msisdn = msisdn + self.set_name('esme-%s' % self.msisdn) + + def run_method_expect_failure(self, errcode, method, *args): + try: + method(*args) + #it should not succeed, raise an exception: + self.raise_exn('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) + except smpplib.exceptions.PDUError as e: + if e.args[1] != errcode: + raise e + + def sms_send(self, sms_obj): + parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) + + self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + for part in parts: + pdu = self.client.send_message( + source_addr_ton=smpplib.consts.SMPP_TON_INTL, + source_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + source_addr=sms_obj.src_msisdn(), + dest_addr_ton=smpplib.consts.SMPP_TON_INTL, + dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + destination_addr=sms_obj.dst_msisdn(), + short_message=part, + data_coding=encoding_flag, + esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, + registered_delivery=False, + ) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2ef88df..5398378 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -20,9 +20,9 @@ import os import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc -class OsmoMsc(log.Origin): +class OsmoMsc(log.Origin, smsc.Smsc): suite_run = None ip_address = None run_dir = None @@ -37,6 +37,7 @@ self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw + smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-msc') @@ -73,7 +74,7 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) - + config.overlay(values, dict(msc=self.smsc_config())) self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..05634ba 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -21,9 +21,9 @@ import re import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc -class OsmoNitb(log.Origin): +class OsmoNitb(log.Origin, smsc.Smsc): suite_run = None ip_address = None run_dir = None @@ -37,6 +37,7 @@ self.set_log_category(log.C_RUN) self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] + smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-nitb') @@ -76,7 +77,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) - + config.overlay(values, dict(nitb=self.smsc_config())) self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 570ef96..e264b66 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -21,14 +21,16 @@ _last_sms_idx = 0 msg = None - def __init__(self, from_msisdn=None, to_msisdn=None, *tokens): + def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): Sms._last_sms_idx += 1 + self._src_msisdn = src_msisdn + self._dst_msisdn = dst_msisdn msgs = ['message nr. %d' % Sms._last_sms_idx] msgs.extend(tokens) - if from_msisdn: - msgs.append('from %s' % from_msisdn) - if to_msisdn: - msgs.append('to %s' % to_msisdn) + if src_msisdn: + msgs.append('from %s' % src_msisdn) + if dst_msisdn: + msgs.append('to %s' % dst_msisdn) self.msg = ', '.join(msgs) def __str__(self): @@ -42,6 +44,12 @@ return self.msg == other.msg return self.msg == other + def src_msisdn(self): + return self._src_msisdn + + def dst_msisdn(self): + return self._dst_msisdn + def matches(self, msg): return self.msg == msg diff --git a/src/osmo_gsm_tester/smsc.py b/src/osmo_gsm_tester/smsc.py new file mode 100644 index 0000000..e255be0 --- /dev/null +++ b/src/osmo_gsm_tester/smsc.py @@ -0,0 +1,51 @@ +# osmo_gsm_tester: smsc interface +# +# 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 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 . + +from . import log, config, util, template, process + +class Smsc: + esmes = None + + SMSC_POLICY_CLOSED = 'closed' + SMSC_POLICY_ACCEPT_ALL = 'accept-all' + + def __init__(self, smpp_addr_port): + self.addr_port = smpp_addr_port + self.policy = self.SMSC_POLICY_CLOSED + self.esmes = [] + + def smsc_config(self): + values = { 'smsc': { 'policy': self.policy } } + esme_list = [] + for esme in self.esmes: + esme_list.append(esme.conf_for_smsc()) + config.overlay(values, dict(smsc=dict(esme_list=esme_list))) + return values + + def esme_add(self, esme): + self.esmes.append(esme) + esme.set_smsc(self) + + def smpp_addr_port(self): + return self.addr_port + + def set_smsc_policy(self, smsc_policy): + self.policy = smsc_policy + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 0dd8790..81e065c 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import copy import traceback import pprint -from . import config, log, template, util, resource, schema, ofono_client, event_loop +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 from . import test @@ -96,7 +96,7 @@ log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop, sms) with self.redirect_stdout(): util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) @@ -342,8 +342,13 @@ l.append(self.modem()) return l + def esme(self): + esme_obj = esme.Esme() + esme_obj.set_msisdn(self.msisdn()) + return esme_obj + def msisdn(self): - msisdn = self.resources_pool.next_msisdn(self.origin) + msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) return msisdn diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 247365e..1a00af7 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -21,12 +21,14 @@ assign-tmsi ctrl bind ${msc.ip_address.addr} -smpp - local-tcp-ip ${msc.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test - default-route + smpp + local-tcp-ip ${msc.ip_address.addr} 2775 + system-id test-nitb + policy ${msc.smsc.policy} + %for esme in msc.smsc.esme_list: + esme ${esme.system_id} + password ${esme.password} + default-route + %endfor hlr remote-ip ${hlr.ip_address.addr} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index a47ac02..a2bd249 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -76,10 +76,12 @@ %endfor smpp local-tcp-ip ${nitb.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy ${nitb.smsc.policy} +%for esme in nitb.smsc.esme_list: + esme ${esme.system_id} + password ${esme.password} default-route +%endfor ctrl bind ${nitb.ip_address.addr} diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..49911b3 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,9 +33,10 @@ poll = None prompt = None Timeout = None +Sms = None -def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout +def setup(suite_run, _test, ofono_client, suite_module, event_module, sms_module): + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms trial = suite_run.trial suite = suite_run test = _test @@ -49,5 +50,6 @@ poll = event_module.poll prompt = suite_run.prompt Timeout = suite_module.Timeout + Sms = sms_module.Sms # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..d3ec2f5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on the config file + +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) +bsc.bts_add(bts) + +esme = suite.esme() +msc.set_smsc_policy(msc.SMSC_POLICY_ACCEPT_ALL) + +# here we deliberately ommit calling msc.esme_add() to avoid having it included in the smsc config. +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +# Connect should work even if we didn't previously configure the esme in the smsc. +esme.set_smsc(msc) +esme.connect() +esme.disconnect() diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..0c989b5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_closed.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +bsc.bts_add(bts) + +esme = suite.esme() +msc.set_smsc_policy(msc.SMSC_POLICY_CLOSED) +msc.esme_add(esme) + +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +# Connect should work as we configured msc properly at esme_add() time. +log('Test with correct credentials...') +esme.connect() +esme.disconnect() + +# We now change the password, it should fail: +log('Test with bad password...') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +# We now change the system_id, it should fail: +log('Test with bad system id...') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms.py new file mode 100755 index 0000000..22bb695 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.esme_add(esme) +print('start msc and bts...') +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) +ms.connect(msc) + +ms.log_info() +print('waiting for modems to attach...') +wait(msc.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf new file mode 100644 index 0000000..1a863a7 --- /dev/null +++ b/suites/aoip_smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 4 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s diff --git a/suites/smpp/esme_connect_policy_acceptall.py b/suites/smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..7efc759 --- /dev/null +++ b/suites/smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on the config file + +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +esme = suite.esme() + +nitb.set_smsc_policy(nitb.SMSC_POLICY_ACCEPT_ALL) +# here we deliberately ommit calling nitb.esme_add() to avoid having it included in the smsc config. +nitb.start() + +# Connect should work even if we didn't previously configure the esme in the smsc. +esme.set_smsc(nitb) +esme.connect() +esme.disconnect() diff --git a/suites/smpp/esme_connect_policy_closed.py b/suites/smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..916fade --- /dev/null +++ b/suites/smpp/esme_connect_policy_closed.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +nitb = suite.nitb() +esme = suite.esme() + +nitb.set_smsc_policy(nitb.SMSC_POLICY_CLOSED) +nitb.esme_add(esme) + +nitb.start() + +# Connect should work as we configured nitb properly at esme_add() time. +log('Test with correct credentials...') +esme.connect() +esme.disconnect() + +# We now change the password, it should fail: +log('Test with bad password...') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +# We now change the system_id, it should fail: +log('Test with bad system id...') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py new file mode 100755 index 0000000..59d6cfa --- /dev/null +++ b/suites/smpp/esme_ms_sms.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) +ms.connect(nitb) + +ms.log_info() +print('waiting for modems to attach...') +wait(nitb.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 12 10:31:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 10:31:23 +0000 Subject: osmo-gsm-tester[master]: test: Remove unused variable Failure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Trivial, I merge -- To view, visit https://gerrit.osmocom.org/2883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90375ce1e4b8e0b7e140df908323bc269e0baf40 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 Mon Jun 12 10:31:31 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 10:31:31 +0000 Subject: [MERGED] osmo-gsm-tester[master]: test: Remove unused variable Failure In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: test: Remove unused variable Failure ...................................................................... test: Remove unused variable Failure Commit 6ccda11a98afd6f4459e9ff1c24de4ad4450de23 removed its use but forgot to remove it on this line. Change-Id: I90375ce1e4b8e0b7e140df908323bc269e0baf40 --- M src/osmo_gsm_tester/test.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 45ac602..2958501 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -35,7 +35,7 @@ Timeout = None def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Failure, Timeout + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout trial = suite_run.trial suite = suite_run test = _test -- To view, visit https://gerrit.osmocom.org/2883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90375ce1e4b8e0b7e140df908323bc269e0baf40 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 From gerrit-no-reply at lists.osmocom.org Mon Jun 12 10:44:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 10:44:08 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2884 to look at the new patch set (#2). Add support for SMPP testing As defined in [1], the different related actors are implemented in this commit: ESME and SMSC. SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or the MSC. A new Smsc abstract class is created to shared code between the NITB and the MSC, and also makes it easier for later when the SMSC is splitted. ESMEs can be dynamically added to its configuration in a similar way to how the BTSs are added. ESME: A new class Esme is created which can be used by tests to control an ESME to interact with the SMSC. The ESME functionalities are implemented using python-smpplib. Required version of this library is at least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support for python 3 and some required features to poll the socket. This commit already contains a few tests which checks different features and tests the API. Extending tested features or scenarios can be later done quite easily. The tests are not enabled by default right now, because there are several of them in a suite and the ip_address resources are not freed after every tests which ends up in the suite failing due to missing reserved resources. All the tests run alone work though. When the issue is fixed they can then be added to the default list of tests to be run. [1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da --- M selftest/template_test.ok M selftest/template_test.py M selftest/template_test/osmo-nitb.cfg.tmpl A src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/sms.py A src/osmo_gsm_tester/smsc.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/test.py A suites/aoip_smpp/esme_connect_policy_acceptall.py A suites/aoip_smpp/esme_connect_policy_closed.py A suites/aoip_smpp/esme_ms_sms.py A suites/aoip_smpp/suite.conf A suites/smpp/esme_connect_policy_acceptall.py A suites/smpp/esme_connect_policy_closed.py A suites/smpp/esme_ms_sms.py A suites/smpp/suite.conf 20 files changed, 515 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/2884/2 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index d031c96..15faefc 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -136,10 +136,13 @@ phys_chan_config val_phys_chan_config_3 smpp local-tcp-ip val_ip_address 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy val_smsc_policy + esme val_system_id_esme0 + password val_password_esme0 + default-route + esme val_system_id_esme1 + password val_password_esme1 default-route ctrl bind val_ip_address diff --git a/selftest/template_test.py b/selftest/template_test.py index 45347b6..76fb86b 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -35,6 +35,11 @@ ) } +mock_esme = { + 'system_id': 'val_system_id', + 'password': 'val_password' +} + def clone_mod(d, val_ext): c = dict(d) for name in c.keys(): @@ -47,7 +52,14 @@ mock_bts0 = clone_mod(mock_bts, '_bts0') mock_bts1 = clone_mod(mock_bts, '_bts1') +mock_esme0 = clone_mod(mock_esme, '_esme0') +mock_esme1 = clone_mod(mock_esme, '_esme1') + vals = dict(nitb=dict( + smsc=dict( + policy='val_smsc_policy', + esme_list=(mock_esme0, mock_esme1) + ), net=dict( mcc='val_mcc', mnc='val_mnc', diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 3404b7f..d02e3fe 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -47,12 +47,14 @@ timer t3119 0 timer t3141 0 smpp - local-tcp-ip ${smpp_bind_ip} 2775 - system-id test - policy closed - esme test - password test + local-tcp-ip ${nitb.ip_address.addr} 2775 + system-id test-nitb + policy ${nitb.smsc.policy} +%for esme in esme_list: + esme ${esme.system_id} + password ${esme.password} default-route +%endfor ctrl bind ${ctrl_bind_ip} %for bts in bts_list: diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py new file mode 100644 index 0000000..db39ab3 --- /dev/null +++ b/src/osmo_gsm_tester/esme.py @@ -0,0 +1,132 @@ +# osmo_gsm_tester: SMPP ESME to talk to SMSC +# +# Copyright (C) 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 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 . + +import smpplib.gsm +import smpplib.client +import smpplib.consts +import smpplib.exceptions + +from . import log, util, event_loop, sms + +# if you want to know what's happening inside python-smpplib +#import logging +#logging.basicConfig(level='DEBUG') + +class Esme(log.Origin): + + def __init__(self): + self.msisdn = None + self.client = None + self.system_id = 'esme-id' + self.password = 'esme-pwd' + self.connected = False + self.binded = False + self.listen_flag = False + self.smsc = None + + def __del__(self): + try: + self.disconnect() + except smpplib.exceptions.ConnectionError: + pass + + def set_smsc(self, smsc): + self.smsc = smsc + + def set_system_id(self, name=None): + self.system_id = name + + def set_password(self, password=None): + self.password = password + + def conf_for_smsc(self): + config = { 'system_id': self.system_id, 'password': self.password } + return config + + def poll_handler(self): + self.client.poll() + + def start_listening(self): + self.listen_flag = True + event_loop.register_poll_func(self.poll_handler) + + def stop_listening(self): + if self.listen_flag: + self.listen_flag = False + # Empty the queue before processing the unbind + disconnect PDUs + event_loop.unregister_poll_func(self.poll_handler) + self.poll_handler() + + def connect(self): + host, port = self.smsc.smpp_addr_port() + if self.client: + self.disconnect() + self.client = smpplib.client.Client(host, port, timeout=None) + self.client.set_message_sent_handler( + lambda pdu: self.dbg('message sent:', repr(pdu)) ) + self.client.set_message_received_handler( + lambda pdu: self.dbg('message received:', repr(pdu)) ) + self.client.connect() + self.connected = True + self.client.bind_transceiver(system_id=self.system_id, password=self.password) + self.binded = True + self.log('Connected and binded successfully. Start listening') + self.start_listening() + + def disconnect(self): + self.stop_listening() + if self.binded: + self.client.unbind() + self.binded = False + if self.connected: + self.client.disconnect() + self.connected = False + + def set_msisdn(self, msisdn): + self.msisdn = msisdn + self.set_name('esme-%s' % self.msisdn) + + def run_method_expect_failure(self, errcode, method, *args): + try: + method(*args) + #it should not succeed, raise an exception: + self.raise_exn('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) + except smpplib.exceptions.PDUError as e: + if e.args[1] != errcode: + raise e + + def sms_send(self, sms_obj): + parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) + + self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + for part in parts: + pdu = self.client.send_message( + source_addr_ton=smpplib.consts.SMPP_TON_INTL, + source_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + source_addr=sms_obj.src_msisdn(), + dest_addr_ton=smpplib.consts.SMPP_TON_INTL, + dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + destination_addr=sms_obj.dst_msisdn(), + short_message=part, + data_coding=encoding_flag, + esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, + registered_delivery=False, + ) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2ef88df..5398378 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -20,9 +20,9 @@ import os import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc -class OsmoMsc(log.Origin): +class OsmoMsc(log.Origin, smsc.Smsc): suite_run = None ip_address = None run_dir = None @@ -37,6 +37,7 @@ self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw + smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-msc') @@ -73,7 +74,7 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) - + config.overlay(values, dict(msc=self.smsc_config())) self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..05634ba 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -21,9 +21,9 @@ import re import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc -class OsmoNitb(log.Origin): +class OsmoNitb(log.Origin, smsc.Smsc): suite_run = None ip_address = None run_dir = None @@ -37,6 +37,7 @@ self.set_log_category(log.C_RUN) self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] + smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-nitb') @@ -76,7 +77,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) - + config.overlay(values, dict(nitb=self.smsc_config())) self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 570ef96..e264b66 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -21,14 +21,16 @@ _last_sms_idx = 0 msg = None - def __init__(self, from_msisdn=None, to_msisdn=None, *tokens): + def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): Sms._last_sms_idx += 1 + self._src_msisdn = src_msisdn + self._dst_msisdn = dst_msisdn msgs = ['message nr. %d' % Sms._last_sms_idx] msgs.extend(tokens) - if from_msisdn: - msgs.append('from %s' % from_msisdn) - if to_msisdn: - msgs.append('to %s' % to_msisdn) + if src_msisdn: + msgs.append('from %s' % src_msisdn) + if dst_msisdn: + msgs.append('to %s' % dst_msisdn) self.msg = ', '.join(msgs) def __str__(self): @@ -42,6 +44,12 @@ return self.msg == other.msg return self.msg == other + def src_msisdn(self): + return self._src_msisdn + + def dst_msisdn(self): + return self._dst_msisdn + def matches(self, msg): return self.msg == msg diff --git a/src/osmo_gsm_tester/smsc.py b/src/osmo_gsm_tester/smsc.py new file mode 100644 index 0000000..e255be0 --- /dev/null +++ b/src/osmo_gsm_tester/smsc.py @@ -0,0 +1,51 @@ +# osmo_gsm_tester: smsc interface +# +# 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 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 . + +from . import log, config, util, template, process + +class Smsc: + esmes = None + + SMSC_POLICY_CLOSED = 'closed' + SMSC_POLICY_ACCEPT_ALL = 'accept-all' + + def __init__(self, smpp_addr_port): + self.addr_port = smpp_addr_port + self.policy = self.SMSC_POLICY_CLOSED + self.esmes = [] + + def smsc_config(self): + values = { 'smsc': { 'policy': self.policy } } + esme_list = [] + for esme in self.esmes: + esme_list.append(esme.conf_for_smsc()) + config.overlay(values, dict(smsc=dict(esme_list=esme_list))) + return values + + def esme_add(self, esme): + self.esmes.append(esme) + esme.set_smsc(self) + + def smpp_addr_port(self): + return self.addr_port + + def set_smsc_policy(self, smsc_policy): + self.policy = smsc_policy + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 0dd8790..81e065c 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import copy import traceback import pprint -from . import config, log, template, util, resource, schema, ofono_client, event_loop +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 from . import test @@ -96,7 +96,7 @@ log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop, sms) with self.redirect_stdout(): util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) @@ -342,8 +342,13 @@ l.append(self.modem()) return l + def esme(self): + esme_obj = esme.Esme() + esme_obj.set_msisdn(self.msisdn()) + return esme_obj + def msisdn(self): - msisdn = self.resources_pool.next_msisdn(self.origin) + msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) return msisdn diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 247365e..1a00af7 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -21,12 +21,14 @@ assign-tmsi ctrl bind ${msc.ip_address.addr} -smpp - local-tcp-ip ${msc.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test - default-route + smpp + local-tcp-ip ${msc.ip_address.addr} 2775 + system-id test-nitb + policy ${msc.smsc.policy} + %for esme in msc.smsc.esme_list: + esme ${esme.system_id} + password ${esme.password} + default-route + %endfor hlr remote-ip ${hlr.ip_address.addr} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index a47ac02..a2bd249 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -76,10 +76,12 @@ %endfor smpp local-tcp-ip ${nitb.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy ${nitb.smsc.policy} +%for esme in nitb.smsc.esme_list: + esme ${esme.system_id} + password ${esme.password} default-route +%endfor ctrl bind ${nitb.ip_address.addr} diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..49911b3 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,9 +33,10 @@ poll = None prompt = None Timeout = None +Sms = None -def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout +def setup(suite_run, _test, ofono_client, suite_module, event_module, sms_module): + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms trial = suite_run.trial suite = suite_run test = _test @@ -49,5 +50,6 @@ poll = event_module.poll prompt = suite_run.prompt Timeout = suite_module.Timeout + Sms = sms_module.Sms # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..d3ec2f5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on the config file + +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) +bsc.bts_add(bts) + +esme = suite.esme() +msc.set_smsc_policy(msc.SMSC_POLICY_ACCEPT_ALL) + +# here we deliberately ommit calling msc.esme_add() to avoid having it included in the smsc config. +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +# Connect should work even if we didn't previously configure the esme in the smsc. +esme.set_smsc(msc) +esme.connect() +esme.disconnect() diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..0c989b5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_closed.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +bsc.bts_add(bts) + +esme = suite.esme() +msc.set_smsc_policy(msc.SMSC_POLICY_CLOSED) +msc.esme_add(esme) + +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +# Connect should work as we configured msc properly at esme_add() time. +log('Test with correct credentials...') +esme.connect() +esme.disconnect() + +# We now change the password, it should fail: +log('Test with bad password...') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +# We now change the system_id, it should fail: +log('Test with bad system id...') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms.py new file mode 100755 index 0000000..22bb695 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.esme_add(esme) +print('start msc and bts...') +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) +ms.connect(msc) + +ms.log_info() +print('waiting for modems to attach...') +wait(msc.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf new file mode 100644 index 0000000..1a863a7 --- /dev/null +++ b/suites/aoip_smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 4 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s diff --git a/suites/smpp/esme_connect_policy_acceptall.py b/suites/smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..7efc759 --- /dev/null +++ b/suites/smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on the config file + +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +esme = suite.esme() + +nitb.set_smsc_policy(nitb.SMSC_POLICY_ACCEPT_ALL) +# here we deliberately ommit calling nitb.esme_add() to avoid having it included in the smsc config. +nitb.start() + +# Connect should work even if we didn't previously configure the esme in the smsc. +esme.set_smsc(nitb) +esme.connect() +esme.disconnect() diff --git a/suites/smpp/esme_connect_policy_closed.py b/suites/smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..916fade --- /dev/null +++ b/suites/smpp/esme_connect_policy_closed.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +nitb = suite.nitb() +esme = suite.esme() + +nitb.set_smsc_policy(nitb.SMSC_POLICY_CLOSED) +nitb.esme_add(esme) + +nitb.start() + +# Connect should work as we configured nitb properly at esme_add() time. +log('Test with correct credentials...') +esme.connect() +esme.disconnect() + +# We now change the password, it should fail: +log('Test with bad password...') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +# We now change the system_id, it should fail: +log('Test with bad system id...') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py new file mode 100755 index 0000000..59d6cfa --- /dev/null +++ b/suites/smpp/esme_ms_sms.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) +ms.connect(nitb) + +ms.log_info() +print('waiting for modems to attach...') +wait(nitb.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da 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 Mon Jun 12 10:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 10:58:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2882 to look at the new patch set (#2). gsm0503_{coding,mapping}: Mark input arguments as 'const' It is generally our coding style to mark pointers to constant input data as 'const *'. For some reason the gsm0503 coding and mapping was not adhering to this, so let's bring it into compliance. Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_mapping.h M src/coding/gsm0503_coding.c M src/coding/gsm0503_mapping.c 4 files changed, 74 insertions(+), 75 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2882/2 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index b8eb205..f6591f5 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -21,43 +21,43 @@ EGPRS_NUM_MCS, }; -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data); -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data); +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data, +int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order); -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total); -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len); -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len); +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total); -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic); -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic); +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic); +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic); -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info); -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst); +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 4c6550a..93e4b67 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -4,11 +4,11 @@ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); -void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, +void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn); -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd); -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd); +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); void gsm0503_mcs5_ul_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, int B); diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index baf1ce1..d752454 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -490,7 +490,7 @@ return res; } -static int _xcch_decode_cB(uint8_t *l2_data, sbit_t *cB, +static int _xcch_decode_cB(uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) { ubit_t conv[224]; @@ -509,7 +509,7 @@ return 0; } -static int _xcch_encode_cB(ubit_t *cB, uint8_t *l2_data) +static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data) { ubit_t conv[224]; @@ -525,7 +525,7 @@ /* * GSM xCCH block transcoding */ -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[456]; @@ -539,7 +539,7 @@ return _xcch_decode_cB(l2_data, cB, n_errors, n_bits_total); } -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data) +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data) { ubit_t iB[456], cB[456], hl = 1, hn = 1; int i; @@ -748,7 +748,7 @@ * 3. CRC check * 4. Block combining (MCS-7,8,9 only) */ -static int egprs_decode_data(uint8_t *l2_data, sbit_t *c, +static int egprs_decode_data(uint8_t *l2_data, const sbit_t *c, int mcs, int p, int blk, int *n_errors, int *n_bits_total) { ubit_t u[EGPRS_DATA_U_MAX]; @@ -809,7 +809,7 @@ * 3. Burst unmapping and deinterleaving * 4. Data section decoding */ -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, uint16_t nbits, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t dc[EGPRS_DATA_DC_MAX]; @@ -879,7 +879,7 @@ * GSM PDTCH block transcoding */ -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[676], hl_hn[8]; @@ -1031,7 +1031,7 @@ /* * EGPRS PDTCH UL block encoding */ -static int egprs_type3_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type3_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; ubit_t iB[456]; @@ -1047,7 +1047,7 @@ return 0; } -static int egprs_type2_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type2_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; const ubit_t *up; @@ -1065,8 +1065,8 @@ return 0; } -static int egprs_type1_map(ubit_t *bursts, ubit_t *hc, - ubit_t *c1, ubit_t *c2, int usf, int mcs) +static int egprs_type1_map(ubit_t *bursts, const ubit_t *hc, + const ubit_t *c1, const ubit_t *c2, int usf, int mcs) { int i; const ubit_t *up; @@ -1088,7 +1088,7 @@ return 0; } -static int egprs_encode_hdr(ubit_t *hc, uint8_t *l2_data, int mcs) +static int egprs_encode_hdr(ubit_t *hc, const uint8_t *l2_data, int mcs) { int i, j; ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX]; @@ -1122,7 +1122,7 @@ return 0; } -static int egprs_encode_data(ubit_t *c, uint8_t *l2_data, +static int egprs_encode_data(ubit_t *c, const uint8_t *l2_data, int mcs, int p, int blk) { int i, j, data_len; @@ -1168,7 +1168,7 @@ * Type 3 - MCS-1,2,3,4 */ static int egprs_parse_dl_cps(struct egprs_cps *cps, - union gprs_rlc_dl_hdr_egprs *hdr, int type) + const union gprs_rlc_dl_hdr_egprs *hdr, int type) { uint8_t bits; @@ -1193,7 +1193,7 @@ * EGPRS DL message encoding */ int gsm0503_pdtch_egprs_encode(ubit_t *bursts, - uint8_t *l2_data, uint8_t l2_len) + const uint8_t *l2_data, uint8_t l2_len) { ubit_t hc[EGPRS_DATA_C_MAX], dc[EGPRS_DATA_DC_MAX]; ubit_t c1[EGPRS_DATA_C1], c2[EGPRS_DATA_C2]; @@ -1282,7 +1282,7 @@ return -1; } -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len) +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { ubit_t iB[456], cB[676]; const ubit_t *hl_hn; @@ -1367,7 +1367,7 @@ */ static void tch_fr_reassemble(uint8_t *tch_data, - ubit_t *b_bits, int net_order) + const ubit_t *b_bits, int net_order) { int i, j, k, l, o; @@ -1399,7 +1399,7 @@ } static void tch_fr_disassemble(ubit_t *b_bits, - uint8_t *tch_data, int net_order) + const uint8_t *tch_data, int net_order) { int i, j, k, l, o; @@ -1426,7 +1426,7 @@ } } -static void tch_hr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1437,7 +1437,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_hr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_hr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1445,7 +1445,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_efr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1456,7 +1456,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_efr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_efr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1464,7 +1464,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_amr_reassemble(uint8_t *tch_data, ubit_t *d_bits, int len) +static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len) { int i, j; @@ -1474,7 +1474,7 @@ tch_data[j >> 3] |= (d_bits[i] << (7 - (j & 7))); } -static void tch_amr_disassemble(ubit_t *d_bits, uint8_t *tch_data, int len) +static void tch_amr_disassemble(ubit_t *d_bits, const uint8_t *tch_data, int len) { int i, j; @@ -1482,7 +1482,7 @@ d_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_fr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1490,7 +1490,7 @@ b_bits[gsm610_bitorder[i]] = d_bits[i]; } -static void tch_fr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1498,7 +1498,7 @@ d_bits[i] = b_bits[gsm610_bitorder[i]]; } -static void tch_hr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1513,7 +1513,7 @@ b_bits[map[i]] = d_bits[i]; } -static void tch_hr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; const uint16_t *map; @@ -1527,7 +1527,7 @@ d_bits[i] = b_bits[map[i]]; } -static void tch_efr_d_to_w(ubit_t *b_bits, ubit_t *d_bits) +static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1535,7 +1535,7 @@ b_bits[gsm660_bitorder[i]] = d_bits[i]; } -static void tch_efr_w_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1543,7 +1543,7 @@ d_bits[i] = b_bits[gsm660_bitorder[i]]; } -static void tch_efr_protected(ubit_t *s_bits, ubit_t *b_bits) +static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits) { int i; @@ -1551,7 +1551,7 @@ b_bits[i] = s_bits[gsm0503_gsm_efr_protected_bits[i] - 1]; } -static void tch_fr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_fr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { int i; @@ -1564,7 +1564,7 @@ p[i] = u[91 + i]; } -static void tch_fr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_fr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { int i; @@ -1577,19 +1577,19 @@ u[91 + i] = p[i]; } -static void tch_hr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_hr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { memcpy(d, u, 95); memcpy(p, u + 95, 3); } -static void tch_hr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_hr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { memcpy(u, d, 95); memcpy(u + 95, p, 3); } -static void tch_efr_reorder(ubit_t *w, ubit_t *s, ubit_t *p) +static void tch_efr_reorder(ubit_t *w, const ubit_t *s, const ubit_t *p) { memcpy(w, s, 71); w[71] = w[72] = s[69]; @@ -1603,7 +1603,7 @@ memcpy(w + 252, p, 8); } -static void tch_efr_unreorder(ubit_t *s, ubit_t *p, ubit_t *w) +static void tch_efr_unreorder(ubit_t *s, ubit_t *p, const ubit_t *w) { int sum; @@ -1623,22 +1623,21 @@ memcpy(p, w + 252, 8); } -static void tch_amr_merge(ubit_t *u, ubit_t *d, ubit_t *p, int len, int prot) +static void tch_amr_merge(ubit_t *u, const ubit_t *d, const ubit_t *p, int len, int prot) { memcpy(u, d, prot); memcpy(u + prot, p, 6); memcpy(u + prot + 6, d + prot, len - prot); } -static void tch_amr_unmerge(ubit_t *d, ubit_t *p, - ubit_t *u, int len, int prot) +static void tch_amr_unmerge(ubit_t *d, ubit_t *p, const ubit_t *u, int len, int prot) { memcpy(d, u, prot); memcpy(p, u + prot, 6); memcpy(d + prot, u + prot + 6, len - prot); } -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1703,7 +1702,7 @@ return len; } -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) { ubit_t iB[912], cB[456], h; @@ -1761,7 +1760,7 @@ return 0; } -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1831,7 +1830,7 @@ return 15; } -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len) +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len) { ubit_t iB[912], cB[456], h; ubit_t conv[98], b[112], d[112], p[3]; @@ -1886,7 +1885,7 @@ return 0; } -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2081,7 +2080,7 @@ return len; } -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2241,7 +2240,7 @@ return -1; } -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2444,7 +2443,7 @@ return len; } -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2618,7 +2617,7 @@ return 0; } -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic) +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) { ubit_t conv[14]; int rv; @@ -2636,7 +2635,7 @@ return 0; } -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic) +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) { ubit_t conv[14]; @@ -2654,7 +2653,7 @@ /* * GSM SCH transcoding */ -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst) +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst) { ubit_t conv[35]; int rv; @@ -2670,7 +2669,7 @@ return 0; } -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info) +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info) { ubit_t conv[35]; diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 366eeb4..87bbb33 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -50,7 +50,7 @@ eB[58] = *hn; } -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd) +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd) { int i; @@ -70,7 +70,7 @@ } } -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) { int i; -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 12 10:59:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 10:59:25 +0000 Subject: [PATCH] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2882 to look at the new patch set (#3). gsm0503_{coding,mapping}: Mark input arguments as 'const' It is generally our coding style to mark pointers to constant input data as 'const *'. For some reason the gsm0503 coding and mapping was not adhering to this, so let's bring it into compliance. Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_mapping.h M src/coding/gsm0503_coding.c M src/coding/gsm0503_mapping.c 4 files changed, 75 insertions(+), 76 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2882/3 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index b8eb205..f6591f5 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -21,43 +21,43 @@ EGPRS_NUM_MCS, }; -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data); -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data); +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data, +int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order); -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total); -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len); -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len); +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total); -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic); -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic); +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic); +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic); -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info); -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst); +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 4c6550a..93e4b67 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -4,11 +4,11 @@ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); -void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, +void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn); -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd); -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd); +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); void gsm0503_mcs5_ul_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, int B); diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index baf1ce1..d752454 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -490,7 +490,7 @@ return res; } -static int _xcch_decode_cB(uint8_t *l2_data, sbit_t *cB, +static int _xcch_decode_cB(uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) { ubit_t conv[224]; @@ -509,7 +509,7 @@ return 0; } -static int _xcch_encode_cB(ubit_t *cB, uint8_t *l2_data) +static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data) { ubit_t conv[224]; @@ -525,7 +525,7 @@ /* * GSM xCCH block transcoding */ -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[456]; @@ -539,7 +539,7 @@ return _xcch_decode_cB(l2_data, cB, n_errors, n_bits_total); } -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data) +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data) { ubit_t iB[456], cB[456], hl = 1, hn = 1; int i; @@ -748,7 +748,7 @@ * 3. CRC check * 4. Block combining (MCS-7,8,9 only) */ -static int egprs_decode_data(uint8_t *l2_data, sbit_t *c, +static int egprs_decode_data(uint8_t *l2_data, const sbit_t *c, int mcs, int p, int blk, int *n_errors, int *n_bits_total) { ubit_t u[EGPRS_DATA_U_MAX]; @@ -809,7 +809,7 @@ * 3. Burst unmapping and deinterleaving * 4. Data section decoding */ -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, uint16_t nbits, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t dc[EGPRS_DATA_DC_MAX]; @@ -879,7 +879,7 @@ * GSM PDTCH block transcoding */ -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[676], hl_hn[8]; @@ -1031,7 +1031,7 @@ /* * EGPRS PDTCH UL block encoding */ -static int egprs_type3_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type3_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; ubit_t iB[456]; @@ -1047,7 +1047,7 @@ return 0; } -static int egprs_type2_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type2_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; const ubit_t *up; @@ -1065,8 +1065,8 @@ return 0; } -static int egprs_type1_map(ubit_t *bursts, ubit_t *hc, - ubit_t *c1, ubit_t *c2, int usf, int mcs) +static int egprs_type1_map(ubit_t *bursts, const ubit_t *hc, + const ubit_t *c1, const ubit_t *c2, int usf, int mcs) { int i; const ubit_t *up; @@ -1088,7 +1088,7 @@ return 0; } -static int egprs_encode_hdr(ubit_t *hc, uint8_t *l2_data, int mcs) +static int egprs_encode_hdr(ubit_t *hc, const uint8_t *l2_data, int mcs) { int i, j; ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX]; @@ -1122,7 +1122,7 @@ return 0; } -static int egprs_encode_data(ubit_t *c, uint8_t *l2_data, +static int egprs_encode_data(ubit_t *c, const uint8_t *l2_data, int mcs, int p, int blk) { int i, j, data_len; @@ -1168,7 +1168,7 @@ * Type 3 - MCS-1,2,3,4 */ static int egprs_parse_dl_cps(struct egprs_cps *cps, - union gprs_rlc_dl_hdr_egprs *hdr, int type) + const union gprs_rlc_dl_hdr_egprs *hdr, int type) { uint8_t bits; @@ -1193,7 +1193,7 @@ * EGPRS DL message encoding */ int gsm0503_pdtch_egprs_encode(ubit_t *bursts, - uint8_t *l2_data, uint8_t l2_len) + const uint8_t *l2_data, uint8_t l2_len) { ubit_t hc[EGPRS_DATA_C_MAX], dc[EGPRS_DATA_DC_MAX]; ubit_t c1[EGPRS_DATA_C1], c2[EGPRS_DATA_C2]; @@ -1282,7 +1282,7 @@ return -1; } -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len) +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { ubit_t iB[456], cB[676]; const ubit_t *hl_hn; @@ -1367,7 +1367,7 @@ */ static void tch_fr_reassemble(uint8_t *tch_data, - ubit_t *b_bits, int net_order) + const ubit_t *b_bits, int net_order) { int i, j, k, l, o; @@ -1399,7 +1399,7 @@ } static void tch_fr_disassemble(ubit_t *b_bits, - uint8_t *tch_data, int net_order) + const uint8_t *tch_data, int net_order) { int i, j, k, l, o; @@ -1426,7 +1426,7 @@ } } -static void tch_hr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1437,7 +1437,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_hr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_hr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1445,7 +1445,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_efr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1456,7 +1456,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_efr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_efr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1464,7 +1464,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_amr_reassemble(uint8_t *tch_data, ubit_t *d_bits, int len) +static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len) { int i, j; @@ -1474,7 +1474,7 @@ tch_data[j >> 3] |= (d_bits[i] << (7 - (j & 7))); } -static void tch_amr_disassemble(ubit_t *d_bits, uint8_t *tch_data, int len) +static void tch_amr_disassemble(ubit_t *d_bits, const uint8_t *tch_data, int len) { int i, j; @@ -1482,7 +1482,7 @@ d_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_fr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1490,7 +1490,7 @@ b_bits[gsm610_bitorder[i]] = d_bits[i]; } -static void tch_fr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1498,7 +1498,7 @@ d_bits[i] = b_bits[gsm610_bitorder[i]]; } -static void tch_hr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1513,7 +1513,7 @@ b_bits[map[i]] = d_bits[i]; } -static void tch_hr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; const uint16_t *map; @@ -1527,7 +1527,7 @@ d_bits[i] = b_bits[map[i]]; } -static void tch_efr_d_to_w(ubit_t *b_bits, ubit_t *d_bits) +static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1535,7 +1535,7 @@ b_bits[gsm660_bitorder[i]] = d_bits[i]; } -static void tch_efr_w_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1543,7 +1543,7 @@ d_bits[i] = b_bits[gsm660_bitorder[i]]; } -static void tch_efr_protected(ubit_t *s_bits, ubit_t *b_bits) +static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits) { int i; @@ -1551,7 +1551,7 @@ b_bits[i] = s_bits[gsm0503_gsm_efr_protected_bits[i] - 1]; } -static void tch_fr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_fr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { int i; @@ -1564,7 +1564,7 @@ p[i] = u[91 + i]; } -static void tch_fr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_fr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { int i; @@ -1577,19 +1577,19 @@ u[91 + i] = p[i]; } -static void tch_hr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_hr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { memcpy(d, u, 95); memcpy(p, u + 95, 3); } -static void tch_hr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_hr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { memcpy(u, d, 95); memcpy(u + 95, p, 3); } -static void tch_efr_reorder(ubit_t *w, ubit_t *s, ubit_t *p) +static void tch_efr_reorder(ubit_t *w, const ubit_t *s, const ubit_t *p) { memcpy(w, s, 71); w[71] = w[72] = s[69]; @@ -1603,7 +1603,7 @@ memcpy(w + 252, p, 8); } -static void tch_efr_unreorder(ubit_t *s, ubit_t *p, ubit_t *w) +static void tch_efr_unreorder(ubit_t *s, ubit_t *p, const ubit_t *w) { int sum; @@ -1623,22 +1623,21 @@ memcpy(p, w + 252, 8); } -static void tch_amr_merge(ubit_t *u, ubit_t *d, ubit_t *p, int len, int prot) +static void tch_amr_merge(ubit_t *u, const ubit_t *d, const ubit_t *p, int len, int prot) { memcpy(u, d, prot); memcpy(u + prot, p, 6); memcpy(u + prot + 6, d + prot, len - prot); } -static void tch_amr_unmerge(ubit_t *d, ubit_t *p, - ubit_t *u, int len, int prot) +static void tch_amr_unmerge(ubit_t *d, ubit_t *p, const ubit_t *u, int len, int prot) { memcpy(d, u, prot); memcpy(p, u + prot, 6); memcpy(d + prot, u + prot + 6, len - prot); } -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1703,7 +1702,7 @@ return len; } -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) { ubit_t iB[912], cB[456], h; @@ -1761,7 +1760,7 @@ return 0; } -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1831,7 +1830,7 @@ return 15; } -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len) +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len) { ubit_t iB[912], cB[456], h; ubit_t conv[98], b[112], d[112], p[3]; @@ -1886,7 +1885,7 @@ return 0; } -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2081,7 +2080,7 @@ return len; } -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2241,7 +2240,7 @@ return -1; } -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2444,7 +2443,7 @@ return len; } -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2618,7 +2617,7 @@ return 0; } -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic) +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) { ubit_t conv[14]; int rv; @@ -2636,7 +2635,7 @@ return 0; } -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic) +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) { ubit_t conv[14]; @@ -2654,7 +2653,7 @@ /* * GSM SCH transcoding */ -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst) +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst) { ubit_t conv[35]; int rv; @@ -2670,7 +2669,7 @@ return 0; } -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info) +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info) { ubit_t conv[35]; diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 366eeb4..4dd3076 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -38,7 +38,7 @@ *hn = eB[58]; } -void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, +void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn) { memcpy(eB, iB, 57); @@ -50,7 +50,7 @@ eB[58] = *hn; } -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd) +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd) { int i; @@ -70,7 +70,7 @@ } } -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) { int i; -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 12 11:27:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 11:27:45 +0000 Subject: osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Patch Set 2: Jenkins build is failing because python-smpplib is not installed on the jenkins node. make check works on my workstation. -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da 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 Mon Jun 12 11:34:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 11:34:44 +0000 Subject: [MERGED] osmo-gsm-tester[master]: junit result: also write for aborted runs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: junit result: also write for aborted runs ...................................................................... junit result: also write for aborted runs Even if aborted due to signal, write a JUnit report XML, and make sure to indicate the runs as erratic. Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 --- M src/osmo_gsm_tester/report.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/trial.py 3 files changed, 25 insertions(+), 17 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/report.py b/src/osmo_gsm_tester/report.py index ae63408..82b2f13 100644 --- a/src/osmo_gsm_tester/report.py +++ b/src/osmo_gsm_tester/report.py @@ -38,8 +38,9 @@ testsuite = et.Element('testsuite') testsuite.set('name', suite.name()) testsuite.set('hostname', 'localhost') - testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) - testsuite.set('time', str(math.ceil(suite.duration))) + if suite.start_timestamp: + testsuite.set('timestamp', datetime.fromtimestamp(round(suite.start_timestamp)).isoformat()) + testsuite.set('time', str(math.ceil(suite.duration))) testsuite.set('tests', str(len(suite.tests))) testsuite.set('failures', str(suite.count_test_results()[2])) for test in suite.tests: @@ -60,6 +61,9 @@ if test.fail_tb: system_err = et.SubElement(testcase, 'system-err') system_err.text = test.fail_tb + elif test.status != suite.Test.PASS: + error = et.SubElement(testcase, 'error') + error.text = 'could not run' return testcase def trial_to_text(trial): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 0dd8790..55f81b1 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -161,6 +161,8 @@ trial = None status = None + start_timestamp = None + duration = None resources_pool = None reserved_resources = None objects_to_clean_up = None diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 11f8a15..741f3a7 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -188,21 +188,23 @@ def run_suites(self, names=None): self.status = Trial.UNKNOWN - for suite_run in self.suites: - try: - suite_run.run_tests(names) - except BaseException as e: - # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. - self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) - raise - finally: - if suite_run.status != suite.SuiteRun.PASS: - self.status = Trial.FAIL - if self.status == Trial.UNKNOWN: - self.status = Trial.PASS - junit_path = self.get_run_dir().new_file(self.name()+'.xml') - self.log('Storing JUnit report in', junit_path) - report.trial_to_junit_write(self, junit_path) + try: + for suite_run in self.suites: + try: + suite_run.run_tests(names) + except BaseException as e: + # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. + self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + raise + finally: + if suite_run.status != suite.SuiteRun.PASS: + self.status = Trial.FAIL + if self.status == Trial.UNKNOWN: + self.status = Trial.PASS + finally: + junit_path = self.get_run_dir().new_file(self.name()+'.xml') + self.log('Storing JUnit report in', junit_path) + report.trial_to_junit_write(self, junit_path) def log_report(self): log.large_separator(self.name(), self.status) -- To view, visit https://gerrit.osmocom.org/2854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a334ef3463896c543c0fe592d3903c15e67d4c4 Gerrit-PatchSet: 9 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 Mon Jun 12 11:48:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 11:48:24 +0000 Subject: osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/2884/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 351: msisdn = self.resources_pool.next_msisdn(self) This change was needed, otherwise I get an error with something like "suite has not origin element" https://gerrit.osmocom.org/#/c/2884/2/suites/aoip_smpp/esme_ms_sms.py File suites/aoip_smpp/esme_ms_sms.py: Line 47: # FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) This can be checked/improved later on when extending with more tests. I leave it here as a remembering of tests which can be added later and a show case of the API. -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 2 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: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 11:49:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 11:49:15 +0000 Subject: [PATCH] openbsc[master]: OML: fix potential OOB memory access Message-ID: Review at https://gerrit.osmocom.org/2885 OML: fix potential OOB memory access Use sizeof target BTS feature storage to make sure we always fit into pre-allocated memory. Also use it for log check. Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Fixes: CID 170581 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/2885/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 551c0bf..1715688 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -490,13 +490,13 @@ m_id_len = MAX_BTS_FEATURES/8; } - if (m_id_len > _NUM_BTS_FEAT/8 + 1) + if (m_id_len > sizeof(bts->_features_data)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " "feature vector - most likely it was compiled against newer BSC headers. " "Consider upgrading your BSC to later version.\n", bts->nr, m_id_len); - memcpy(bts->_features_data, TLVP_VAL(&tp, NM_ATT_MANUF_ID), m_id_len); + memcpy(bts->_features_data, TLVP_VAL(&tp, NM_ATT_MANUF_ID), sizeof(bts->_features_data)); adjust = m_id_len + 3; /* adjust for parsed TL16V struct */ for (i = 0; i < _NUM_BTS_FEAT; i++) -- To view, visit https://gerrit.osmocom.org/2885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 12 11:58:56 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 12 Jun 2017 11:58:56 +0000 Subject: libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 12:05:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 12:05:11 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify Message-ID: Review at https://gerrit.osmocom.org/2886 fix and refactor logging: drop 'with', simplify With the recent fix of the junit report related issues, another issue arose: the 'with log.Origin' was changed to disallow __enter__ing an object twice to fix problems, now still code would fail because it tries to do 'with' on the same object twice. The only reason is to ensure that logging is associated with a given object. Instead of complicating even more, implement differently. Refactor logging to simplify use: drop the 'with Origin' style completely, and instead use the python stack to determine which objects are created by which, and which object to associate a log statement with. The new way: we rely on the convention that each class instance has a local 'self' referencing the object instance. If we need to find an origin as a new object's parent, or to associate a log message with, we traverse each stack frame, fetching the first local 'self' object that is a log.Origin class instance. How to use: Simply call log.log() anywhere, and it finds an Origin object to log for, from the stack. Alternatively call self.log() for any Origin() object to skip the lookup. Create classes as child class of log.Origin and make sure to call super().__init__(category, name). This constructor will magically find a parent Origin on the stack. When an exception happens, we first escalate the exception up through call scopes to where ever it is handled by log.log_exn(). This then finds an Origin object in the traceback's stack frames, no need to nest in 'with' scopes. Hence the 'with log.Origin' now "happens implicitly", we can write pure natural python code, no more hassles with scope ordering. Furthermore, any frame can place additional string information in a local variable called log_ctx. This is automatically inserted in the ancestry associated with a log statement / exception. Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py 20 files changed, 328 insertions(+), 381 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/2886/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 0083512..7d12c85 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -36,10 +36,9 @@ CONF_BTS_TRX = 'osmo-bts-trx.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX) self.suite_run = suite_run self.conf = conf - self.set_name(OsmoBtsTrx.BIN_BTS_TRX) - self.set_log_category(log.C_RUN) self.env = {} def remote_addr(self): diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 5f2b3cb..a771ec4 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -35,52 +35,50 @@ BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, self.BTS_SYSMO_BIN) self.suite_run = suite_run self.conf = conf - self.set_name('osmo-bts-sysmo') - self.set_log_category(log.C_RUN) self.remote_env = {} self.remote_user = 'root' def start(self): - with self: - if self.bsc is None: - raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') - self.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) - self.configure() + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') + log.log('Starting sysmoBTS to connect to', self.bsc) + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) - lib = self.inst.child('lib') - if not os.path.isdir(lib): - self.raise_exn('No lib/ in', self.inst) - if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): - self.raise_exn('No osmo-bts-sysmo binary in', self.inst) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) + lib = self.inst.child('lib') + if not os.path.isdir(lib): + raise log.Error('No lib/ in', self.inst) + if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): + raise log.Error('No osmo-bts-sysmo binary in', self.inst) - self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) - self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) + self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) + self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) - self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) - self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) - self.run_local('scp-inst-to-sysmobts', - ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) + self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) + self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) + self.run_local('scp-inst-to-sysmobts', + ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) - remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) - self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) + remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) + self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) - remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) - self.run_local('scp-cfg-to-sysmobts', - ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) + remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) + self.run_local('scp-cfg-to-sysmobts', + ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) - self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) + self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) - remote_lib = self.remote_inst.child('lib') - remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') - self.launch_remote('osmo-bts-sysmo', - ('LD_LIBRARY_PATH=%s' % remote_lib, - remote_binary, '-c', remote_config_file, '-r', '1', - '-i', self.bsc.addr()), - remote_cwd=remote_run_dir) + remote_lib = self.remote_inst.child('lib') + remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') + self.launch_remote('osmo-bts-sysmo', + ('LD_LIBRARY_PATH=%s' % remote_lib, + remote_binary, '-c', remote_config_file, '-r', '1', + '-i', self.bsc.addr()), + remote_cwd=remote_run_dir) def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) @@ -92,7 +90,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log_ctx = proc + raise log.Error('Exited in error') def launch_remote(self, name, popen_args, remote_cwd=None): proc = self._process_remote(name, popen_args, remote_cwd) @@ -105,7 +104,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log_ctx = proc + raise log.Error('Exited in error') def remote_addr(self): return self.conf.get('addr') diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 38d8e2f..1efd957 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -95,7 +95,7 @@ real_l = os.path.realpath(l) p = os.path.realpath(os.path.join(real_l, basename)) if os.path.isfile(p): - log.dbg(None, log.C_CNF, 'Found config file', basename, 'as', p, 'in', l, 'which is', real_l) + log.dbg('Found config file', basename, 'as', p, 'in', l, 'which is', real_l, _category=log.C_CNF) return (p, real_l) if not fail_if_missing: return None, None @@ -122,7 +122,7 @@ env_path = os.getenv(env_name) if env_path: real_env_path = os.path.realpath(env_path) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path) + log.dbg('Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path, _category=log.C_CNF) return real_env_path if PATHS is None: @@ -132,15 +132,15 @@ for key, path in sorted(PATHS.items()): if not path.startswith(os.pathsep): PATHS[key] = os.path.realpath(os.path.join(found_in, path)) - log.dbg(None, log.C_CNF, paths_file + ': relative path', path, 'is', PATHS[key]) + log.dbg(paths_file + ': relative path', path, 'is', PATHS[key], _category=log.C_CNF) p = PATHS.get(label) if p is None and not allow_unset: raise RuntimeError('missing configuration in %s: %r' % (PATHS_CONF, label)) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', p) + log.dbg('Found path', label, 'as', p, _category=log.C_CNF) if p.startswith(PATHS_TEMPDIR_STR): p = os.path.join(get_tempdir(), p[len(PATHS_TEMPDIR_STR):]) - log.dbg(None, log.C_CNF, 'Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p) + log.dbg('Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p, _category=log.C_CNF) return p def get_state_dir(): @@ -153,20 +153,20 @@ return Dir(get_configured_path(PATH_SCENARIOS_DIR)) def read(path, validation_schema=None, if_missing_return=False): - with log.Origin(path): - if not os.path.isfile(path) and if_missing_return is not False: - return if_missing_return - with open(path, 'r') as f: - config = yaml.safe_load(f) - config = _standardize(config) - if validation_schema: - schema.validate(config, validation_schema) - return config + log_ctx = path + if not os.path.isfile(path) and if_missing_return is not False: + return if_missing_return + with open(path, 'r') as f: + config = yaml.safe_load(f) + config = _standardize(config) + if validation_schema: + schema.validate(config, validation_schema) + return config def write(path, config): - with log.Origin(path): - with open(path, 'w') as f: - f.write(tostr(config)) + log_ctx = path + with open(path, 'w') as f: + f.write(tostr(config)) def tostr(config): return _tostr(_standardize(config)) @@ -191,8 +191,7 @@ class Scenario(log.Origin, dict): def __init__(self, name, path): - self.set_name(name) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, name) self.path = path def get_scenario(name, validation_schema=None): @@ -216,8 +215,8 @@ if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - add(dest_val, val) + log_ctx = 'key=%r' % key + add(dest_val, val) return if is_list(dest): if not is_list(src): @@ -235,19 +234,19 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log_ctx = 'key=%r' % key dest_val = dest.get(key) if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - combine(dest_val, val) + combine(dest_val, val) return 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)): - with log.Origin(idx=i): - combine(dest[i], src[i]) + log_ctx = 'idx=%r' % i + combine(dest[i], src[i]) return if dest == src: return @@ -260,16 +259,16 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log_ctx = 'key=%r' % key dest_val = dest.get(key) - with log.Origin(key=key): - dest[key] = overlay(dest_val, val) + dest[key] = overlay(dest_val, val) return dest 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)): - with log.Origin(idx=i): - dest[i] = overlay(dest[i], src[i]) + log_ctx = 'key=%r' % key + dest[i] = overlay(dest[i], src[i]) return dest return src diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index c3c679b..fbf4bad 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -21,6 +21,8 @@ # A test script can thus establish its context by doing: # from osmo_gsm_tester.test import * import time +from . import log + poll_funcs = [] def register_poll_func(func): @@ -38,7 +40,8 @@ def wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): if not timeout or timeout < 0: - log_obj.raise_exn('wait() *must* time out at some point. timeout=%r' % timeout) + self = log_obj + raise log.Error('wait() *must* time out at some point.', timeout=timeout) if timestep < 0.1: timestep = 0.1 @@ -54,7 +57,8 @@ def wait(log_obj, condition, *condition_args, timeout=300, timestep=1, **condition_kwargs): if not wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): - log_obj.raise_exn('Wait timeout') + log_ctx = log_obj + raise log.Error('Wait timeout') def sleep(log_obj, seconds): assert seconds > 0. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index f098f2b..3ac8ccd 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -45,6 +45,37 @@ C_BUS = 'bus' C_DEFAULT = '---' +def dbg(*messages, _origin=None, _category=None, **named_items): + '''Log on debug level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_DBG) + +def log(*messages, _origin=None, _category=None, _level=L_LOG, **named_items): + '''Log a message. The origin, an Origin class instance, is normally + determined by stack magic, only pass _origin to override. The category is + taken from the origin. The log message is composed of all *messages and + **named_items, for example: + log('frobnicate:', thing, key=current_key, prop=erty) + ''' + _log(messages, named_items, origin=_origin, category=_category, level=_level) + +def err(*messages, _origin=None, _category=None, **named_items): + '''Log on error level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_ERR) + +def _log(messages=[], named_items={}, origin=None, category=None, level=L_LOG, src=None): + if origin is None: + origin = Origin.find_on_stack() + if category is None and isinstance(origin, Origin): + category = origin._log_category + if src is None: + # two levels up + src = 2 + if isinstance(src, int): + src = get_src_from_caller(src + 1) + for target in LogTarget.all_targets: + target.log(origin, category, level, src, messages, named_items) + + LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' DATEFMT = '%H:%M:%S' @@ -52,7 +83,8 @@ get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) class Error(Exception): - pass + def __init__(self, *messages, **named_items): + super().__init__(compose_message(messages, named_items)) class LogTarget: all_targets = [] @@ -153,7 +185,7 @@ def log(self, origin, category, level, src, messages, named_items): if category and len(category) != 3: - self.log_write_func('WARNING: INVALID LOG SUBSYSTEM %r\n' % category) + self.log_write_func('WARNING: INVALID LOGGING CATEGORY %r\n' % category) self.log_write_func('origin=%r category=%r level=%r\n' % (origin, category, level)); if not category: @@ -172,14 +204,11 @@ if self.do_log_origin: if origin is None: name = '-' - elif isinstance(origin, Origins): - name = origin[-1] - if len(origin) > 1: - deeper_origins = str(origin) + elif isinstance(origin, Origin): + name = origin.name() + deeper_origins = origin.ancestry_str() elif isinstance(origin, str): name = origin or None - elif hasattr(origin, 'name'): - name = origin.name() if not name: name = str(origin.__class__.__name__) log_pre.append(self.origin_fmt.format(name)) @@ -228,7 +257,7 @@ def _log_all_targets(origin, category, level, src, messages, named_items=None): if origin is None: - origin = Origin._global_current_origin + origin = Origin.find_on_stack() if isinstance(src, int): src = get_src_from_caller(src + 1) for target in LogTarget.all_targets: @@ -242,13 +271,15 @@ caller = getframeinfo(stack()[levels_up][0]) return '%s:%d' % (os.path.basename(caller.filename), caller.lineno) -def get_src_from_tb(tb, levels_up=1): - ftb = traceback.extract_tb(tb) +def get_src_from_exc_info(exc_info, levels_up=1): + ftb = traceback.extract_tb(exc_info[2]) f,l,m,c = ftb[-levels_up] f = os.path.basename(f) return '%s:%s: %s' % (f, l, c) def get_line_for_src(src_path): + '''find a given source file on the stack and return the line number for + that file. (Used to indicate the position in a test script.)''' etype, exception, tb = sys.exc_info() if tb: ftb = traceback.extract_tb(tb) @@ -265,28 +296,71 @@ class Origin: ''' - Base class for all classes that want to log, - and to add an origin string to a code path: - with log.Origin('my name'): - raise Problem() - This will log 'my name' as an origin for the Problem. + Base class for all classes that want to appear in the log. + It is a simple named marker to find in the stack frames. + This depends on the object instance named 'self' in each member class. + + In addition, it provides a logging category and a globally unique ID for + each instance. ''' - _global_current_origin = None _global_id = None - _log_category = None - _src = None _name = None _origin_id = None - + _log_category = None _parent_origin = None - def __init__(self, *name_items, category=None, **detail_items): - self.set_log_category(category) - self.set_name(*name_items, **detail_items) + @staticmethod + def find_on_stack(except_obj=None, f=None): + if f is None: + f = sys._getframe(1) + log_ctx_obj = None + origin = None + while f is not None: + l = f.f_locals - def set_name(self, *name_items, **detail_items): + # if there is a log_ctx in the scope, add it, pointing to the next + # actual Origin class in the stack + log_ctx = l.get('log_ctx') + if log_ctx: + if isinstance(log_ctx, Origin): + new_log_ctx_obj = log_ctx + else: + new_log_ctx_obj = Origin(None, log_ctx, find_parent=False) + if log_ctx_obj is None: + log_ctx_obj = new_log_ctx_obj + else: + log_ctx_obj.highest_ancestor()._parent_origin = new_log_ctx_obj + + obj = l.get('self') + if obj and isinstance(obj, Origin) and (except_obj is not obj): + origin = obj + break + f = f.f_back + + if (origin is not None) and (log_ctx_obj is not None): + log_ctx_obj.highest_ancestor()._parent_origin = origin + if log_ctx_obj is not None: + return log_ctx_obj + # may return None + return origin + + @staticmethod + def find_in_exc_info(exc_info): + tb = exc_info[2] + # get last tb ... I hope that's right + while tb.tb_next: + tb = tb.tb_next + return Origin.find_on_stack(f=tb.tb_frame) + + def __init__(self, category, *name_items, find_parent=True, **detail_items): + self._set_log_category(category) + self._set_name(*name_items, **detail_items) + if find_parent: + self._parent_origin = Origin.find_on_stack(except_obj=self) + + def _set_name(self, *name_items, **detail_items): if name_items: name = '-'.join([str(i) for i in name_items]) elif not detail_items: @@ -313,87 +387,43 @@ self._origin_id = '%s-%s' % (self.name(), Origin._global_id) return self._origin_id - def set_log_category(self, category): + def _set_log_category(self, category): self._log_category = category - - def _log(self, level, messages, named_items=None, src_levels_up=3, origins=None): - src = self._src or src_levels_up - origin = origins or self.gather_origins() - _log_all_targets(origin, self._log_category, level, src, messages, named_items) - - def dbg(self, *messages, **named_items): - self._log(L_DBG, messages, named_items) - - def log(self, *messages, **named_items): - self._log(L_LOG, messages, named_items) - - def err(self, *messages, **named_items): - self._log(L_ERR, messages, named_items) - - def trace(self, *messages, **named_items): - self._log(L_TRACEBACK, messages, named_items) - - def log_exn(self, exc_info=None): - log_exn(self, self._log_category, exc_info) - - def __enter__(self): - if not self.set_child_of(Origin._global_current_origin): - return self - Origin._global_current_origin = self - return self - - def __exit__(self, *exc_info): - rc = None - if exc_info[0] is not None: - rc = exn_add_info(exc_info, self) - Origin._global_current_origin, self._parent_origin = self._parent_origin, None - return rc - - def raise_exn(self, *messages, exn_class=Error, **named_items): - with self: - raise exn_class(compose_message(messages, named_items)) def redirect_stdout(self): return contextlib.redirect_stdout(SafeRedirectStdout(self)) - def gather_origins(self): - origins = Origins() - # this object shall always be seen as the immediate origin of the log message. - origins.add(self) - # now go through the parents of this object. - origin = self._parent_origin - # but if this object is "loose" and not set up with cascaded 'with' statements, - # take the last seen 'with' statement's object as next parent: - if origin is None and Origin._global_current_origin is not None: - origin = Origin._global_current_origin - # if this object is currently the _global_current_origin, we don't - # need to add it twice. - if origin is self: - origin = origin._parent_origin - # whichever we determined to be the parent above, go up through all its - # ancestors. - while origin is not None: - origins.add(origin) + def ancestry(self): + origins = [] + n = 10 + origin = self + while origin: + origins.insert(0, origin) origin = origin._parent_origin + n -= 1 + if n < 0: + break return origins - def set_child_of(self, parent_origin): - # avoid loops - assert self._parent_origin is None - assert parent_origin is not self - self._parent_origin = parent_origin - return True + def ancestry_str(self): + return '?'.join([o.name() for o in self.ancestry()]) -class LineInfo(Origin): - def __init__(self, src_file, *name_items, **detail_items): - self.src_file = src_file - self.set_name(*name_items, **detail_items) + def highest_ancestor(self): + if self._parent_origin: + return self._parent_origin.highest_ancestor() + return self - def name(self): - l = get_line_for_src(self.src_file) - if l is not None: - return '%s:%s' % (self._name, l) - return super().name() + def log(self, *messages, **named_items): + '''same as log.log() but passes this object to skip looking up an origin''' + log(*messages, _origin=self, **named_items) + + def dbg(self, *messages, **named_items): + '''same as log.dbg() but passes this object to skip looking up an origin''' + dbg(*messages, _origin=self, **named_items) + + def err(self, *messages, **named_items): + '''same as log.err() but passes this object to skip looking up an origin''' + err(*messages, _origin=self, **named_items) class SafeRedirectStdout: ''' @@ -407,7 +437,7 @@ _log_line_buf = None def __init__(self, origin): - self._origin = origin + self.origin = origin def write(self, message): lines = message.splitlines() @@ -419,93 +449,34 @@ if not message.endswith('\n'): self._log_line_buf = lines[-1] lines = lines[:-1] - origins = self._origin.gather_origins() for line in lines: - self._origin._log(L_LOG, (line,), origins=origins) + _log(messages=(line,), + origin=self.origin, level=L_LOG, src=3) def __getattr__(self, name): return sys.__stdout__.__getattribute__(name) - -def dbg(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_DBG, 2, messages, named_items) - -def log(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_LOG, 2, messages, named_items) - -def err(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_ERR, 2, messages, named_items) - -def trace(origin, category, exc_info): - _log_all_targets(origin, category, L_TRACEBACK, None, - traceback.format_exception(*exc_info)) - -def resolve_category(origin, category): - if category is not None: - return category - if not hasattr(origin, '_log_category'): - return None - return origin._log_category - -def exn_add_info(exc_info, origin, category=None): - etype, exception, tb = exc_info - if not hasattr(exception, 'origins'): - exception.origins = Origins() - if not hasattr(exception, 'category'): - # only remember the deepest category - exception.category = resolve_category(origin, category) - if not hasattr(exception, 'src'): - exception.src = get_src_from_tb(tb) - exception.origins.add(origin) - return False - -def log_exn(origin=None, category=None, exc_info=None): - if not (exc_info is not None and len(exc_info) == 3): +def trace(exc_info=None, origin=None): + if exc_info is None: exc_info = sys.exc_info() - if not (exc_info is not None and len(exc_info) == 3): - raise RuntimeError('invalid call to log_exn() -- no valid exception info') + if origin is None: + origin = Origin.find_in_exc_info(exc_info) + _log(messages=traceback.format_exception(*exc_info), + origin=origin, level=L_TRACEBACK) + +def log_exn(): + exc_info = sys.exc_info() + origin = Origin.find_in_exc_info(exc_info) etype, exception, tb = exc_info - - # if there are origins recorded with the Exception, prefer that - if hasattr(exception, 'origins'): - origin = exception.origins - - # if there is a category recorded with the Exception, prefer that - if hasattr(exception, 'category'): - category = exception.category - if hasattr(exception, 'msg'): msg = exception.msg else: msg = str(exception) - if hasattr(exception, 'src'): - src = exception.src - else: - src = 2 - - trace(origin, category, exc_info) - _log_all_targets(origin, category, L_ERR, src, - ('%s:' % str(etype.__name__), msg)) - - -class Origins(list): - def __init__(self, origin=None): - if origin is not None: - self.add(origin) - - def add(self, origin): - if hasattr(origin, 'name'): - origin_str = origin.name() - else: - origin_str = repr(origin) - if origin_str is None: - raise RuntimeError('origin_str is None for %r' % origin) - self.insert(0, origin_str) - - def __str__(self): - return '?'.join(self) + trace(exc_info, origin=origin) + _log(messages=('%s:' % str(etype.__name__), msg), + origin=origin, level=L_ERR, src=get_src_from_exc_info(exc_info)) def set_all_levels(level): diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 83f3e0d..7a5682c 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -82,12 +82,14 @@ Related: https://github.com/LEW21/pydbus/issues/56 ''' + modem_path = None + watch_props_subscription = None + _dbus_obj = None + interfaces = None + def __init__(self, modem_path): self.modem_path = modem_path - self.set_name(self.modem_path) - self.set_log_category(log.C_BUS) - self.watch_props_subscription = None - self._dbus_obj = None + super().__init__(log.C_BUS, self.modem_path) self.interfaces = set() # A dict listing signal handlers to connect, e.g. @@ -118,7 +120,7 @@ try: return self.dbus_obj()[interface_name] except KeyError: - self.raise_exn('Modem interface is not available:', interface_name) + raise RuntimeError('Modem interface is not available:', interface_name) def signal(self, interface_name, signal): return getattr(self.interface(interface_name), signal) @@ -253,8 +255,7 @@ def __init__(self, conf): self.conf = conf self.path = conf.get('path') - self.set_name(self.path) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, self.path) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.dbus.required_signals = { @@ -312,8 +313,7 @@ def imsi(self): imsi = self.conf.get('imsi') if not imsi: - with self: - raise RuntimeError('No IMSI') + raise RuntimeError('No IMSI') return imsi def ki(self): diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 7753395..5447118 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -31,10 +31,9 @@ bts = None def __init__(self, suite_run, msc, ip_address): + super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-bsc_%s' % ip_address.get('addr')) self.bts = [] self.msc = msc diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 0b717fa..b5a947f 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -29,8 +29,7 @@ class OsmoCtrl(log.Origin): def __init__(self, host, port): - self.set_name('Ctrl', host=host, port=port) - self.set_log_category(log.C_BUS) + super().__init__(log.C_BUS, 'Ctrl', host=host, port=port) self.host = host self.port = port self.sck = None @@ -79,12 +78,10 @@ self._send(getmsg) def __enter__(self): - super().__enter__() self.connect() return self def __exit__(self, *exc_info): self.disconnect() - super().__exit__(*exc_info) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 3492f06..14505db 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -32,10 +32,9 @@ next_subscriber_id = 1 def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-hlr_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -47,16 +46,16 @@ binary = inst.child('bin', 'osmo-hlr') if not os.path.isfile(binary): - self.raise_exn('Binary missing:', binary) + raise log.Error('Binary missing:', binary) lib = inst.child('lib') if not os.path.isdir(lib): - self.raise_exn('No lib/ in', inst) + raise log.Error('No lib/ in', inst) # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') if not os.path.isfile(sql_input): - self.raise_exn('hlr.sql missing:', sql_input) + raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) iface = util.ip_to_iface(self.addr()) @@ -96,13 +95,13 @@ return not self.process.terminated() def run_local(self, name, popen_args): - with self: - run_dir = self.run_dir.new_dir(name) - proc = process.Process(name, run_dir, popen_args) - proc.launch() - proc.wait() - if proc.result != 0: - proc.raise_exn('Exited in error') + run_dir = self.run_dir.new_dir(name) + proc = process.Process(name, run_dir, popen_args) + proc.launch() + proc.wait() + if proc.result != 0: + log_ctx = proc + raise log.Error('Exited in error') def run_sql_file(self, name, sql_file): self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 3e722fb..b385274 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -30,10 +30,9 @@ process = None def __init__(self, suite_run, ip_address, bts_ip): + super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-mgcpgw_%s' % ip_address.get('addr')) # hack: so far mgcpgw needs one specific BTS IP. self.bts_ip = bts_ip diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2ef88df..829e20a 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -31,10 +31,9 @@ hlr = None def __init__(self, suite_run, hlr, mgcpgw, 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.set_log_category(log.C_RUN) - self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw @@ -89,12 +88,11 @@ def imsi_attached(self, *imsis): attached = self.imsi_list_attached() - self.dbg('attached:', attached) + log.dbg('attached:', attached) return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoMscCtrl(self).subscriber_list_active() + return OsmoMscCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -106,8 +104,7 @@ def __init__(self, msc): self.msc = msc - self.set_name('CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) - self.set_child_of(msc) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.msc.addr(), self.PORT) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..535f73a 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -32,10 +32,9 @@ bts = None def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -96,8 +95,7 @@ msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - with self: - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -108,8 +106,7 @@ return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoNitbCtrl(self).subscriber_list_active() + return OsmoNitbCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -123,8 +120,7 @@ def __init__(self, nitb): self.nitb = nitb - self.set_name('CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) - self.set_child_of(nitb) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.nitb.addr(), OsmoNitbCtrl.PORT) diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index f3b1e6a..398ec6c 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -27,14 +27,13 @@ class PcapRecorder(log.Origin): def __init__(self, suite_run, run_dir, iface=None, filters=''): - self.suite_run = suite_run - self.run_dir = run_dir self.iface = iface if not self.iface: self.iface = "any" self.filters = filters - self.set_log_category(log.C_RUN) - self.set_name('pcap-recorder_%s' % self.iface) + super().__init__(log.C_RUN, 'pcap-recorder_%s' % self.iface, filters=self.filters) + self.suite_run = suite_run + self.run_dir = run_dir self.start() def start(self): diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e5d38f3..99e94ba 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -33,9 +33,8 @@ killed = None def __init__(self, name, run_dir, popen_args, **popen_kwargs): + super().__init__(log.C_RUN, name) self.name_str = name - self.set_name(name) - self.set_log_category(log.C_RUN) self.run_dir = run_dir self.popen_args = popen_args self.popen_kwargs = popen_kwargs @@ -62,23 +61,21 @@ return f def launch(self): - with self: + log.dbg('cd %r; %s %s' % ( + os.path.abspath(str(self.run_dir)), + ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), + ' '.join(self.popen_args))) - self.dbg('cd %r; %s %s' % ( - os.path.abspath(str(self.run_dir)), - ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), - ' '.join(self.popen_args))) - - self.process_obj = subprocess.Popen( - self.popen_args, - stdout=self.make_output_log('stdout'), - stderr=self.make_output_log('stderr'), - stdin=subprocess.PIPE, - shell=False, - cwd=self.run_dir.path, - **self.popen_kwargs) - self.set_name(self.name_str, pid=self.process_obj.pid) - self.log('Launched') + self.process_obj = subprocess.Popen( + self.popen_args, + stdout=self.make_output_log('stdout'), + stderr=self.make_output_log('stderr'), + stdin=subprocess.PIPE, + shell=False, + cwd=self.run_dir.path, + **self.popen_kwargs) + self._set_name(self.name_str, pid=self.process_obj.pid) + self.log('Launched') def _poll_termination(self, time_to_wait_for_term=5): wait_step = 0.001 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7cc32bb..a67ce0f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -83,7 +83,7 @@ def __init__(self): self.config_path = config.get_config_file(RESOURCES_CONF) self.state_dir = config.get_state_dir() - self.set_name(conf=self.config_path, state=self.state_dir.path) + super().__init__(log.C_CNF, conf=self.config_path, state=self.state_dir.path) self.read_conf() def read_conf(self): @@ -158,6 +158,7 @@ return ReservedResources(self, origin, to_be_reserved) def free(self, origin, to_be_freed): + log_ctx = origin with self.state_dir.lock(origin.origin_id()): rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE) reserved = Resources(config.read(rrfile_path, if_missing_return={})) @@ -202,19 +203,19 @@ with self.state_dir.lock(origin_id): msisdn_path = self.state_dir.child(LAST_USED_MSISDN_FILE) - with log.Origin(msisdn_path): - last_msisdn = '1000' - if os.path.exists(msisdn_path): - if not os.path.isfile(msisdn_path): - raise RuntimeError('path should be a file but is not: %r' % msisdn_path) - with open(msisdn_path, 'r') as f: - last_msisdn = f.read().strip() - schema.msisdn(last_msisdn) + log_ctx = msisdn_path + last_msisdn = '1000' + if os.path.exists(msisdn_path): + if not os.path.isfile(msisdn_path): + raise RuntimeError('path should be a file but is not: %r' % msisdn_path) + with open(msisdn_path, 'r') as f: + last_msisdn = f.read().strip() + schema.msisdn(last_msisdn) - next_msisdn = util.msisdn_inc(last_msisdn) - with open(msisdn_path, 'w') as f: - f.write(next_msisdn) - return next_msisdn + next_msisdn = util.msisdn_inc(last_msisdn) + with open(msisdn_path, 'w') as f: + f.write(next_msisdn) + return next_msisdn class NoResourceExn(Exception): diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index fb27f32..00facc4 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -124,9 +124,9 @@ validate_item(path, list_v, schema) return - with log.Origin(item=path): - type_validator = SCHEMA_TYPES.get(want_type) - type_validator(value) + log_ctx = path + type_validator = SCHEMA_TYPES.get(want_type) + type_validator(value) def nest(parent_path, config, schema): if parent_path: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 55f81b1..1157b6a 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -49,9 +49,8 @@ def __init__(self, suite_dir): - self.set_log_category(log.C_CNF) self.suite_dir = suite_dir - self.set_name(os.path.basename(self.suite_dir)) + super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) self.read_conf() def read_conf(self): @@ -78,12 +77,10 @@ FAIL = 'FAIL' def __init__(self, suite_run, test_basename): - self.suite_run = suite_run self.basename = test_basename + super().__init__(log.C_TST, self.basename) + self.suite_run = suite_run self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) - super().__init__(self.path) - self.set_name(self.basename) - self.set_log_category(log.C_TST) self.status = Test.UNKNOWN self.start_timestamp = 0 self.duration = 0 @@ -92,16 +89,15 @@ def run(self): try: - with self: - log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() except Exception as e: if hasattr(e, 'msg'): msg = e.msg @@ -142,7 +138,7 @@ self.fail_tb = tb_str self.err('%s: %s' % (self.fail_type, self.fail_message)) if self.fail_tb: - self.trace(self.fail_tb) + self.log(self.fail_tb, _level=log.L_TRACEBACK) self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): @@ -171,11 +167,10 @@ _processes = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + super().__init__(log.C_TST, suite_scenario_str) self.trial = trial self.definition = suite_definition self.scenarios = scenarios - self.set_name(suite_scenario_str) - self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() @@ -201,18 +196,18 @@ self.status = SuiteRun.UNKNOWN def combined(self, conf_name): - self.dbg(combining=conf_name) - with log.Origin(combining_scenarios=conf_name): - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) - self.dbg(definition_conf=combination) - for scenario in self.scenarios: - with scenario: - c = scenario.get(conf_name) - self.dbg(scenario=scenario.name(), conf=c) - if c is None: - continue - config.combine(combination, c) - return combination + log.dbg(combining=conf_name) + log_ctx = 'combining_scenarios=%r' % conf_name + combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + self.dbg(definition_conf=combination) + for scenario in self.scenarios: + log_ctx = '{combining_scenarios=%r, %s}' % (conf_name, scenario.name()) + c = scenario.get(conf_name) + self.dbg(scenario=scenario.name(), conf=c) + if c is None: + continue + config.combine(combination, c) + return combination def resource_requirements(self): if self._resource_requirements is None: @@ -232,17 +227,16 @@ def run_tests(self, names=None): try: - with self: - log.large_separator(self.trial.name(), self.name(), sublevel=2) - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.tests: - if names and not test.name() in names: - test.set_skip() - continue - test.run() + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() except Exception: self.log_exn() except BaseException as e: @@ -355,7 +349,8 @@ if process.terminated(): process.log_stdout_tail() process.log_stderr_tail() - process.raise_exn('Process ended prematurely') + log_ctx = process + raise log.Error('Process ended prematurely') def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index 33ce2f6..4d8ed2a 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -26,7 +26,7 @@ from .util import dict2obj _lookup = None -_logger = log.Origin('no templates dir set') +_logger = log.Origin(log.C_CNF, 'no templates dir set') def set_templates_dir(*templates_dirs): global _lookup @@ -39,7 +39,7 @@ raise RuntimeError('templates dir is not a dir: %r' % os.path.abspath(d)) _lookup = TemplateLookup(directories=templates_dirs) - _logger = log.Origin('Templates', category=log.C_CNF) + _logger = log.Origin(log.C_CNF, 'Templates') def render(name, values): '''feed values dict into template and return rendered result. @@ -48,11 +48,11 @@ if _lookup is None: set_templates_dir() tmpl_name = name + '.tmpl' - with log.Origin(tmpl_name): - template = _lookup.get_template(tmpl_name) - _logger.dbg('rendering', tmpl_name) + log_ctx = tmpl_name + template = _lookup.get_template(tmpl_name) + _logger.dbg('rendering', tmpl_name) - line_info_name = tmpl_name.replace('-', '_').replace('.', '_') - return template.render(**dict2obj(values)) + line_info_name = tmpl_name.replace('-', '_').replace('.', '_') + return template.render(**dict2obj(values)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..679ba96 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -24,9 +24,6 @@ suite = None test = None resources = None -log = None -dbg = None -err = None wait = None wait_no_raise = None sleep = None @@ -40,9 +37,6 @@ suite = suite_run test = _test resources = suite_run.reserved_resources - log = test.log - dbg = test.dbg - err = test.err wait = lambda *args, **kwargs: event_module.wait(suite_run, *args, **kwargs) wait_no_raise = lambda *args, **kwargs: event_module.wait_no_raise(suite_run, *args, **kwargs) sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 741f3a7..d54e96c 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -57,8 +57,7 @@ def __init__(self, trial_dir): self.path = os.path.abspath(trial_dir) - self.set_name(os.path.basename(self.path)) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, os.path.basename(self.path)) self.dir = util.Dir(self.path) self.inst_dir = util.Dir(self.dir.child('inst')) self.bin_tars = [] @@ -69,7 +68,8 @@ return self.name() def __enter__(self): - # add a log target to log to the run dir + '''add a log target to log to the run dir, write taken marker, log a + starting separator.''' run_dir = self.get_run_dir() detailed_log = run_dir.new_child(FILE_LOG) self.log_targets = [ @@ -82,11 +82,10 @@ log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() - super().__enter__() return self def __exit__(self, *exc_info): - super().__exit__(*exc_info) + '''log a report, then remove log file targets for this trial''' self.log_report() for lt in self.log_targets: lt.remove() @@ -195,6 +194,8 @@ except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + # log the traceback before the trial's logging is ended + log.log_exn() raise finally: if suite_run.status != suite.SuiteRun.PASS: -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 12 12:05:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 12:05:11 +0000 Subject: [PATCH] osmo-gsm-tester[master]: log.Origin: ensure to avoid parent loops Message-ID: Review at https://gerrit.osmocom.org/2887 log.Origin: ensure to avoid parent loops Change-Id: I10a2f956beeda38ba1378eace9453eb911aae1a7 --- M src/osmo_gsm_tester/log.py 1 file changed, 16 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/87/2887/1 diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index 3ac8ccd..e8dd3d8 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -309,7 +309,7 @@ _name = None _origin_id = None _log_category = None - _parent_origin = None + _parent = None @staticmethod def find_on_stack(except_obj=None, f=None): @@ -331,7 +331,7 @@ if log_ctx_obj is None: log_ctx_obj = new_log_ctx_obj else: - log_ctx_obj.highest_ancestor()._parent_origin = new_log_ctx_obj + log_ctx_obj.highest_ancestor()._set_parent(new_log_ctx_obj) obj = l.get('self') if obj and isinstance(obj, Origin) and (except_obj is not obj): @@ -340,7 +340,7 @@ f = f.f_back if (origin is not None) and (log_ctx_obj is not None): - log_ctx_obj.highest_ancestor()._parent_origin = origin + log_ctx_obj.highest_ancestor()._set_parent(origin) if log_ctx_obj is not None: return log_ctx_obj # may return None @@ -358,7 +358,16 @@ self._set_log_category(category) self._set_name(*name_items, **detail_items) if find_parent: - self._parent_origin = Origin.find_on_stack(except_obj=self) + self._set_parent(Origin.find_on_stack(except_obj=self)) + + def _set_parent(self, parent): + # make sure to avoid loops + p = parent + while p: + if p is self: + raise RuntimeError('Origin parent loop') + p = p._parent + self._parent = parent def _set_name(self, *name_items, **detail_items): if name_items: @@ -399,7 +408,7 @@ origin = self while origin: origins.insert(0, origin) - origin = origin._parent_origin + origin = origin._parent n -= 1 if n < 0: break @@ -409,8 +418,8 @@ return '?'.join([o.name() for o in self.ancestry()]) def highest_ancestor(self): - if self._parent_origin: - return self._parent_origin.highest_ancestor() + if self._parent: + return self._parent.highest_ancestor() return self def log(self, *messages, **named_items): -- To view, visit https://gerrit.osmocom.org/2887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10a2f956beeda38ba1378eace9453eb911aae1a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 12 13:28:15 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Mon, 12 Jun 2017 13:28:15 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: Unfortunately I can't seem to install it, no. I have updated the patch to include the requirements for python2(.7) in the debian package. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 13:30:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 13:30:19 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: > I can't seem to install it That itself seems like much bigger issue which we have to resolve sooner or later anyway. Is there ticket for that? -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 13:35:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 13:35:16 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() 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/2779 to look at the new patch set (#10). ofono_client: Implement network registration during connect() A new mcc_mnc parameter is now optionally passed to connect() in order to manually register to a specific network with a given MCC+MNC pair. If no parameter is passed (or None), then the modem will be instructed to attempt an automatic registration with any available network which permits it. We get the MCC+MNC parameter from the MSC/NITB and we pass it to the modem object at connect time as shown in the modified tests. Two new simple tests to check network registration is working are added in this commit. Ofono modems seem to be automatically registering at some point after they are set Online=true, and we were actually using that 'feature' before this patch. Thus, it is possible that a modem quickly becomes registered, and we then check so before starting the scan+registration process, which can take a few seconds. The scanning method can take a few seconds to complete. To avoid blocking in the dbus ofono Scan() method, this commit adds some code to make use of glib/gdbus async methods, which are not yet supported directly by pydbus. This way, we can continue polling while waiting for the scan process to complete and we can register several modems in parallel. When scan completes, a callback is run which attempts to register. If no MCC+MNC was passed, as we just finished scanning the modem should have enough fresh operator information to take good and quick decisions on where to connect. If we have an MCC+MNC, then we check the operator list received by Scan() method. If operator with desired MCC+MNC is there, we register with it. If it's not there, we start scanning() again asynchronously hoping the operator will show up in next scan. As scanning() and registration is done in the background, tests are expected to call connect(), and then later on wait for the modem to register by waiting/polling the method "modem.is_connected()". Tests first check for the modem being connected and after with MSC subscriber_attached(). The order is intentional because the later has to poll through network and adds unneeded garbage to the pcap files bein recorded. Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c --- M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M suites/aoip_debug/interactive.py M suites/aoip_sms/mo_mt_sms.py M suites/debug/interactive.py A suites/netreg/register.py A suites/netreg/register_default.py A suites/netreg/suite.conf M suites/sms/mo_mt_sms.py 10 files changed, 226 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/79/2779/10 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 46300ec..fc9bba4 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -22,6 +22,7 @@ from pydbus import SystemBus, Variant import time import pprint +import sys from gi.repository import GLib glib_main_loop = GLib.MainLoop() @@ -31,6 +32,12 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' + +# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 +NETREG_ST_REGISTERED = 'registered' +NETREG_ST_ROAMING = 'roaming' + +NETREG_MAX_REGISTER_ATTEMPTS = 3 class DeferredHandling: defer_queue = [] @@ -47,6 +54,9 @@ while DeferredHandling.defer_queue: handler, args, kwargs = DeferredHandling.defer_queue.pop(0) handler(*args, **kwargs) + +def defer(handler, *args, **kwargs): + DeferredHandling.defer_queue.append((handler, args, kwargs)) def dbus_connect(dbus_iface, handler): '''This function shall be used instead of directly connecting DBus signals. @@ -72,6 +82,53 @@ def list_modems(): root = systembus_get('/') return sorted(root.GetModems()) + +def _async_result_handler(obj, result, user_data): + '''Generic callback dispatcher called from glib loop when an async method + call has returned. This callback is set up by method dbus_async_call.''' + (result_callback, error_callback, real_user_data) = user_data + try: + ret = obj.call_finish(result) + except Exception as e: + # return exception as value + if error_callback: + error_callback(obj, e, real_user_data) + else: + result_callback(obj, e, real_user_data) + return + + ret = ret.unpack() + # to be compatible with standard Python behaviour, unbox + # single-element tuples and return None for empty result tuples + if len(ret) == 1: + ret = ret[0] + elif len(ret) == 0: + ret = None + result_callback(obj, ret, real_user_data) + +def dbus_async_call(instance, proxymethod, *proxymethod_args, + result_handler=None, error_handler=None, + user_data=None, timeout=30, + **proxymethod_kwargs): + '''pydbus doesn't support asynchronous methods. This method adds support for + it until pydbus implements it''' + + argdiff = len(proxymethod_args) - len(proxymethod._inargs) + if argdiff < 0: + raise TypeError(proxymethod.__qualname__ + " missing {} required positional argument(s)".format(-argdiff)) + elif argdiff > 0: + raise TypeError(proxymethod.__qualname__ + " takes {} positional argument(s) but {} was/were given".format(len(proxymethod._inargs), len(proxymethod_args))) + + timeout = timeout * 1000 + user_data = (result_handler, error_handler, user_data) + + ret = instance._bus.con.call( + instance._bus_name, instance._path, + proxymethod._iface_name, proxymethod.__name__, + GLib.Variant(proxymethod._sinargs, proxymethod_args), + GLib.VariantType.new(proxymethod._soutargs), + 0, timeout, None, + _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. @@ -257,6 +314,7 @@ self.set_log_category(log.C_TST) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) + self.register_attempts = 0 self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), @@ -323,18 +381,95 @@ def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) - def connect(self, nitb): - 'set the modem up to connect to MCC+MNC from NITB config' - self.log('connect to', nitb) + def is_connected(self, mcc_mnc=None): + netreg = self.dbus.interface(I_NETREG) + prop = netreg.GetProperties() + status = prop.get('Status') + if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): + return False + if mcc_mnc is None: # Any network is fine and we are registered. + return True + mcc = prop.get('MobileCountryCode') + mnc = prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + return True + return False + + def schedule_scan_register(self, mcc_mnc): + if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: + self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + self.register_attempts += 1 + netreg = self.dbus.interface(I_NETREG) + self.dbg('Scanning for operators...') + # Scan method can take several seconds, and we don't want to block + # waiting for that. Make it async and try to register when the scan is + # finished. + register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register + result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) + error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) + dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, + error_handler=error_handler, user_data=mcc_mnc) + + def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): + self.dbg('scanned operators: ', scanned_operators); + for op_path, op_prop in scanned_operators: + if op_prop.get('Status') == 'current': + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + self.log('Already registered with network', (mcc, mnc)) + return + self.log('Registering with the default network') + netreg = self.dbus.interface(I_NETREG) + netreg.Register() + + def scan_cb_register(self, scanned_operators, mcc_mnc): + self.dbg('scanned operators: ', scanned_operators); + matching_op_path = None + for op_path, op_prop in scanned_operators: + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + if op_prop.get('Status') == 'current': + self.log('Already registered with network', mcc_mnc) + # We discovered the network and we are already registered + # with it. Avoid calling op.Register() in this case (it + # won't act as a NO-OP, it actually returns an error). + return + matching_op_path = op_path + break + if matching_op_path is None: + self.dbg('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + self.schedule_scan_register(mcc_mnc) + return + dbus_op = systembus_get(matching_op_path) + self.log('Registering with operator', matching_op_path, mcc_mnc) + dbus_op.Register() + + def power_cycle(self): + 'Power the modem and put it online, power cycle it if it was already on' if self.is_powered(): - self.dbg('is powered') + self.dbg('Power cycling') self.set_online(False) self.set_powered(False) event_loop.wait(self, lambda: not self.dbus.has_interface(I_NETREG, I_SMS), timeout=10) + else: + self.dbg('Powering on') self.set_powered() self.set_online() event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10) + def connect(self, mcc_mnc=None): + 'Connect to MCC+MNC' + if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): + self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + self.power_cycle() + self.register_attempts = 0 + if self.is_connected(mcc_mnc): + self.log('Already registered with', mcc_mnc if mcc_mnc else 'default network') + else: + self.log('Connect to', mcc_mnc if mcc_mnc else 'default network') + self.schedule_scan_register(mcc_mnc) + def sms_send(self, to_msisdn_or_modem, *tokens): if isinstance(to_msisdn_or_modem, Modem): to_msisdn = to_msisdn_or_modem.msisdn diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2ef88df..3a822f1 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -29,6 +29,7 @@ config_file = None process = None hlr = None + config = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): self.suite_run = suite_run @@ -73,6 +74,7 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -84,6 +86,15 @@ def addr(self): return self.ip_address.get('addr') + def mcc(self): + return self.config['msc']['net']['mcc'] + + def mnc(self): + return self.config['msc']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..b4bf247 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -76,6 +76,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -91,6 +92,15 @@ self.bts.append(bts) bts.set_bsc(self) + def mcc(self): + return self.config['nitb']['net']['mcc'] + + def mnc(self): + return self.config['nitb']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_add(self, modem, msisdn=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 7cc1b76..cfedd3a 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -18,7 +18,7 @@ for m in modems: hlr.subscriber_add(m) - m.connect(bsc) + m.connect(msc.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -30,6 +30,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index b9383ea..8eba842 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -21,13 +21,15 @@ hlr.subscriber_add(ms_mo) hlr.subscriber_add(ms_mt) -ms_mo.connect(bsc) -ms_mt.connect(bsc) +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) sms = ms_mo.sms_send(ms_mt) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 603e395..37076dc 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -13,7 +13,7 @@ for m in modems: nitb.subscriber_add(m) - m.connect(nitb) + m.connect(nitb.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -25,6 +25,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/netreg/register.py b/suites/netreg/register.py new file mode 100755 index 0000000..9141986 --- /dev/null +++ b/suites/netreg/register.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +print(ms.info()) + +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/register_default.py b/suites/netreg/register_default.py new file mode 100755 index 0000000..d15b3f5 --- /dev/null +++ b/suites/netreg/register_default.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect() + +print(ms.info()) + +wait(ms.is_connected) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/suite.conf b/suites/netreg/suite.conf new file mode 100644 index 0000000..1bb1dbb --- /dev/null +++ b/suites/netreg/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 40s diff --git a/suites/sms/mo_mt_sms.py b/suites/sms/mo_mt_sms.py index 860f5e7..4e0ba08 100755 --- a/suites/sms/mo_mt_sms.py +++ b/suites/sms/mo_mt_sms.py @@ -14,13 +14,15 @@ nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) ms_mo.log_info() ms_mt.log_info() print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) sms = ms_mo.sms_send(ms_mt) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 10 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 Mon Jun 12 13:35:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 13:35:41 +0000 Subject: [PATCH] libosmocore[master]: Add doxygen documentation to libosmocoding Message-ID: Review at https://gerrit.osmocom.org/2888 Add doxygen documentation to libosmocoding This adds the minimum amount of API documentation that we should have on all our code, particularly new code merged into a library. Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74 --- M Doxyfile.coding.in M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c 11 files changed, 465 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/2888/1 diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in index d73e6cd..28e3241 100644 --- a/Doxyfile.coding.in +++ b/Doxyfile.coding.in @@ -37,7 +37,7 @@ # 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 L1 transcoding library" +PROJECT_BRIEF = "Osmocom GSM/GPRS/EGPRS L1 channel coding 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 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index f6591f5..55375bb 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -3,6 +3,14 @@ #include #include +/*! \addtogroup coding + * @{ + */ + +/*! \file gsm0503_coding.h + * \brief GSM TS 05.03 coding + */ + #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) #define NUM_BYTES(N) ((N + 8 - 1) / 8) @@ -61,3 +69,5 @@ int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index f97dff4..85c7328 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -2,6 +2,14 @@ #include +/*! \addtogroup interleaving + * @{ + */ + +/*! \file gsm0503_interleaving.h + * \brief GSM TS 05.03 interleaving + */ + void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB); @@ -49,3 +57,5 @@ const sbit_t *hi, const sbit_t *di); void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di); + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 93e4b67..6e139bf 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -2,6 +2,14 @@ #include +/*! \addtogroup mapping + * @{ + */ + +/*! \file gsm0503_mapping.c + * \brief GSM TS 05.03 burst mapping + */ + void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, @@ -31,3 +39,5 @@ sbit_t *hi, sbit_t *up, int B); void gsm0503_mcs5_burst_swap(sbit_t *eB); + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_parity.h b/include/osmocom/coding/gsm0503_parity.h index 540124a..f844720 100644 --- a/include/osmocom/coding/gsm0503_parity.h +++ b/include/osmocom/coding/gsm0503_parity.h @@ -2,6 +2,14 @@ #include +/*! \addtogroup parity + * @{ + */ + +/*! \file gsm0503_parity.h + * \brief GSM TS 05.03 parity + */ + const struct osmo_crc64gen_code gsm0503_fire_crc40; const struct osmo_crc16gen_code gsm0503_cs234_crc16; const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr; @@ -11,3 +19,5 @@ const struct osmo_crc8gen_code gsm0503_tch_fr_crc3; const struct osmo_crc8gen_code gsm0503_tch_efr_crc8; const struct osmo_crc8gen_code gsm0503_amr_crc6; + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_tables.h b/include/osmocom/coding/gsm0503_tables.h index e6761ca..4622cae 100644 --- a/include/osmocom/coding/gsm0503_tables.h +++ b/include/osmocom/coding/gsm0503_tables.h @@ -3,6 +3,14 @@ #include #include +/*! \addtogroup tables + * @{ + */ + +/*! \file gsm0503_tables.h + * \brief GSM TS 05.03 tables + */ + extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8]; extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8]; extern const sbit_t gsm0503_pdtch_hl_hn_sbit[4][8]; @@ -48,3 +56,5 @@ extern const sbit_t gsm0503_ahs_ic_sbit[4][4]; extern const uint8_t gsm0503_tch_hr_interleaving[228][2]; extern const ubit_t gsm0503_mcs5_usf_precode_table[8][36]; + +/*! @} */ diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index d752454..bf4df1c 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -2,6 +2,7 @@ * (C) 2013 by Andreas Eversberg * (C) 2015 by Alexander Chemeris * (C) 2016 by Tom Tsou + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -45,6 +46,64 @@ #include #include +/*! \mainpage libosmocoding Documentation + * + * \section sec_intro Introduction + * This library is a collection of definitions, tables and functions + * implementing the GSM/GPRS/EGPRS channel coding (and decoding) as + * specified in 3GPP TS 05.03 / 45.003. + * + * libosmocodec is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * + * \section sec_copyright Copyright and License + * Copyright ? 2013 by Andreas Eversberg\n + * Copyright ? 2015 by Alexander Chemeris\n + * Copyright ? 2016 by Tom Tsou\n + * Documentation Copyright ? 2017 by Harald Welte\n + * All rights reserved. \n\n + * The source code of libosmocoding is licensed 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.\n + * See or COPYING included in the source + * code package istelf.\n + * The information detailed here is provided AS IS with NO WARRANTY OF + * ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. + * \n\n + * + * \section sec_tracker Homepage + Issue Tracker + * libosmocoding is distributed as part of libosmocore and shares its + * project page at http://osmocom.org/projects/libosmocore + * + * An Issue Tracker can be found at + * https://osmocom.org/projects/libosmocore/issues + * + * \section sec_contact Contact and Support + * Community-based support is available at the OpenBSC mailing list + * \n + * Commercial support options available upon request from + * + */ + + +/*! \addtogroup coding + * @{ + * + * \brief GSM TS 05.03 coding + * + * This module is the "master module" of libosmocoding. It uses the + * various other modules (mapping, parity, interleaving) in order to + * implement the complete channel coding (and decoding) chain for the + * various channel types as defined in TS 05.03 / 45.003. + */ + +/*! \file gsm0503_coding.c */ + /* * EGPRS coding limits */ @@ -78,34 +137,49 @@ /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ #define GSM_EFR_BYTES 31 +/*! \brief union across the three different EGPRS Uplink header types */ union gprs_rlc_ul_hdr_egprs { struct gprs_rlc_ul_header_egprs_1 type1; struct gprs_rlc_ul_header_egprs_2 type2; struct gprs_rlc_ul_header_egprs_3 type3; }; +/*! \brief union across the three different EGPRS Downlink header types */ union gprs_rlc_dl_hdr_egprs { struct gprs_rlc_dl_header_egprs_1 type1; struct gprs_rlc_dl_header_egprs_2 type2; struct gprs_rlc_dl_header_egprs_3 type3; }; +/*! \brief Structure describing a Modulation and Coding Scheme */ struct gsm0503_mcs_code { + /*! \brief Modulation and Coding Scheme (MSC) number */ uint8_t mcs; + /*! \brief Length of Uplink Stealing Flag (USF) in bits */ uint8_t usf_len; /* Header coding */ + /*! \brief Length of header (bits) */ uint8_t hdr_len; + /*! \brief Length of header convolutional code */ uint8_t hdr_code_len; + /*! \brief Length of header code puncturing sequence */ uint8_t hdr_punc_len; + /*! \brief header convolutional code */ const struct osmo_conv_code *hdr_conv; + /*! \brief header puncturing sequence */ const uint8_t *hdr_punc; /* Data coding */ + /*! \brief length of data (bits) */ uint16_t data_len; + /*! \brief length of data convolutional code */ uint16_t data_code_len; + /*! \brief length of data code puncturing sequence */ uint16_t data_punc_len; + /*! \brief data convolutional code */ const struct osmo_conv_code *data_conv; + /*! \brief data puncturing sequences */ const uint8_t *data_punc[3]; }; @@ -460,6 +534,13 @@ }, }; +/*! \brief Convolutional Decode + compute BER + * \param[in] code Description of Convolutional Code + * \param[in] input Input soft-bits (-127...127) + * \param[out] output bits + * \param[out] n_errors Number of bit-errors + * \param[out] n_bits_total Number of bits + */ static int osmo_conv_decode_ber(const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output, int *n_errors, int *n_bits_total) @@ -490,6 +571,12 @@ return res; } +/*! \brief convenience wrapper for decoding coded bits + * \param[out] l2_data caller-allocated buffer for L2 Frame + * \param[in] cB 456 coded (soft) bits as per TS 05.03 4.1.3 + * \param[out] n_errors Number of detected errors + * \param[out] n_bits_total Number of total coded bits + * \returns 0 on success; -1 on CRC error */ static int _xcch_decode_cB(uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) { @@ -509,6 +596,10 @@ return 0; } +/*! \brief convenience wrapper for encoding to coded bits + * \param[out] cB caller-allocated buffer for 456 coded bits as per TS 05.03 4.1.3 + * \param[out] l2_data to-be-encoded L2 Frame + * \returns 0 */ static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data) { ubit_t conv[224]; @@ -525,6 +616,13 @@ /* * GSM xCCH block transcoding */ + +/*! \brief Decoding of xCCH data from bursts to L2 frame + * \param[out] l2_data caller-allocated output data buffer + * \param[in] bursts four GSM bursts in soft-bits + * \param[out] n_errors Number of detected errors + * \param[out] n_bits_total Number of total coded bits + */ int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { @@ -539,6 +637,11 @@ return _xcch_decode_cB(l2_data, cB, n_errors, n_bits_total); } +/*! \brief Encoding of xCCH data from L2 frame to bursts + * \param[out] bursts caller-allocated burst data (unpacked bits) + * \param[in] l2_data L2 input data (MAC block) + * \returns 0 + */ int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data) { ubit_t iB[456], cB[456], hl = 1, hn = 1; @@ -801,14 +904,18 @@ return NUM_BYTES(code->hdr_len + code->data_len); } -/* - * Decode EGPRS UL message - * - * 1. Header section decoding - * 2. Extract CPS settings - * 3. Burst unmapping and deinterleaving - * 4. Data section decoding - */ +/*! \brief Decode EGPRS UL message + * 1. Header section decoding + * 2. Extract CPS settings + * 3. Burst unmapping and deinterleaving + * 4. Data section decoding + * \param[out] l2_data caller-allocated buffer for L2 Frame + * \param[in] bursts burst input data as soft unpacked bits + * \param[in] nbits number of bits in \a bursts + * \param usf_p unused argument ?!? + * \param[out] n_errors number of detected bit-errors + * \param[out] n_bits_total total number of dcoded bits + * \returns 0 on success; negative on error */ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) { @@ -879,6 +986,13 @@ * GSM PDTCH block transcoding */ +/*! \brief Decode GPRS PDTCH + * \param[out] l2_data caller-allocated buffer for L2 Frame + * \param[in] bursts burst input data as soft unpacked bits + * \param[out] usf_p uplink stealing flag + * \param[out] n_errors number of detected bit-errors + * \param[out] n_bits_total total number of dcoded bits + * \returns 0 on success; negative on error */ int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) { @@ -1189,9 +1303,11 @@ return egprs_get_cps(cps, type, bits); } -/* - * EGPRS DL message encoding - */ +/*! \brief EGPRS DL message encoding + * \param[out] bursts caller-allocated buffer for unpacked burst bits + * \param[in] l2_data L2 (MAC) block to be encoded + * \param[in] l2_len length of l2_data in bytes, used to determine MCS + * \returns 0 on success; negative on error */ int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { @@ -1282,6 +1398,11 @@ return -1; } +/*! \brief GPRS DL message encoding + * \param[out] bursts caller-allocated buffer for unpacked burst bits + * \param[in] l2_data L2 (MAC) block to be encoded + * \param[in] l2_len length of l2_data in bytes, used to determine CS + * \returns 0 on success; negative on error */ int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { ubit_t iB[456], cB[676]; @@ -1366,6 +1487,10 @@ * GSM TCH/F FR/EFR transcoding */ +/*! \brief assemble a FR codec frame in format as used inside RTP + * \param[out] tch_data Codec frame in RTP format + * \param[in] b_bits Codec frame in 'native' format + * \param[in] net_order FIXME */ static void tch_fr_reassemble(uint8_t *tch_data, const ubit_t *b_bits, int net_order) { @@ -1426,6 +1551,7 @@ } } +/* assemble a HR codec frame in format as used inside RTP */ static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1445,6 +1571,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } +/* assemble a EFR codec frame in format as used inside RTP */ static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1464,6 +1591,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } +/* assemble a AMR codec frame in format as used inside RTP */ static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len) { int i, j; @@ -1482,6 +1610,7 @@ d_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } +/* re-arrange according to TS 05.03 Table 2 (receiver) */ static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1490,6 +1619,7 @@ b_bits[gsm610_bitorder[i]] = d_bits[i]; } +/* re-arrange according to TS 05.03 Table 2 (transmitter) */ static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1498,6 +1628,7 @@ d_bits[i] = b_bits[gsm610_bitorder[i]]; } +/* re-arrange according to TS 05.03 Table 3a (receiver) */ static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1513,6 +1644,7 @@ b_bits[map[i]] = d_bits[i]; } +/* re-arrange according to TS 05.03 Table 3a (transmitter) */ static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1527,6 +1659,7 @@ d_bits[i] = b_bits[map[i]]; } +/* re-arrange according to TS 05.03 Table 6 (receiver) */ static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1535,6 +1668,7 @@ b_bits[gsm660_bitorder[i]] = d_bits[i]; } +/* re-arrange according to TS 05.03 Table 6 (transmitter) */ static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1543,6 +1677,7 @@ d_bits[i] = b_bits[gsm660_bitorder[i]]; } +/* extract the 65 protected class1a+1b bits */ static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits) { int i; @@ -1637,6 +1772,14 @@ memcpy(d + prot, u + prot + 6, len - prot); } +/*! \brief Perform channel decoding of a FR/EFR channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] net_order FIXME + * \param[in] efr Is this channel using EFR (1) or FR (0) + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { @@ -1644,13 +1787,17 @@ ubit_t conv[185], s[244], w[260], b[65], d[260], p[8]; int i, rv, len, steal = 0; + /* map from 8 bursts to interleaved data bits (iB) */ for (i = 0; i < 8; i++) { gsm0503_tch_burst_unmap(&iB[i * 114], &bursts[i * 116], &h, i >> 2); steal -= h; } + /* we now have the bits of the four bursts (interface 4 in + * Figure 1a of TS 05.03 */ gsm0503_tch_fr_deinterleave(cB, iB); + /* we now have the coded bits c(B): interface 3 in Fig. 1a */ if (steal > 0) { rv = _xcch_decode_cB(tch_data, cB, n_errors, n_bits_total); @@ -1663,12 +1810,15 @@ } osmo_conv_decode_ber(&gsm0503_tch_fr, cB, conv, n_errors, n_bits_total); + /* we now have the data bits 'u': interface 2 in Fig. 1a */ + /* input: 'conv', output: d[ata] + p[arity] */ tch_fr_unreorder(d, p, conv); for (i = 0; i < 78; i++) d[i + 182] = (cB[i + 378] < 0) ? 1 : 0; + /* check if parity of first 50 (class 1) 'd'-bits match 'p' */ rv = osmo_crc8gen_check_bits(&gsm0503_tch_fr_crc3, d, 50, p); if (rv) { /* Error checking CRC8 for the FR part of an EFR/FR frame */ @@ -1677,11 +1827,17 @@ if (efr) { tch_efr_d_to_w(w, d); + /* we now have the preliminary-coded bits w(k) */ tch_efr_unreorder(s, p, w); + /* we now have the data delivered to the preliminary + * channel encoding unit s(k) */ + /* extract the 65 most important bits according TS 05.03 3.1.1.1 */ tch_efr_protected(s, b); + /* perform CRC-8 on 65 most important bits (50 bits of + * class 1a + 15 bits of class 1b) */ rv = osmo_crc8gen_check_bits(&gsm0503_tch_efr_crc8, b, 65, p); if (rv) { /* Error checking CRC8 for the EFR part of an EFR frame */ @@ -1702,6 +1858,12 @@ return len; } +/*! \brief Perform channel encoding on a TCH/FS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \param[in] net_order FIXME + * \returns 0 in case of success; negative on error */ int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) { @@ -1760,6 +1922,13 @@ return 0; } +/*! \brief Perform channel decoding of a HR(v1) channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] odd Odd (1) or even (0) frame number + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { @@ -1830,6 +1999,11 @@ return 15; } +/*! \brief Perform channel encoding on a TCH/HS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \returns 0 in case of success; negative on error */ int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len) { ubit_t iB[912], cB[456], h; @@ -1885,6 +2059,17 @@ return 0; } +/*! \brief Perform channel decoding of a TCH/AFS channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] codec_mode_req is this CMR (1) or CMC (0) + * \param[in] codec array of active codecs (active codec set) + * \param[in] codecs number of codecs in \a codec + * \param ft Frame Type; Input if \a codec_mode_req = 1, Output * otherwise + * \param[out] cmr Output in \a codec_mode_req = 1 + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) @@ -2080,6 +2265,16 @@ return len; } +/*! \brief Perform channel encoding on a TCH/AFS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \param[in] codec_mode_req Use CMR (1) or FT (0) + * \param[in] codec Array of codecs (active codec set) + * \param[in] codecs Number of entries in \a codec + * \param[in] ft Frame Type to be used for encoding (index to \a codec) + * \param[in] cmr Codec Mode Request (used in codec_mode_req = 1 only) + * \returns 0 in case of success; negative on error */ int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) @@ -2240,6 +2435,18 @@ return -1; } +/*! \brief Perform channel decoding of a TCH/AFS channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] odd Is this an odd (1) or even (0) frame number? + * \param[in] codec_mode_req is this CMR (1) or CMC (0) + * \param[in] codec array of active codecs (active codec set) + * \param[in] codecs number of codecs in \a codec + * \param ft Frame Type; Input if \a codec_mode_req = 1, Output * otherwise + * \param[out] cmr Output in \a codec_mode_req = 1 + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) @@ -2443,6 +2650,16 @@ return len; } +/*! \brief Perform channel encoding on a TCH/AHS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \param[in] codec_mode_req Use CMR (1) or FT (0) + * \param[in] codec Array of codecs (active codec set) + * \param[in] codecs Number of entries in \a codec + * \param[in] ft Frame Type to be used for encoding (index to \a codec) + * \param[in] cmr Codec Mode Request (used in codec_mode_req = 1 only) + * \returns 0 in case of success; negative on error */ int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) @@ -2617,6 +2834,11 @@ return 0; } +/*! \brief Decode the (8-bit) RACH according to TS 05.03 + * \param[out] ra output buffer for RACH data + * \param[in] burst Input burst data + * \param[in] bsic BSIC used in this cell + * \returns 0 on success; negative on error (e.g. CRC error) */ int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) { ubit_t conv[14]; @@ -2635,6 +2857,11 @@ return 0; } +/*! \brief Encode the (8-bit) RACH according to TS 05.03 + * \param[out] burst Caller-allocated output burst buffer + * \param[in] ra Input RACH data + * \param[in] bsic BSIC used in this cell + * \returns 0 on success; negative on error */ int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) { ubit_t conv[14]; @@ -2653,6 +2880,11 @@ /* * GSM SCH transcoding */ + +/*! \brief Decode the SCH according to TS 05.03 + * \param[out] sb_info output buffer for SCH data + * \param[in] burst Input burst data + * \returns 0 on success; negative on error (e.g. CRC error) */ int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst) { ubit_t conv[35]; @@ -2669,6 +2901,10 @@ return 0; } +/*! \brief Encode the SCH according to TS 05.03 + * \param[out] burst Caller-allocated output burst buffer + * \param[in] sb_info Input SCH data + * \returns 0 on success; negative on error */ int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info) { ubit_t conv[35]; @@ -2681,3 +2917,5 @@ return 0; } + +/*! @} */ diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 22ad6f6..61d4fdc 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -1,6 +1,7 @@ /* * (C) 2013 by Andreas Eversberg * (C) 2016 by Tom Tsou + * (C) 2017 by Hrald Welte * * All Rights Reserved * @@ -26,6 +27,16 @@ #include #include +/*! \addtogroup interleaving + * @{ + * \brief GSM TS 05.03 interleaving + * + * This module contains interleaving / de-interleaving routines for + * various channel types, as defined in 3GPP TS 05.03 / 45.003 + */ + +/*! \file gsm0503_interleaving.c */ + /* * GSM xCCH interleaving and burst mapping * @@ -48,6 +59,9 @@ * Where hl(B) and hn(B) are bits in burst B indicating flags. */ +/*! \brief De-Interleave burst bits according to TS 05.03 4.1.4 + * \param[out] cB caller-allocated output buffer for 456 soft coded bits + * \param[in] iB 456 soft input bits */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB) { int j, k, B; @@ -59,6 +73,9 @@ } } +/*! \brief Interleave burst bits according to TS 05.03 4.1.4 + * \param[out] iB caller-allocated output buffer for 456 soft interleaved bits + * \param[in] cB 456 soft input coded bits */ void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -70,6 +87,11 @@ } } +/*! \brief De-Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5 + * \param[out] u caller-allocated output buffer for 12 soft coded bits + * \param[out] hc caller-allocated output buffer for 68 soft coded bits + * \param[out] dc caller-allocated output buffer for 372 soft coded bits + * \param[in] iB 452 interleaved soft input bits */ void gsm0503_mcs1_dl_deinterleave(sbit_t *u, sbit_t *hc, sbit_t *dc, const sbit_t *iB) { @@ -106,6 +128,11 @@ } } +/*! \brief Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5 + * \param[in] up 12 input soft coded bits (usf) + * \param[in] hc 68 input soft coded bits (header) + * \param[in] dc 372 input soft bits (data) + * \param[out] iB 456 interleaved soft output bits */ void gsm0503_mcs1_dl_interleave(const ubit_t *up, const ubit_t *hc, const ubit_t *dc, ubit_t *iB) { @@ -139,6 +166,10 @@ gsm0503_xcch_interleave(cp, iB); } +/*! \brief Interleave MCS1 UL burst bits according to TS 05.03 5.1.5.2.4 + * \param[out] hc caller-allocated output buffer for 80 soft coded header bits + * \param[out] dc caller-allocated output buffer for 372 soft coded data bits + * \param[in] iB 456 interleaved soft input bits */ void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB) { int k; @@ -169,6 +200,10 @@ } } +/*! \brief Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.2.4 + * \param[in] hc 80 input coded bits (header) + * \param[in] dc 372 input bits (data) + * \param[out] iB 456 interleaved output bits */ void gsm0503_mcs1_ul_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *iB) { int k; @@ -199,6 +234,11 @@ gsm0503_xcch_interleave(cp, iB); } +/*! \brief Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4 + * \param[in] hc 136 soft coded header input bits + * \param[in] dc 1248 soft coded data input bits + * \param[out] hi 136 interleaved header output bits + * \param[out] di 1248 interleaved data output bits */ void gsm0503_mcs5_ul_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di) { @@ -217,6 +257,10 @@ } } +/*! \brief De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4 + * \param[out] hc caller-allocated output buffer for 136 soft coded header bits + * \param[out] dc caller-allocated output buffer for 1248 soft coded data bits + * \param[in] iB interleaved soft input bits */ void gsm0503_mcs5_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di) { @@ -239,6 +283,11 @@ } } +/*! \brief Interleave MCS5 DL burst bits according to TS 05.03 5.1.9.1.5 + * \param[in] hc 100 soft coded header input bits + * \param[in] dc 1248 soft coded data input bits + * \param[out] hi 100 interleaved header output bits + * \param[out] di 1248 interleaved data output bits */ void gsm0503_mcs5_dl_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di) { @@ -257,6 +306,10 @@ } } +/*! \brief De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.1.5 + * \param[out] hc caller-allocated output buffer for 100 soft coded header bits + * \param[out] dc caller-allocated output buffer for 1248 soft coded data bits + * \param[in] iB interleaved soft input bits */ void gsm0503_mcs5_dl_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di) { @@ -279,6 +332,12 @@ } } +/*! \brief Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5 + * \param[in] hc 124 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 124 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs7_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -302,7 +361,12 @@ } } - +/*! \brief De-Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5 + * \param[out] hc caller-allocated output buffer for 124 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs7_dl_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -330,6 +394,12 @@ } } +/*! \brief Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4 + * \param[in] hc 124 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 124 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs7_ul_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -353,6 +423,12 @@ } } +/*! \brief De-Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4 + * \param[out] hc caller-allocated output buffer for 160 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs7_ul_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -380,6 +456,12 @@ } } +/*! \brief Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4 + * \param[in] hc 160 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 160 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs8_ul_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -403,6 +485,13 @@ } } + +/*! \brief De-Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4 + * \param[out] hc caller-allocated output buffer for 160 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs8_ul_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -430,6 +519,12 @@ } } +/*! \brief Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5 + * \param[in] hc 124 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 124 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -453,6 +548,12 @@ } } +/*! \brief De-Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5 + * \param[out] hc caller-allocated output buffer for 124 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs8_dl_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -504,6 +605,9 @@ * Where hl(B) and hn(B) are bits in burst B indicating flags. */ +/*! \brief GSM TCH FR/EFR/AFS De-Interleaving and burst mapping + * \param[out] cB caller-allocated buffer for 456 unpacked output bits + * \param[in] iB 456 unpacked interleaved input bits */ void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB) { int j, k, B; @@ -515,6 +619,9 @@ } } +/*! \brief GSM TCH FR/EFR/AFS Interleaving and burst mapping + * \param[in] cB caller-allocated buffer for 456 unpacked input bits + * \param[out] iB 456 unpacked interleaved output bits */ void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -550,6 +657,9 @@ * Where hl(B) and hn(B) are bits in burst B indicating flags. */ +/*! \brief GSM TCH HR/AHS De-Interleaving and burst mapping + * \param[out] cB caller-allocated buffer for 228 unpacked output bits + * \param[in] iB 228 unpacked interleaved input bits */ void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB) { int j, k, B; @@ -561,6 +671,9 @@ } } +/*! \brief GSM TCH HR/AHS Interleaving and burst mapping + * \param[in] cB caller-allocated buffer for 228 unpacked input bits + * \param[out] iB 228 unpacked interleaved output bits */ void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -571,3 +684,5 @@ iB[B * 114 + j] = cB[k]; } } + +/*! @} */ diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 4dd3076..82c049c 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -25,6 +25,17 @@ #include #include +/*! \addtogroup mapping + * @{ + * + * \brief GSM TS 05.03 burst mapping + * + * This module contains burst mapping routines as specified in 3GPP TS + * 05.03 / 45.003. + */ + +/*! \file gsm0503_mapping.c */ + void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn) { @@ -289,3 +300,5 @@ eB[191] = t[12]; eB[194] = t[13]; } + +/*! @} */ diff --git a/src/coding/gsm0503_parity.c b/src/coding/gsm0503_parity.c index 99198ba..171feb4 100644 --- a/src/coding/gsm0503_parity.c +++ b/src/coding/gsm0503_parity.c @@ -24,8 +24,18 @@ #include #include -/* - * GSM (SACCH) parity (FIRE code) +/*! \addtogroup parity + * @{ + * + * \brief GSM TS 05.03 parity + * + * This module contains parity/crc code definitions for the various + * parity/crc schemes as defined in 3GPP TS 05.03 / 45.003 + */ + +/*! \file gsm0503_parity.c */ + +/*! \brief GSM (SACCH) parity (FIRE code) * * g(x) = (x^23 + 1)(x^17 + x^3 + 1) * = x^40 + x^26 + x^23 + x^17 + x^3 + a1 @@ -37,8 +47,7 @@ .remainder = 0xffffffffffULL, }; -/* - * GSM PDTCH CS-2, CS-3, CS-4 parity +/*! \brief GSM PDTCH CS-2, CS-3, CS-4 parity * * g(x) = x^16 + x^12 + x^5 + 1 */ @@ -49,8 +58,7 @@ .remainder = 0xffff, }; -/* - * EDGE MCS header parity +/*! \brief EDGE MCS header parity * */ const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr = { @@ -60,8 +68,7 @@ .remainder = 0xff, }; -/* - * EDGE MCS data parity +/*! \brief EDGE MCS data parity * */ const struct osmo_crc16gen_code gsm0503_mcs_crc12 = { @@ -71,8 +78,7 @@ .remainder = 0x0fff, }; -/* - * GSM RACH parity +/*! \brief GSM RACH parity * * g(x) = x^6 + x^5 + x^3 + x^2 + x^1 + 1 */ @@ -83,8 +89,7 @@ .remainder = 0x3f, }; -/* - * GSM SCH parity +/*! \brief GSM SCH parity * * g(x) = x^10 + x^8 + x^6 + x^5 + x^4 + x^2 + 1 */ @@ -95,8 +100,7 @@ .remainder = 0x3ff, }; -/* - * GSM TCH FR/HR/EFR parity +/*! \brief GSM TCH FR/HR/EFR parity * * g(x) = x^3 + x + 1 */ @@ -107,8 +111,7 @@ .remainder = 0x7, }; -/* - * GSM TCH EFR parity +/*! \brief GSM TCH EFR parity * * g(x) = x^8 + x^4 + x^3 + x^2 + 1 */ @@ -119,8 +122,7 @@ .remainder = 0x00, }; -/* - * GSM AMR parity +/*! \brief GSM AMR parity * * g(x) = x^6 + x^5 + x^3 + x^2 + x^1 + 1 */ @@ -130,3 +132,5 @@ .init = 0x00, .remainder = 0x3f, }; + +/*! @} */ diff --git a/src/coding/gsm0503_tables.c b/src/coding/gsm0503_tables.c index 90ca88d..1c85765 100644 --- a/src/coding/gsm0503_tables.c +++ b/src/coding/gsm0503_tables.c @@ -24,6 +24,18 @@ #include #include +/*! \addtogroup tables + * @{ + * + * \brief GSM TS 05.03 tables + * + * This module contains various tables defining parts of 3GPP TS 05.03 + * / 45.003, primarily for the purpose of (de)puncturing, interleaving, + * etc. + */ + +/*! \file gsm0503_tables.c */ + const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8] = { { 1,1, 1,1, 1,1, 1,1 }, { 1,1, 0,0, 1,0, 0,0 }, @@ -1730,3 +1742,5 @@ { 0,0,1,0,0,1,1,0,1, 1,0,1,1,1,1,1,1,1, 0,1,1,0,1,0,0,0,1, 0,0,1,1,1,0,1,0,0, }, { 0,1,1,0,1,0,1,1,1, 0,1,0,1,0,1,1,1,1, 0,0,0,1,1,1,1,1,0, 0,1,0,0,1,0,0,1,1, }, }; + +/*! @} */ -- To view, visit https://gerrit.osmocom.org/2888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 12 13:35:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 13:35:41 +0000 Subject: [PATCH] libosmocore[master]: gsm0503_interleaving: Mark input arguments as 'const *' Message-ID: Review at https://gerrit.osmocom.org/2889 gsm0503_interleaving: Mark input arguments as 'const *' The interleaving/deinterleaving functions were missing 'const' qualifiers on their input data buffers Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9 --- M include/osmocom/coding/gsm0503_interleaving.h M src/coding/gsm0503_interleaving.c 2 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/2889/1 diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index 85c7328..a5d25ed 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -11,13 +11,13 @@ */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); -void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB); +void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB); -void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB); -void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB); +void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB); +void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB); -void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB); -void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB); +void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB); +void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB); void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB); void gsm0503_mcs1_ul_interleave(const ubit_t *hc, diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 61d4fdc..cd47cff 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -76,7 +76,7 @@ /*! \brief Interleave burst bits according to TS 05.03 4.1.4 * \param[out] iB caller-allocated output buffer for 456 soft interleaved bits * \param[in] cB 456 soft input coded bits */ -void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB) +void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -608,7 +608,7 @@ /*! \brief GSM TCH FR/EFR/AFS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 456 unpacked output bits * \param[in] iB 456 unpacked interleaved input bits */ -void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB) +void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB) { int j, k, B; @@ -622,7 +622,7 @@ /*! \brief GSM TCH FR/EFR/AFS Interleaving and burst mapping * \param[in] cB caller-allocated buffer for 456 unpacked input bits * \param[out] iB 456 unpacked interleaved output bits */ -void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB) +void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -660,7 +660,7 @@ /*! \brief GSM TCH HR/AHS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 228 unpacked output bits * \param[in] iB 228 unpacked interleaved input bits */ -void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB) +void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB) { int j, k, B; @@ -674,7 +674,7 @@ /*! \brief GSM TCH HR/AHS Interleaving and burst mapping * \param[in] cB caller-allocated buffer for 228 unpacked input bits * \param[out] iB 228 unpacked interleaved output bits */ -void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB) +void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; -- To view, visit https://gerrit.osmocom.org/2889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 12 13:35:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 13:35:41 +0000 Subject: [PATCH] libosmocore[master]: gsm0503_coding: Mark gsm0503_mcs_{ul, dl}_codes as const Message-ID: Review at https://gerrit.osmocom.org/2890 gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const The table describing the various MCS convolutional codes are constant data and should be marked as such. Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511 --- M src/coding/gsm0503_coding.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/2890/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index bf4df1c..7039863 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -186,7 +186,7 @@ /* * EGPRS UL coding parameters */ -struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = { +const struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = { { .mcs = EGPRS_MCS0, }, @@ -357,7 +357,7 @@ /* * EGPRS DL coding parameters */ -struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = { +const struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = { { .mcs = EGPRS_MCS0, }, @@ -743,7 +743,7 @@ sbit_t C[EGPRS_HDR_C_MAX]; ubit_t upp[EGPRS_HDR_UPP_MAX]; int i, j, rc; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; code = &gsm0503_mcs_ul_codes[mcs]; @@ -858,7 +858,7 @@ sbit_t C[EGPRS_DATA_C_MAX]; int i, j, rc, data_len; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; if (blk && mcs < EGPRS_MCS7) { /* Invalid MCS-X block state */ @@ -1206,7 +1206,7 @@ { int i, j; ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX]; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; code = &gsm0503_mcs_dl_codes[mcs]; @@ -1241,7 +1241,7 @@ { int i, j, data_len; ubit_t u[EGPRS_DATA_U_MAX], C[EGPRS_DATA_C_MAX]; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; code = &gsm0503_mcs_dl_codes[mcs]; -- To view, visit https://gerrit.osmocom.org/2890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 12 14:31:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 14:31:39 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2886 to look at the new patch set (#2). fix and refactor logging: drop 'with', simplify With the recent fix of the junit report related issues, another issue arose: the 'with log.Origin' was changed to disallow __enter__ing an object twice to fix problems, now still code would fail because it tries to do 'with' on the same object twice. The only reason is to ensure that logging is associated with a given object. Instead of complicating even more, implement differently. Refactor logging to simplify use: drop the 'with Origin' style completely, and instead use the python stack to determine which objects are created by which, and which object to associate a log statement with. The new way: we rely on the convention that each class instance has a local 'self' referencing the object instance. If we need to find an origin as a new object's parent, or to associate a log message with, we traverse each stack frame, fetching the first local 'self' object that is a log.Origin class instance. How to use: Simply call log.log() anywhere, and it finds an Origin object to log for, from the stack. Alternatively call self.log() for any Origin() object to skip the lookup. Create classes as child class of log.Origin and make sure to call super().__init__(category, name). This constructor will magically find a parent Origin on the stack. When an exception happens, we first escalate the exception up through call scopes to where ever it is handled by log.log_exn(). This then finds an Origin object in the traceback's stack frames, no need to nest in 'with' scopes. Hence the 'with log.Origin' now "happens implicitly", we can write pure natural python code, no more hassles with scope ordering. Furthermore, any frame can place additional string information in a local variable called log_ctx. This is automatically inserted in the ancestry associated with a log statement / exception. Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 --- M selftest/config_test.ok M selftest/log_test.ok M selftest/log_test.py M selftest/resource_test.ok M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test.py M selftest/template_test.ok M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/test.py M src/osmo_gsm_tester/trial.py 28 files changed, 422 insertions(+), 465 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/2886/2 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 40a5dcb..80b5a06 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -54,42 +54,42 @@ --- -: ERR: ValueError: config item not known: 'a_dict[]' Validation: Error - unknown band: ---- (item='bts[].trx[].band'): ERR: ValueError: Unknown GSM band: 'what' +--- bts[].trx[].band: ERR: ValueError: Unknown GSM band: 'what' Validation: Error - invalid v4 addrs: ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '91.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '91.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: 'go away' +--- addr[]: ERR: ValueError: Invalid IPv4 address: 'go away' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: None +--- addr[]: ERR: ValueError: Invalid IPv4 address: None Validation: Error - invalid hw addrs: ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '1.2.3' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '1.2.3' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: 'go away' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: 'go away' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: None +--- hwaddr[]: ERR: ValueError: Invalid hardware address: None Validation: Error - invalid imsis: ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '99999999x9' +--- imsi[]: ERR: ValueError: Invalid IMSI: '99999999x9' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '123 456 789 123' +--- imsi[]: ERR: ValueError: Invalid IMSI: '123 456 789 123' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: 'go away' +--- imsi[]: ERR: ValueError: Invalid IMSI: 'go away' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '' +--- imsi[]: ERR: ValueError: Invalid IMSI: '' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: None +--- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error diff --git a/selftest/log_test.ok b/selftest/log_test.ok index 7ed94a0..17198b7 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -32,10 +32,9 @@ 01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110] 01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113] - Testing logging of Exceptions, tracing origins -Not throwing an exception in 'with:' works. nested print just prints -01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:145] -01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] -01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] -- Enter the same Origin context twice +01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:135] +01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:136] +01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:137: raise ValueError('bork')] +- Disallow origin loops disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 7670c8e..1b268f1 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -32,20 +32,20 @@ log.set_all_levels(None) print('- Testing global log functions') -log.log('', log.C_TST, 'from log.log()') -log.dbg('', log.C_TST, 'from log.dbg(), not seen') +log.log('from log.log()', _origin='', _category=log.C_TST) +log.dbg('from log.dbg(), not seen', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_DBG) -log.dbg('', log.C_TST, 'from log.dbg()') +log.dbg('from log.dbg()', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_LOG) -log.err('', log.C_TST, 'from log.err()') +log.err('from log.err()', _origin='', _category=log.C_TST) print('- Testing log.Origin functions') class LogTest(log.Origin): - pass + def __init__(self, *name_items, **detail_items): + super().__init__(log.C_TST, *name_items, **detail_items) -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('some', 'name', some="detail") +t = LogTest('some', 'name', some="detail") + t.log("hello log") t.err("hello err") @@ -86,27 +86,27 @@ log.style_change(origin=True) t.dbg("add origin") +# some space to keep source line numbers identical to previous code + print('- Testing origin_width') -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('shortname') +t = LogTest('shortname') log.style(origin_width=23, time_fmt=fake_time) t.log("origin str set to 23 chars") -t.set_name('very long name', some='details', and_some=(3, 'things', 'in a tuple')) +t._set_name('very long name', some='details', and_some=(3, 'things', 'in a tuple')) t.log("long origin str") t.dbg("long origin str dbg") t.err("long origin str err") + print('- Testing log.Origin with omitted info') t = LogTest() -t.set_log_category(log.C_TST) t.log("hello log, name implicit from class name") -t = LogTest() -t.set_name('explicit_name') +t = LogTest('explicit_name') +t._set_log_category(None) t.log("hello log, no category set") - t = LogTest() +t._set_log_category(None) t.log("hello log, no category nor name set") t.dbg("hello log, no category nor name set, not seen") log.set_level(log.C_DEFAULT, log.L_DBG) @@ -117,47 +117,37 @@ class Thing(log.Origin): def __init__(self, some_path): - self.set_log_category(log.C_TST) - self.set_name(some_path) + super().__init__(log.C_TST, some_path) def say(self, msg): print(msg) -#log.style_change(trace=True) + def l1(self): + level2 = Thing('level2') + level2.l2() -with Thing('print_redirected'): - print("Not throwing an exception in 'with:' works.") + def l2(self): + level3 = Thing('level3') + level3.l3(self) -def l1(): - level1 = Thing('level1') - with level1: - l2() - -def l2(): - level2 = Thing('level2') - with level2: - l3(level2) - -def l3(level2): - level3 = Thing('level3') - with level3: + def l3(self, level2): print('nested print just prints') - level3.log('nested log()') + self.log('nested log()') level2.log('nested l2 log() from within l3 scope') raise ValueError('bork') try: - l1() + level1 = Thing('level1') + level1.l1() except Exception: log.log_exn() -print('- Enter the same Origin context twice') +print('- Disallow origin loops') try: t = Thing('foo') - with t: - with t: - raise RuntimeError('this should not be reached') -except AssertionError: + t._set_parent(t) + raise RuntimeError('this should not be reached') +except log.OriginLoopError: print('disallowed successfully') pass diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index cdc3519..d366cf9 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -13,8 +13,8 @@ cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./test_work/state_dir is [PATH]/selftest/conf/test_work/state_dir cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./suite_test is [PATH]/selftest/conf/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf -cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir *** all resources: {'arfcn': [{'_hash': 'e620569450f8259b3f0212ec19c285dd07df063c', 'arfcn': '512', diff --git a/selftest/resource_test.py b/selftest/resource_test.py index c78485e..a0ec490 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -78,7 +78,7 @@ 'modem': [ { 'times': 2 } ], } -origin = log.Origin('testowner') +origin = log.Origin(None, 'testowner') resources = pool.reserve(origin, want) diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 54c950a..9d7bdad 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' +cnf [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -22,15 +22,15 @@ - times: '2' - run hello world test -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test -cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir --------------------------------------------------------------------- trial test_suite --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] +tst combining_scenarios='resources': DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?combining_scenarios='resources'] tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 @@ -83,7 +83,7 @@ trial test_suite test_error.py ---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]: assert False] tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -92,7 +92,7 @@ skip: hello_world.py (N.N sec) skip: mo_mt_sms.py skip: mo_sms.py - FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False skip: test_fail.py skip: test_fail_raise.py @@ -106,7 +106,7 @@ trial test_suite test_fail.py ---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -128,7 +128,7 @@ ---------------------------------------------- trial test_suite test_fail_raise.py ---------------------------------------------- -tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]: raise ExpectedFail('This failure is expected')] tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -139,6 +139,6 @@ skip: mo_sms.py skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) - FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected - graceful exit. diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 2a92f47..13c2b63 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,7 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -trial = log.Origin('trial') +trial = log.Origin(None, 'trial') s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) diff --git a/selftest/template_test.ok b/selftest/template_test.ok index d031c96..1267dac 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -1,5 +1,5 @@ - Testing: fill a config file with values -cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl [osmo-nitb.cfg.tmpl?Templates] +cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl ! Configuration rendered by osmo-gsm-tester password foo ! diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 0083512..7d12c85 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -36,10 +36,9 @@ CONF_BTS_TRX = 'osmo-bts-trx.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX) self.suite_run = suite_run self.conf = conf - self.set_name(OsmoBtsTrx.BIN_BTS_TRX) - self.set_log_category(log.C_RUN) self.env = {} def remote_addr(self): diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 5f2b3cb..a771ec4 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -35,52 +35,50 @@ BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, self.BTS_SYSMO_BIN) self.suite_run = suite_run self.conf = conf - self.set_name('osmo-bts-sysmo') - self.set_log_category(log.C_RUN) self.remote_env = {} self.remote_user = 'root' def start(self): - with self: - if self.bsc is None: - raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') - self.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) - self.configure() + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') + log.log('Starting sysmoBTS to connect to', self.bsc) + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) - lib = self.inst.child('lib') - if not os.path.isdir(lib): - self.raise_exn('No lib/ in', self.inst) - if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): - self.raise_exn('No osmo-bts-sysmo binary in', self.inst) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) + lib = self.inst.child('lib') + if not os.path.isdir(lib): + raise log.Error('No lib/ in', self.inst) + if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): + raise log.Error('No osmo-bts-sysmo binary in', self.inst) - self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) - self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) + self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) + self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) - self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) - self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) - self.run_local('scp-inst-to-sysmobts', - ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) + self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) + self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) + self.run_local('scp-inst-to-sysmobts', + ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) - remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) - self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) + remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) + self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) - remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) - self.run_local('scp-cfg-to-sysmobts', - ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) + remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) + self.run_local('scp-cfg-to-sysmobts', + ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) - self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) + self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) - remote_lib = self.remote_inst.child('lib') - remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') - self.launch_remote('osmo-bts-sysmo', - ('LD_LIBRARY_PATH=%s' % remote_lib, - remote_binary, '-c', remote_config_file, '-r', '1', - '-i', self.bsc.addr()), - remote_cwd=remote_run_dir) + remote_lib = self.remote_inst.child('lib') + remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') + self.launch_remote('osmo-bts-sysmo', + ('LD_LIBRARY_PATH=%s' % remote_lib, + remote_binary, '-c', remote_config_file, '-r', '1', + '-i', self.bsc.addr()), + remote_cwd=remote_run_dir) def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) @@ -92,7 +90,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log_ctx = proc + raise log.Error('Exited in error') def launch_remote(self, name, popen_args, remote_cwd=None): proc = self._process_remote(name, popen_args, remote_cwd) @@ -105,7 +104,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log_ctx = proc + raise log.Error('Exited in error') def remote_addr(self): return self.conf.get('addr') diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 38d8e2f..1efd957 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -95,7 +95,7 @@ real_l = os.path.realpath(l) p = os.path.realpath(os.path.join(real_l, basename)) if os.path.isfile(p): - log.dbg(None, log.C_CNF, 'Found config file', basename, 'as', p, 'in', l, 'which is', real_l) + log.dbg('Found config file', basename, 'as', p, 'in', l, 'which is', real_l, _category=log.C_CNF) return (p, real_l) if not fail_if_missing: return None, None @@ -122,7 +122,7 @@ env_path = os.getenv(env_name) if env_path: real_env_path = os.path.realpath(env_path) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path) + log.dbg('Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path, _category=log.C_CNF) return real_env_path if PATHS is None: @@ -132,15 +132,15 @@ for key, path in sorted(PATHS.items()): if not path.startswith(os.pathsep): PATHS[key] = os.path.realpath(os.path.join(found_in, path)) - log.dbg(None, log.C_CNF, paths_file + ': relative path', path, 'is', PATHS[key]) + log.dbg(paths_file + ': relative path', path, 'is', PATHS[key], _category=log.C_CNF) p = PATHS.get(label) if p is None and not allow_unset: raise RuntimeError('missing configuration in %s: %r' % (PATHS_CONF, label)) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', p) + log.dbg('Found path', label, 'as', p, _category=log.C_CNF) if p.startswith(PATHS_TEMPDIR_STR): p = os.path.join(get_tempdir(), p[len(PATHS_TEMPDIR_STR):]) - log.dbg(None, log.C_CNF, 'Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p) + log.dbg('Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p, _category=log.C_CNF) return p def get_state_dir(): @@ -153,20 +153,20 @@ return Dir(get_configured_path(PATH_SCENARIOS_DIR)) def read(path, validation_schema=None, if_missing_return=False): - with log.Origin(path): - if not os.path.isfile(path) and if_missing_return is not False: - return if_missing_return - with open(path, 'r') as f: - config = yaml.safe_load(f) - config = _standardize(config) - if validation_schema: - schema.validate(config, validation_schema) - return config + log_ctx = path + if not os.path.isfile(path) and if_missing_return is not False: + return if_missing_return + with open(path, 'r') as f: + config = yaml.safe_load(f) + config = _standardize(config) + if validation_schema: + schema.validate(config, validation_schema) + return config def write(path, config): - with log.Origin(path): - with open(path, 'w') as f: - f.write(tostr(config)) + log_ctx = path + with open(path, 'w') as f: + f.write(tostr(config)) def tostr(config): return _tostr(_standardize(config)) @@ -191,8 +191,7 @@ class Scenario(log.Origin, dict): def __init__(self, name, path): - self.set_name(name) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, name) self.path = path def get_scenario(name, validation_schema=None): @@ -216,8 +215,8 @@ if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - add(dest_val, val) + log_ctx = 'key=%r' % key + add(dest_val, val) return if is_list(dest): if not is_list(src): @@ -235,19 +234,19 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log_ctx = 'key=%r' % key dest_val = dest.get(key) if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - combine(dest_val, val) + combine(dest_val, val) return 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)): - with log.Origin(idx=i): - combine(dest[i], src[i]) + log_ctx = 'idx=%r' % i + combine(dest[i], src[i]) return if dest == src: return @@ -260,16 +259,16 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log_ctx = 'key=%r' % key dest_val = dest.get(key) - with log.Origin(key=key): - dest[key] = overlay(dest_val, val) + dest[key] = overlay(dest_val, val) return dest 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)): - with log.Origin(idx=i): - dest[i] = overlay(dest[i], src[i]) + log_ctx = 'key=%r' % key + dest[i] = overlay(dest[i], src[i]) return dest return src diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index c3c679b..fbf4bad 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -21,6 +21,8 @@ # A test script can thus establish its context by doing: # from osmo_gsm_tester.test import * import time +from . import log + poll_funcs = [] def register_poll_func(func): @@ -38,7 +40,8 @@ def wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): if not timeout or timeout < 0: - log_obj.raise_exn('wait() *must* time out at some point. timeout=%r' % timeout) + self = log_obj + raise log.Error('wait() *must* time out at some point.', timeout=timeout) if timestep < 0.1: timestep = 0.1 @@ -54,7 +57,8 @@ def wait(log_obj, condition, *condition_args, timeout=300, timestep=1, **condition_kwargs): if not wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): - log_obj.raise_exn('Wait timeout') + log_ctx = log_obj + raise log.Error('Wait timeout') def sleep(log_obj, seconds): assert seconds > 0. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index f098f2b..f630df9 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -45,6 +45,39 @@ C_BUS = 'bus' C_DEFAULT = '---' +def dbg(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on debug level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_DBG, src=_src) + +def log(*messages, _origin=None, _category=None, _level=L_LOG, _src=None, **named_items): + '''Log a message. The origin, an Origin class instance, is normally + determined by stack magic, only pass _origin to override. The category is + taken from the origin. _src is normally an integer indicating how many + levels up the stack sits the interesting source file to log about, can also + be a string. The log message is composed of all *messages and + **named_items, for example: + log('frobnicate:', thing, key=current_key, prop=erty) + ''' + _log(messages, named_items, origin=_origin, category=_category, level=_level, src=_src) + +def err(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on error level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_ERR, src=_src) + +def _log(messages=[], named_items={}, origin=None, category=None, level=L_LOG, src=None): + if origin is None: + origin = Origin.find_on_stack() + if category is None and isinstance(origin, Origin): + category = origin._log_category + if src is None: + # two levels up + src = 2 + if isinstance(src, int): + src = get_src_from_caller(src + 1) + for target in LogTarget.all_targets: + target.log(origin, category, level, src, messages, named_items) + + LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' DATEFMT = '%H:%M:%S' @@ -52,7 +85,8 @@ get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) class Error(Exception): - pass + def __init__(self, *messages, **named_items): + super().__init__(compose_message(messages, named_items)) class LogTarget: all_targets = [] @@ -153,7 +187,7 @@ def log(self, origin, category, level, src, messages, named_items): if category and len(category) != 3: - self.log_write_func('WARNING: INVALID LOG SUBSYSTEM %r\n' % category) + self.log_write_func('WARNING: INVALID LOGGING CATEGORY %r\n' % category) self.log_write_func('origin=%r category=%r level=%r\n' % (origin, category, level)); if not category: @@ -172,14 +206,13 @@ if self.do_log_origin: if origin is None: name = '-' - elif isinstance(origin, Origins): - name = origin[-1] - if len(origin) > 1: - deeper_origins = str(origin) + elif isinstance(origin, Origin): + name = origin.name() + # only log ancestry when there is more than one + if origin._parent is not None: + deeper_origins = origin.ancestry_str() elif isinstance(origin, str): name = origin or None - elif hasattr(origin, 'name'): - name = origin.name() if not name: name = str(origin.__class__.__name__) log_pre.append(self.origin_fmt.format(name)) @@ -228,7 +261,7 @@ def _log_all_targets(origin, category, level, src, messages, named_items=None): if origin is None: - origin = Origin._global_current_origin + origin = Origin.find_on_stack() if isinstance(src, int): src = get_src_from_caller(src + 1) for target in LogTarget.all_targets: @@ -242,13 +275,17 @@ caller = getframeinfo(stack()[levels_up][0]) return '%s:%d' % (os.path.basename(caller.filename), caller.lineno) -def get_src_from_tb(tb, levels_up=1): - ftb = traceback.extract_tb(tb) +def get_src_from_exc_info(exc_info=None, levels_up=1): + if exc_info is None: + exc_info = sys.exc_info() + ftb = traceback.extract_tb(exc_info[2]) f,l,m,c = ftb[-levels_up] f = os.path.basename(f) return '%s:%s: %s' % (f, l, c) def get_line_for_src(src_path): + '''find a given source file on the stack and return the line number for + that file. (Used to indicate the position in a test script.)''' etype, exception, tb = sys.exc_info() if tb: ftb = traceback.extract_tb(tb) @@ -262,31 +299,89 @@ return caller.lineno return None +class OriginLoopError(Error): + pass class Origin: ''' - Base class for all classes that want to log, - and to add an origin string to a code path: - with log.Origin('my name'): - raise Problem() - This will log 'my name' as an origin for the Problem. + Base class for all classes that want to appear in the log. + It is a simple named marker to find in the stack frames. + This depends on the object instance named 'self' in each member class. + + In addition, it provides a logging category and a globally unique ID for + each instance. ''' - _global_current_origin = None _global_id = None - _log_category = None - _src = None _name = None _origin_id = None + _log_category = None + _parent = None - _parent_origin = None + @staticmethod + def find_on_stack(except_obj=None, f=None): + if f is None: + f = sys._getframe(1) + log_ctx_obj = None + origin = None + while f is not None: + l = f.f_locals - def __init__(self, *name_items, category=None, **detail_items): - self.set_log_category(category) - self.set_name(*name_items, **detail_items) + # if there is a log_ctx in the scope, add it, pointing to the next + # actual Origin class in the stack + log_ctx = l.get('log_ctx') + if log_ctx: + if isinstance(log_ctx, Origin): + new_log_ctx_obj = log_ctx + else: + new_log_ctx_obj = Origin(None, log_ctx, find_parent=False) + if log_ctx_obj is None: + log_ctx_obj = new_log_ctx_obj + else: + log_ctx_obj.highest_ancestor()._set_parent(new_log_ctx_obj) - def set_name(self, *name_items, **detail_items): + obj = l.get('self') + if obj and isinstance(obj, Origin) and (except_obj is not obj): + origin = obj + break + f = f.f_back + + if (origin is not None) and (log_ctx_obj is not None): + log_ctx_obj.highest_ancestor()._set_parent(origin) + p = log_ctx_obj + while p: + p._set_log_category(origin._log_category) + p = p._parent + if log_ctx_obj is not None: + return log_ctx_obj + # may return None + return origin + + @staticmethod + def find_in_exc_info(exc_info): + tb = exc_info[2] + # get last tb ... I hope that's right + while tb.tb_next: + tb = tb.tb_next + return Origin.find_on_stack(f=tb.tb_frame) + + def __init__(self, category, *name_items, find_parent=True, **detail_items): + self._set_log_category(category) + self._set_name(*name_items, **detail_items) + if find_parent: + self._set_parent(Origin.find_on_stack(except_obj=self)) + + def _set_parent(self, parent): + # make sure to avoid loops + p = parent + while p: + if p is self: + raise OriginLoopError('Origin parent loop') + p = p._parent + self._parent = parent + + def _set_name(self, *name_items, **detail_items): if name_items: name = '-'.join([str(i) for i in name_items]) elif not detail_items: @@ -313,87 +408,43 @@ self._origin_id = '%s-%s' % (self.name(), Origin._global_id) return self._origin_id - def set_log_category(self, category): + def _set_log_category(self, category): self._log_category = category - - def _log(self, level, messages, named_items=None, src_levels_up=3, origins=None): - src = self._src or src_levels_up - origin = origins or self.gather_origins() - _log_all_targets(origin, self._log_category, level, src, messages, named_items) - - def dbg(self, *messages, **named_items): - self._log(L_DBG, messages, named_items) - - def log(self, *messages, **named_items): - self._log(L_LOG, messages, named_items) - - def err(self, *messages, **named_items): - self._log(L_ERR, messages, named_items) - - def trace(self, *messages, **named_items): - self._log(L_TRACEBACK, messages, named_items) - - def log_exn(self, exc_info=None): - log_exn(self, self._log_category, exc_info) - - def __enter__(self): - if not self.set_child_of(Origin._global_current_origin): - return self - Origin._global_current_origin = self - return self - - def __exit__(self, *exc_info): - rc = None - if exc_info[0] is not None: - rc = exn_add_info(exc_info, self) - Origin._global_current_origin, self._parent_origin = self._parent_origin, None - return rc - - def raise_exn(self, *messages, exn_class=Error, **named_items): - with self: - raise exn_class(compose_message(messages, named_items)) def redirect_stdout(self): return contextlib.redirect_stdout(SafeRedirectStdout(self)) - def gather_origins(self): - origins = Origins() - # this object shall always be seen as the immediate origin of the log message. - origins.add(self) - # now go through the parents of this object. - origin = self._parent_origin - # but if this object is "loose" and not set up with cascaded 'with' statements, - # take the last seen 'with' statement's object as next parent: - if origin is None and Origin._global_current_origin is not None: - origin = Origin._global_current_origin - # if this object is currently the _global_current_origin, we don't - # need to add it twice. - if origin is self: - origin = origin._parent_origin - # whichever we determined to be the parent above, go up through all its - # ancestors. - while origin is not None: - origins.add(origin) - origin = origin._parent_origin + def ancestry(self): + origins = [] + n = 10 + origin = self + while origin: + origins.insert(0, origin) + origin = origin._parent + n -= 1 + if n < 0: + break return origins - def set_child_of(self, parent_origin): - # avoid loops - assert self._parent_origin is None - assert parent_origin is not self - self._parent_origin = parent_origin - return True + def ancestry_str(self): + return '?'.join([o.name() for o in self.ancestry()]) -class LineInfo(Origin): - def __init__(self, src_file, *name_items, **detail_items): - self.src_file = src_file - self.set_name(*name_items, **detail_items) + def highest_ancestor(self): + if self._parent: + return self._parent.highest_ancestor() + return self - def name(self): - l = get_line_for_src(self.src_file) - if l is not None: - return '%s:%s' % (self._name, l) - return super().name() + def log(self, *messages, _src=3, **named_items): + '''same as log.log() but passes this object to skip looking up an origin''' + log(*messages, _origin=self, _src=_src, **named_items) + + def dbg(self, *messages, _src=3, **named_items): + '''same as log.dbg() but passes this object to skip looking up an origin''' + dbg(*messages, _origin=self, _src=_src, **named_items) + + def err(self, *messages, _src=3, **named_items): + '''same as log.err() but passes this object to skip looking up an origin''' + err(*messages, _origin=self, _src=_src, **named_items) class SafeRedirectStdout: ''' @@ -407,7 +458,7 @@ _log_line_buf = None def __init__(self, origin): - self._origin = origin + self.origin = origin def write(self, message): lines = message.splitlines() @@ -419,93 +470,34 @@ if not message.endswith('\n'): self._log_line_buf = lines[-1] lines = lines[:-1] - origins = self._origin.gather_origins() for line in lines: - self._origin._log(L_LOG, (line,), origins=origins) + _log(messages=(line,), + origin=self.origin, level=L_LOG, src=2) def __getattr__(self, name): return sys.__stdout__.__getattribute__(name) - -def dbg(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_DBG, 2, messages, named_items) - -def log(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_LOG, 2, messages, named_items) - -def err(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_ERR, 2, messages, named_items) - -def trace(origin, category, exc_info): - _log_all_targets(origin, category, L_TRACEBACK, None, - traceback.format_exception(*exc_info)) - -def resolve_category(origin, category): - if category is not None: - return category - if not hasattr(origin, '_log_category'): - return None - return origin._log_category - -def exn_add_info(exc_info, origin, category=None): - etype, exception, tb = exc_info - if not hasattr(exception, 'origins'): - exception.origins = Origins() - if not hasattr(exception, 'category'): - # only remember the deepest category - exception.category = resolve_category(origin, category) - if not hasattr(exception, 'src'): - exception.src = get_src_from_tb(tb) - exception.origins.add(origin) - return False - -def log_exn(origin=None, category=None, exc_info=None): - if not (exc_info is not None and len(exc_info) == 3): +def trace(exc_info=None, origin=None): + if exc_info is None: exc_info = sys.exc_info() - if not (exc_info is not None and len(exc_info) == 3): - raise RuntimeError('invalid call to log_exn() -- no valid exception info') + if origin is None: + origin = Origin.find_in_exc_info(exc_info) + _log(messages=traceback.format_exception(*exc_info), + origin=origin, level=L_TRACEBACK) + +def log_exn(): + exc_info = sys.exc_info() + origin = Origin.find_in_exc_info(exc_info) etype, exception, tb = exc_info - - # if there are origins recorded with the Exception, prefer that - if hasattr(exception, 'origins'): - origin = exception.origins - - # if there is a category recorded with the Exception, prefer that - if hasattr(exception, 'category'): - category = exception.category - if hasattr(exception, 'msg'): msg = exception.msg else: msg = str(exception) - if hasattr(exception, 'src'): - src = exception.src - else: - src = 2 - - trace(origin, category, exc_info) - _log_all_targets(origin, category, L_ERR, src, - ('%s:' % str(etype.__name__), msg)) - - -class Origins(list): - def __init__(self, origin=None): - if origin is not None: - self.add(origin) - - def add(self, origin): - if hasattr(origin, 'name'): - origin_str = origin.name() - else: - origin_str = repr(origin) - if origin_str is None: - raise RuntimeError('origin_str is None for %r' % origin) - self.insert(0, origin_str) - - def __str__(self): - return '?'.join(self) + trace(exc_info, origin=origin) + _log(messages=('%s:' % str(etype.__name__), msg), + origin=origin, level=L_ERR, src=get_src_from_exc_info(exc_info)) def set_all_levels(level): diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 83f3e0d..7a5682c 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -82,12 +82,14 @@ Related: https://github.com/LEW21/pydbus/issues/56 ''' + modem_path = None + watch_props_subscription = None + _dbus_obj = None + interfaces = None + def __init__(self, modem_path): self.modem_path = modem_path - self.set_name(self.modem_path) - self.set_log_category(log.C_BUS) - self.watch_props_subscription = None - self._dbus_obj = None + super().__init__(log.C_BUS, self.modem_path) self.interfaces = set() # A dict listing signal handlers to connect, e.g. @@ -118,7 +120,7 @@ try: return self.dbus_obj()[interface_name] except KeyError: - self.raise_exn('Modem interface is not available:', interface_name) + raise RuntimeError('Modem interface is not available:', interface_name) def signal(self, interface_name, signal): return getattr(self.interface(interface_name), signal) @@ -253,8 +255,7 @@ def __init__(self, conf): self.conf = conf self.path = conf.get('path') - self.set_name(self.path) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, self.path) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.dbus.required_signals = { @@ -312,8 +313,7 @@ def imsi(self): imsi = self.conf.get('imsi') if not imsi: - with self: - raise RuntimeError('No IMSI') + raise RuntimeError('No IMSI') return imsi def ki(self): diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 7753395..5447118 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -31,10 +31,9 @@ bts = None def __init__(self, suite_run, msc, ip_address): + super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-bsc_%s' % ip_address.get('addr')) self.bts = [] self.msc = msc diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 0b717fa..b5a947f 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -29,8 +29,7 @@ class OsmoCtrl(log.Origin): def __init__(self, host, port): - self.set_name('Ctrl', host=host, port=port) - self.set_log_category(log.C_BUS) + super().__init__(log.C_BUS, 'Ctrl', host=host, port=port) self.host = host self.port = port self.sck = None @@ -79,12 +78,10 @@ self._send(getmsg) def __enter__(self): - super().__enter__() self.connect() return self def __exit__(self, *exc_info): self.disconnect() - super().__exit__(*exc_info) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 3492f06..14505db 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -32,10 +32,9 @@ next_subscriber_id = 1 def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-hlr_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -47,16 +46,16 @@ binary = inst.child('bin', 'osmo-hlr') if not os.path.isfile(binary): - self.raise_exn('Binary missing:', binary) + raise log.Error('Binary missing:', binary) lib = inst.child('lib') if not os.path.isdir(lib): - self.raise_exn('No lib/ in', inst) + raise log.Error('No lib/ in', inst) # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') if not os.path.isfile(sql_input): - self.raise_exn('hlr.sql missing:', sql_input) + raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) iface = util.ip_to_iface(self.addr()) @@ -96,13 +95,13 @@ return not self.process.terminated() def run_local(self, name, popen_args): - with self: - run_dir = self.run_dir.new_dir(name) - proc = process.Process(name, run_dir, popen_args) - proc.launch() - proc.wait() - if proc.result != 0: - proc.raise_exn('Exited in error') + run_dir = self.run_dir.new_dir(name) + proc = process.Process(name, run_dir, popen_args) + proc.launch() + proc.wait() + if proc.result != 0: + log_ctx = proc + raise log.Error('Exited in error') def run_sql_file(self, name, sql_file): self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 3e722fb..b385274 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -30,10 +30,9 @@ process = None def __init__(self, suite_run, ip_address, bts_ip): + super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-mgcpgw_%s' % ip_address.get('addr')) # hack: so far mgcpgw needs one specific BTS IP. self.bts_ip = bts_ip diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2ef88df..829e20a 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -31,10 +31,9 @@ hlr = None def __init__(self, suite_run, hlr, mgcpgw, 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.set_log_category(log.C_RUN) - self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw @@ -89,12 +88,11 @@ def imsi_attached(self, *imsis): attached = self.imsi_list_attached() - self.dbg('attached:', attached) + log.dbg('attached:', attached) return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoMscCtrl(self).subscriber_list_active() + return OsmoMscCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -106,8 +104,7 @@ def __init__(self, msc): self.msc = msc - self.set_name('CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) - self.set_child_of(msc) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.msc.addr(), self.PORT) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..535f73a 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -32,10 +32,9 @@ bts = None def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -96,8 +95,7 @@ msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - with self: - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -108,8 +106,7 @@ return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoNitbCtrl(self).subscriber_list_active() + return OsmoNitbCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -123,8 +120,7 @@ def __init__(self, nitb): self.nitb = nitb - self.set_name('CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) - self.set_child_of(nitb) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.nitb.addr(), OsmoNitbCtrl.PORT) diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index f3b1e6a..398ec6c 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -27,14 +27,13 @@ class PcapRecorder(log.Origin): def __init__(self, suite_run, run_dir, iface=None, filters=''): - self.suite_run = suite_run - self.run_dir = run_dir self.iface = iface if not self.iface: self.iface = "any" self.filters = filters - self.set_log_category(log.C_RUN) - self.set_name('pcap-recorder_%s' % self.iface) + super().__init__(log.C_RUN, 'pcap-recorder_%s' % self.iface, filters=self.filters) + self.suite_run = suite_run + self.run_dir = run_dir self.start() def start(self): diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e5d38f3..99e94ba 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -33,9 +33,8 @@ killed = None def __init__(self, name, run_dir, popen_args, **popen_kwargs): + super().__init__(log.C_RUN, name) self.name_str = name - self.set_name(name) - self.set_log_category(log.C_RUN) self.run_dir = run_dir self.popen_args = popen_args self.popen_kwargs = popen_kwargs @@ -62,23 +61,21 @@ return f def launch(self): - with self: + log.dbg('cd %r; %s %s' % ( + os.path.abspath(str(self.run_dir)), + ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), + ' '.join(self.popen_args))) - self.dbg('cd %r; %s %s' % ( - os.path.abspath(str(self.run_dir)), - ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), - ' '.join(self.popen_args))) - - self.process_obj = subprocess.Popen( - self.popen_args, - stdout=self.make_output_log('stdout'), - stderr=self.make_output_log('stderr'), - stdin=subprocess.PIPE, - shell=False, - cwd=self.run_dir.path, - **self.popen_kwargs) - self.set_name(self.name_str, pid=self.process_obj.pid) - self.log('Launched') + self.process_obj = subprocess.Popen( + self.popen_args, + stdout=self.make_output_log('stdout'), + stderr=self.make_output_log('stderr'), + stdin=subprocess.PIPE, + shell=False, + cwd=self.run_dir.path, + **self.popen_kwargs) + self._set_name(self.name_str, pid=self.process_obj.pid) + self.log('Launched') def _poll_termination(self, time_to_wait_for_term=5): wait_step = 0.001 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7cc32bb..a67ce0f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -83,7 +83,7 @@ def __init__(self): self.config_path = config.get_config_file(RESOURCES_CONF) self.state_dir = config.get_state_dir() - self.set_name(conf=self.config_path, state=self.state_dir.path) + super().__init__(log.C_CNF, conf=self.config_path, state=self.state_dir.path) self.read_conf() def read_conf(self): @@ -158,6 +158,7 @@ return ReservedResources(self, origin, to_be_reserved) def free(self, origin, to_be_freed): + log_ctx = origin with self.state_dir.lock(origin.origin_id()): rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE) reserved = Resources(config.read(rrfile_path, if_missing_return={})) @@ -202,19 +203,19 @@ with self.state_dir.lock(origin_id): msisdn_path = self.state_dir.child(LAST_USED_MSISDN_FILE) - with log.Origin(msisdn_path): - last_msisdn = '1000' - if os.path.exists(msisdn_path): - if not os.path.isfile(msisdn_path): - raise RuntimeError('path should be a file but is not: %r' % msisdn_path) - with open(msisdn_path, 'r') as f: - last_msisdn = f.read().strip() - schema.msisdn(last_msisdn) + log_ctx = msisdn_path + last_msisdn = '1000' + if os.path.exists(msisdn_path): + if not os.path.isfile(msisdn_path): + raise RuntimeError('path should be a file but is not: %r' % msisdn_path) + with open(msisdn_path, 'r') as f: + last_msisdn = f.read().strip() + schema.msisdn(last_msisdn) - next_msisdn = util.msisdn_inc(last_msisdn) - with open(msisdn_path, 'w') as f: - f.write(next_msisdn) - return next_msisdn + next_msisdn = util.msisdn_inc(last_msisdn) + with open(msisdn_path, 'w') as f: + f.write(next_msisdn) + return next_msisdn class NoResourceExn(Exception): diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index fb27f32..00facc4 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -124,9 +124,9 @@ validate_item(path, list_v, schema) return - with log.Origin(item=path): - type_validator = SCHEMA_TYPES.get(want_type) - type_validator(value) + log_ctx = path + type_validator = SCHEMA_TYPES.get(want_type) + type_validator(value) def nest(parent_path, config, schema): if parent_path: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 55f81b1..fe1ac03 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -49,9 +49,8 @@ def __init__(self, suite_dir): - self.set_log_category(log.C_CNF) self.suite_dir = suite_dir - self.set_name(os.path.basename(self.suite_dir)) + super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) self.read_conf() def read_conf(self): @@ -78,12 +77,10 @@ FAIL = 'FAIL' def __init__(self, suite_run, test_basename): - self.suite_run = suite_run self.basename = test_basename + super().__init__(log.C_TST, self.basename) + self.suite_run = suite_run self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) - super().__init__(self.path) - self.set_name(self.basename) - self.set_log_category(log.C_TST) self.status = Test.UNKNOWN self.start_timestamp = 0 self.duration = 0 @@ -92,16 +89,15 @@ def run(self): try: - with self: - log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() except Exception as e: if hasattr(e, 'msg'): msg = e.msg @@ -110,14 +106,14 @@ if isinstance(e, AssertionError): # AssertionError lacks further information on what was # asserted. Find the line where the code asserted: - msg += log.get_src_from_tb(sys.exc_info()[2]) + msg += log.get_src_from_exc_info(sys.exc_info()) # add source file information to failure report if hasattr(e, 'origins'): msg += ' [%s]' % e.origins tb_str = traceback.format_exc() if isinstance(e, resource.NoResourceExn): tb_str += self.suite_run.resource_status_str() - self.set_fail(type(e).__name__, msg, tb_str) + self.set_fail(type(e).__name__, msg, tb_str, log.get_src_from_exc_info()) except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TEST RUN ABORTED: %s' % type(e).__name__) @@ -129,7 +125,7 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb_str=None): + def set_fail(self, fail_type, fail_message, tb_str=None, src=4): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type @@ -140,9 +136,9 @@ tb_str = ''.join(traceback.format_stack()[:-1]) self.fail_tb = tb_str - self.err('%s: %s' % (self.fail_type, self.fail_message)) + self.err('%s: %s' % (self.fail_type, self.fail_message), _src=src) if self.fail_tb: - self.trace(self.fail_tb) + self.log(self.fail_tb, _level=log.L_TRACEBACK) self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): @@ -171,11 +167,10 @@ _processes = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + super().__init__(log.C_TST, suite_scenario_str) self.trial = trial self.definition = suite_definition self.scenarios = scenarios - self.set_name(suite_scenario_str) - self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() @@ -201,18 +196,18 @@ self.status = SuiteRun.UNKNOWN def combined(self, conf_name): - self.dbg(combining=conf_name) - with log.Origin(combining_scenarios=conf_name): - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) - self.dbg(definition_conf=combination) - for scenario in self.scenarios: - with scenario: - c = scenario.get(conf_name) - self.dbg(scenario=scenario.name(), conf=c) - if c is None: - continue - config.combine(combination, c) - return combination + log.dbg(combining=conf_name) + log_ctx = 'combining_scenarios=%r' % conf_name + combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + log.dbg(definition_conf=combination) + for scenario in self.scenarios: + log_ctx = '{combining_scenarios=%r, %s}' % (conf_name, scenario.name()) + c = scenario.get(conf_name) + log.dbg(scenario=scenario.name(), conf=c) + if c is None: + continue + config.combine(combination, c) + return combination def resource_requirements(self): if self._resource_requirements is None: @@ -232,19 +227,18 @@ def run_tests(self, names=None): try: - with self: - log.large_separator(self.trial.name(), self.name(), sublevel=2) - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.tests: - if names and not test.name() in names: - test.set_skip() - continue - test.run() + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() except Exception: - self.log_exn() + log.log_exn() except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('SUITE RUN ABORTED: %s' % type(e).__name__) @@ -355,7 +349,8 @@ if process.terminated(): process.log_stdout_tail() process.log_stderr_tail() - process.raise_exn('Process ended prematurely') + log_ctx = process + raise log.Error('Process ended prematurely') def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index 33ce2f6..4d8ed2a 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -26,7 +26,7 @@ from .util import dict2obj _lookup = None -_logger = log.Origin('no templates dir set') +_logger = log.Origin(log.C_CNF, 'no templates dir set') def set_templates_dir(*templates_dirs): global _lookup @@ -39,7 +39,7 @@ raise RuntimeError('templates dir is not a dir: %r' % os.path.abspath(d)) _lookup = TemplateLookup(directories=templates_dirs) - _logger = log.Origin('Templates', category=log.C_CNF) + _logger = log.Origin(log.C_CNF, 'Templates') def render(name, values): '''feed values dict into template and return rendered result. @@ -48,11 +48,11 @@ if _lookup is None: set_templates_dir() tmpl_name = name + '.tmpl' - with log.Origin(tmpl_name): - template = _lookup.get_template(tmpl_name) - _logger.dbg('rendering', tmpl_name) + log_ctx = tmpl_name + template = _lookup.get_template(tmpl_name) + _logger.dbg('rendering', tmpl_name) - line_info_name = tmpl_name.replace('-', '_').replace('.', '_') - return template.render(**dict2obj(values)) + line_info_name = tmpl_name.replace('-', '_').replace('.', '_') + return template.render(**dict2obj(values)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..679ba96 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -24,9 +24,6 @@ suite = None test = None resources = None -log = None -dbg = None -err = None wait = None wait_no_raise = None sleep = None @@ -40,9 +37,6 @@ suite = suite_run test = _test resources = suite_run.reserved_resources - log = test.log - dbg = test.dbg - err = test.err wait = lambda *args, **kwargs: event_module.wait(suite_run, *args, **kwargs) wait_no_raise = lambda *args, **kwargs: event_module.wait_no_raise(suite_run, *args, **kwargs) sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs) diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 741f3a7..d54e96c 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -57,8 +57,7 @@ def __init__(self, trial_dir): self.path = os.path.abspath(trial_dir) - self.set_name(os.path.basename(self.path)) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, os.path.basename(self.path)) self.dir = util.Dir(self.path) self.inst_dir = util.Dir(self.dir.child('inst')) self.bin_tars = [] @@ -69,7 +68,8 @@ return self.name() def __enter__(self): - # add a log target to log to the run dir + '''add a log target to log to the run dir, write taken marker, log a + starting separator.''' run_dir = self.get_run_dir() detailed_log = run_dir.new_child(FILE_LOG) self.log_targets = [ @@ -82,11 +82,10 @@ log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() - super().__enter__() return self def __exit__(self, *exc_info): - super().__exit__(*exc_info) + '''log a report, then remove log file targets for this trial''' self.log_report() for lt in self.log_targets: lt.remove() @@ -195,6 +194,8 @@ except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + # log the traceback before the trial's logging is ended + log.log_exn() raise finally: if suite_run.status != suite.SuiteRun.PASS: -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 14:32:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 14:32:50 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: log.Origin: ensure to avoid parent loops In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: log.Origin: ensure to avoid parent loops ...................................................................... Abandoned combined with patch #2886 to satisfy unit tests -- To view, visit https://gerrit.osmocom.org/2887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I10a2f956beeda38ba1378eace9453eb911aae1a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 14:33:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:33:53 +0000 Subject: libosmocore[master]: gsm0503_coding: Mark gsm0503_mcs_{ul, dl}_codes as const In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511 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 Jun 12 14:34:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:04 +0000 Subject: libosmocore[master]: gsm0503_interleaving: Mark input arguments as 'const *' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9 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 Jun 12 14:34:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:09 +0000 Subject: libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 14:34:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:34 +0000 Subject: libosmocore[master]: Add doxygen documentation to libosmocoding In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74 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 Jun 12 14:34:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:36 +0000 Subject: [MERGED] libosmocore[master]: Add doxygen documentation to libosmocoding In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add doxygen documentation to libosmocoding ...................................................................... Add doxygen documentation to libosmocoding This adds the minimum amount of API documentation that we should have on all our code, particularly new code merged into a library. Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74 --- M Doxyfile.coding.in M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c 11 files changed, 465 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in index d73e6cd..28e3241 100644 --- a/Doxyfile.coding.in +++ b/Doxyfile.coding.in @@ -37,7 +37,7 @@ # 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 L1 transcoding library" +PROJECT_BRIEF = "Osmocom GSM/GPRS/EGPRS L1 channel coding 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 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index f6591f5..55375bb 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -3,6 +3,14 @@ #include #include +/*! \addtogroup coding + * @{ + */ + +/*! \file gsm0503_coding.h + * \brief GSM TS 05.03 coding + */ + #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) #define NUM_BYTES(N) ((N + 8 - 1) / 8) @@ -61,3 +69,5 @@ int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index f97dff4..85c7328 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -2,6 +2,14 @@ #include +/*! \addtogroup interleaving + * @{ + */ + +/*! \file gsm0503_interleaving.h + * \brief GSM TS 05.03 interleaving + */ + void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB); @@ -49,3 +57,5 @@ const sbit_t *hi, const sbit_t *di); void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di); + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 93e4b67..6e139bf 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -2,6 +2,14 @@ #include +/*! \addtogroup mapping + * @{ + */ + +/*! \file gsm0503_mapping.c + * \brief GSM TS 05.03 burst mapping + */ + void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, @@ -31,3 +39,5 @@ sbit_t *hi, sbit_t *up, int B); void gsm0503_mcs5_burst_swap(sbit_t *eB); + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_parity.h b/include/osmocom/coding/gsm0503_parity.h index 540124a..f844720 100644 --- a/include/osmocom/coding/gsm0503_parity.h +++ b/include/osmocom/coding/gsm0503_parity.h @@ -2,6 +2,14 @@ #include +/*! \addtogroup parity + * @{ + */ + +/*! \file gsm0503_parity.h + * \brief GSM TS 05.03 parity + */ + const struct osmo_crc64gen_code gsm0503_fire_crc40; const struct osmo_crc16gen_code gsm0503_cs234_crc16; const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr; @@ -11,3 +19,5 @@ const struct osmo_crc8gen_code gsm0503_tch_fr_crc3; const struct osmo_crc8gen_code gsm0503_tch_efr_crc8; const struct osmo_crc8gen_code gsm0503_amr_crc6; + +/*! @} */ diff --git a/include/osmocom/coding/gsm0503_tables.h b/include/osmocom/coding/gsm0503_tables.h index e6761ca..4622cae 100644 --- a/include/osmocom/coding/gsm0503_tables.h +++ b/include/osmocom/coding/gsm0503_tables.h @@ -3,6 +3,14 @@ #include #include +/*! \addtogroup tables + * @{ + */ + +/*! \file gsm0503_tables.h + * \brief GSM TS 05.03 tables + */ + extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8]; extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8]; extern const sbit_t gsm0503_pdtch_hl_hn_sbit[4][8]; @@ -48,3 +56,5 @@ extern const sbit_t gsm0503_ahs_ic_sbit[4][4]; extern const uint8_t gsm0503_tch_hr_interleaving[228][2]; extern const ubit_t gsm0503_mcs5_usf_precode_table[8][36]; + +/*! @} */ diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index d752454..bf4df1c 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -2,6 +2,7 @@ * (C) 2013 by Andreas Eversberg * (C) 2015 by Alexander Chemeris * (C) 2016 by Tom Tsou + * (C) 2017 by Harald Welte * * All Rights Reserved * @@ -45,6 +46,64 @@ #include #include +/*! \mainpage libosmocoding Documentation + * + * \section sec_intro Introduction + * This library is a collection of definitions, tables and functions + * implementing the GSM/GPRS/EGPRS channel coding (and decoding) as + * specified in 3GPP TS 05.03 / 45.003. + * + * libosmocodec is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * + * \section sec_copyright Copyright and License + * Copyright ? 2013 by Andreas Eversberg\n + * Copyright ? 2015 by Alexander Chemeris\n + * Copyright ? 2016 by Tom Tsou\n + * Documentation Copyright ? 2017 by Harald Welte\n + * All rights reserved. \n\n + * The source code of libosmocoding is licensed 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.\n + * See or COPYING included in the source + * code package istelf.\n + * The information detailed here is provided AS IS with NO WARRANTY OF + * ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. + * \n\n + * + * \section sec_tracker Homepage + Issue Tracker + * libosmocoding is distributed as part of libosmocore and shares its + * project page at http://osmocom.org/projects/libosmocore + * + * An Issue Tracker can be found at + * https://osmocom.org/projects/libosmocore/issues + * + * \section sec_contact Contact and Support + * Community-based support is available at the OpenBSC mailing list + * \n + * Commercial support options available upon request from + * + */ + + +/*! \addtogroup coding + * @{ + * + * \brief GSM TS 05.03 coding + * + * This module is the "master module" of libosmocoding. It uses the + * various other modules (mapping, parity, interleaving) in order to + * implement the complete channel coding (and decoding) chain for the + * various channel types as defined in TS 05.03 / 45.003. + */ + +/*! \file gsm0503_coding.c */ + /* * EGPRS coding limits */ @@ -78,34 +137,49 @@ /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ #define GSM_EFR_BYTES 31 +/*! \brief union across the three different EGPRS Uplink header types */ union gprs_rlc_ul_hdr_egprs { struct gprs_rlc_ul_header_egprs_1 type1; struct gprs_rlc_ul_header_egprs_2 type2; struct gprs_rlc_ul_header_egprs_3 type3; }; +/*! \brief union across the three different EGPRS Downlink header types */ union gprs_rlc_dl_hdr_egprs { struct gprs_rlc_dl_header_egprs_1 type1; struct gprs_rlc_dl_header_egprs_2 type2; struct gprs_rlc_dl_header_egprs_3 type3; }; +/*! \brief Structure describing a Modulation and Coding Scheme */ struct gsm0503_mcs_code { + /*! \brief Modulation and Coding Scheme (MSC) number */ uint8_t mcs; + /*! \brief Length of Uplink Stealing Flag (USF) in bits */ uint8_t usf_len; /* Header coding */ + /*! \brief Length of header (bits) */ uint8_t hdr_len; + /*! \brief Length of header convolutional code */ uint8_t hdr_code_len; + /*! \brief Length of header code puncturing sequence */ uint8_t hdr_punc_len; + /*! \brief header convolutional code */ const struct osmo_conv_code *hdr_conv; + /*! \brief header puncturing sequence */ const uint8_t *hdr_punc; /* Data coding */ + /*! \brief length of data (bits) */ uint16_t data_len; + /*! \brief length of data convolutional code */ uint16_t data_code_len; + /*! \brief length of data code puncturing sequence */ uint16_t data_punc_len; + /*! \brief data convolutional code */ const struct osmo_conv_code *data_conv; + /*! \brief data puncturing sequences */ const uint8_t *data_punc[3]; }; @@ -460,6 +534,13 @@ }, }; +/*! \brief Convolutional Decode + compute BER + * \param[in] code Description of Convolutional Code + * \param[in] input Input soft-bits (-127...127) + * \param[out] output bits + * \param[out] n_errors Number of bit-errors + * \param[out] n_bits_total Number of bits + */ static int osmo_conv_decode_ber(const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output, int *n_errors, int *n_bits_total) @@ -490,6 +571,12 @@ return res; } +/*! \brief convenience wrapper for decoding coded bits + * \param[out] l2_data caller-allocated buffer for L2 Frame + * \param[in] cB 456 coded (soft) bits as per TS 05.03 4.1.3 + * \param[out] n_errors Number of detected errors + * \param[out] n_bits_total Number of total coded bits + * \returns 0 on success; -1 on CRC error */ static int _xcch_decode_cB(uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) { @@ -509,6 +596,10 @@ return 0; } +/*! \brief convenience wrapper for encoding to coded bits + * \param[out] cB caller-allocated buffer for 456 coded bits as per TS 05.03 4.1.3 + * \param[out] l2_data to-be-encoded L2 Frame + * \returns 0 */ static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data) { ubit_t conv[224]; @@ -525,6 +616,13 @@ /* * GSM xCCH block transcoding */ + +/*! \brief Decoding of xCCH data from bursts to L2 frame + * \param[out] l2_data caller-allocated output data buffer + * \param[in] bursts four GSM bursts in soft-bits + * \param[out] n_errors Number of detected errors + * \param[out] n_bits_total Number of total coded bits + */ int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { @@ -539,6 +637,11 @@ return _xcch_decode_cB(l2_data, cB, n_errors, n_bits_total); } +/*! \brief Encoding of xCCH data from L2 frame to bursts + * \param[out] bursts caller-allocated burst data (unpacked bits) + * \param[in] l2_data L2 input data (MAC block) + * \returns 0 + */ int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data) { ubit_t iB[456], cB[456], hl = 1, hn = 1; @@ -801,14 +904,18 @@ return NUM_BYTES(code->hdr_len + code->data_len); } -/* - * Decode EGPRS UL message - * - * 1. Header section decoding - * 2. Extract CPS settings - * 3. Burst unmapping and deinterleaving - * 4. Data section decoding - */ +/*! \brief Decode EGPRS UL message + * 1. Header section decoding + * 2. Extract CPS settings + * 3. Burst unmapping and deinterleaving + * 4. Data section decoding + * \param[out] l2_data caller-allocated buffer for L2 Frame + * \param[in] bursts burst input data as soft unpacked bits + * \param[in] nbits number of bits in \a bursts + * \param usf_p unused argument ?!? + * \param[out] n_errors number of detected bit-errors + * \param[out] n_bits_total total number of dcoded bits + * \returns 0 on success; negative on error */ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) { @@ -879,6 +986,13 @@ * GSM PDTCH block transcoding */ +/*! \brief Decode GPRS PDTCH + * \param[out] l2_data caller-allocated buffer for L2 Frame + * \param[in] bursts burst input data as soft unpacked bits + * \param[out] usf_p uplink stealing flag + * \param[out] n_errors number of detected bit-errors + * \param[out] n_bits_total total number of dcoded bits + * \returns 0 on success; negative on error */ int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) { @@ -1189,9 +1303,11 @@ return egprs_get_cps(cps, type, bits); } -/* - * EGPRS DL message encoding - */ +/*! \brief EGPRS DL message encoding + * \param[out] bursts caller-allocated buffer for unpacked burst bits + * \param[in] l2_data L2 (MAC) block to be encoded + * \param[in] l2_len length of l2_data in bytes, used to determine MCS + * \returns 0 on success; negative on error */ int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { @@ -1282,6 +1398,11 @@ return -1; } +/*! \brief GPRS DL message encoding + * \param[out] bursts caller-allocated buffer for unpacked burst bits + * \param[in] l2_data L2 (MAC) block to be encoded + * \param[in] l2_len length of l2_data in bytes, used to determine CS + * \returns 0 on success; negative on error */ int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { ubit_t iB[456], cB[676]; @@ -1366,6 +1487,10 @@ * GSM TCH/F FR/EFR transcoding */ +/*! \brief assemble a FR codec frame in format as used inside RTP + * \param[out] tch_data Codec frame in RTP format + * \param[in] b_bits Codec frame in 'native' format + * \param[in] net_order FIXME */ static void tch_fr_reassemble(uint8_t *tch_data, const ubit_t *b_bits, int net_order) { @@ -1426,6 +1551,7 @@ } } +/* assemble a HR codec frame in format as used inside RTP */ static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1445,6 +1571,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } +/* assemble a EFR codec frame in format as used inside RTP */ static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1464,6 +1591,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } +/* assemble a AMR codec frame in format as used inside RTP */ static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len) { int i, j; @@ -1482,6 +1610,7 @@ d_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } +/* re-arrange according to TS 05.03 Table 2 (receiver) */ static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1490,6 +1619,7 @@ b_bits[gsm610_bitorder[i]] = d_bits[i]; } +/* re-arrange according to TS 05.03 Table 2 (transmitter) */ static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1498,6 +1628,7 @@ d_bits[i] = b_bits[gsm610_bitorder[i]]; } +/* re-arrange according to TS 05.03 Table 3a (receiver) */ static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1513,6 +1644,7 @@ b_bits[map[i]] = d_bits[i]; } +/* re-arrange according to TS 05.03 Table 3a (transmitter) */ static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1527,6 +1659,7 @@ d_bits[i] = b_bits[map[i]]; } +/* re-arrange according to TS 05.03 Table 6 (receiver) */ static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1535,6 +1668,7 @@ b_bits[gsm660_bitorder[i]] = d_bits[i]; } +/* re-arrange according to TS 05.03 Table 6 (transmitter) */ static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1543,6 +1677,7 @@ d_bits[i] = b_bits[gsm660_bitorder[i]]; } +/* extract the 65 protected class1a+1b bits */ static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits) { int i; @@ -1637,6 +1772,14 @@ memcpy(d + prot, u + prot + 6, len - prot); } +/*! \brief Perform channel decoding of a FR/EFR channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] net_order FIXME + * \param[in] efr Is this channel using EFR (1) or FR (0) + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { @@ -1644,13 +1787,17 @@ ubit_t conv[185], s[244], w[260], b[65], d[260], p[8]; int i, rv, len, steal = 0; + /* map from 8 bursts to interleaved data bits (iB) */ for (i = 0; i < 8; i++) { gsm0503_tch_burst_unmap(&iB[i * 114], &bursts[i * 116], &h, i >> 2); steal -= h; } + /* we now have the bits of the four bursts (interface 4 in + * Figure 1a of TS 05.03 */ gsm0503_tch_fr_deinterleave(cB, iB); + /* we now have the coded bits c(B): interface 3 in Fig. 1a */ if (steal > 0) { rv = _xcch_decode_cB(tch_data, cB, n_errors, n_bits_total); @@ -1663,12 +1810,15 @@ } osmo_conv_decode_ber(&gsm0503_tch_fr, cB, conv, n_errors, n_bits_total); + /* we now have the data bits 'u': interface 2 in Fig. 1a */ + /* input: 'conv', output: d[ata] + p[arity] */ tch_fr_unreorder(d, p, conv); for (i = 0; i < 78; i++) d[i + 182] = (cB[i + 378] < 0) ? 1 : 0; + /* check if parity of first 50 (class 1) 'd'-bits match 'p' */ rv = osmo_crc8gen_check_bits(&gsm0503_tch_fr_crc3, d, 50, p); if (rv) { /* Error checking CRC8 for the FR part of an EFR/FR frame */ @@ -1677,11 +1827,17 @@ if (efr) { tch_efr_d_to_w(w, d); + /* we now have the preliminary-coded bits w(k) */ tch_efr_unreorder(s, p, w); + /* we now have the data delivered to the preliminary + * channel encoding unit s(k) */ + /* extract the 65 most important bits according TS 05.03 3.1.1.1 */ tch_efr_protected(s, b); + /* perform CRC-8 on 65 most important bits (50 bits of + * class 1a + 15 bits of class 1b) */ rv = osmo_crc8gen_check_bits(&gsm0503_tch_efr_crc8, b, 65, p); if (rv) { /* Error checking CRC8 for the EFR part of an EFR frame */ @@ -1702,6 +1858,12 @@ return len; } +/*! \brief Perform channel encoding on a TCH/FS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \param[in] net_order FIXME + * \returns 0 in case of success; negative on error */ int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) { @@ -1760,6 +1922,13 @@ return 0; } +/*! \brief Perform channel decoding of a HR(v1) channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] odd Odd (1) or even (0) frame number + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { @@ -1830,6 +1999,11 @@ return 15; } +/*! \brief Perform channel encoding on a TCH/HS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \returns 0 in case of success; negative on error */ int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len) { ubit_t iB[912], cB[456], h; @@ -1885,6 +2059,17 @@ return 0; } +/*! \brief Perform channel decoding of a TCH/AFS channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] codec_mode_req is this CMR (1) or CMC (0) + * \param[in] codec array of active codecs (active codec set) + * \param[in] codecs number of codecs in \a codec + * \param ft Frame Type; Input if \a codec_mode_req = 1, Output * otherwise + * \param[out] cmr Output in \a codec_mode_req = 1 + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) @@ -2080,6 +2265,16 @@ return len; } +/*! \brief Perform channel encoding on a TCH/AFS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \param[in] codec_mode_req Use CMR (1) or FT (0) + * \param[in] codec Array of codecs (active codec set) + * \param[in] codecs Number of entries in \a codec + * \param[in] ft Frame Type to be used for encoding (index to \a codec) + * \param[in] cmr Codec Mode Request (used in codec_mode_req = 1 only) + * \returns 0 in case of success; negative on error */ int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) @@ -2240,6 +2435,18 @@ return -1; } +/*! \brief Perform channel decoding of a TCH/AFS channel according TS 05.03 + * \param[out] tch_data Codec frame in RTP payload format + * \param[in] bursts buffer containing the symbols of 8 bursts + * \param[in] odd Is this an odd (1) or even (0) frame number? + * \param[in] codec_mode_req is this CMR (1) or CMC (0) + * \param[in] codec array of active codecs (active codec set) + * \param[in] codecs number of codecs in \a codec + * \param ft Frame Type; Input if \a codec_mode_req = 1, Output * otherwise + * \param[out] cmr Output in \a codec_mode_req = 1 + * \param[out] n_errors Number of detected bit errors + * \param[out] n_bits_total Total number of bits + * \returns length of bytes used in \a tch_data output buffer */ int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) @@ -2443,6 +2650,16 @@ return len; } +/*! \brief Perform channel encoding on a TCH/AHS channel according to TS 05.03 + * \param[out] bursts caller-allocated output buffer for bursts bits + * \param[in] tch_data Codec input data in RTP payload format + * \param[in] len Length of \a tch_data in bytes + * \param[in] codec_mode_req Use CMR (1) or FT (0) + * \param[in] codec Array of codecs (active codec set) + * \param[in] codecs Number of entries in \a codec + * \param[in] ft Frame Type to be used for encoding (index to \a codec) + * \param[in] cmr Codec Mode Request (used in codec_mode_req = 1 only) + * \returns 0 in case of success; negative on error */ int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) @@ -2617,6 +2834,11 @@ return 0; } +/*! \brief Decode the (8-bit) RACH according to TS 05.03 + * \param[out] ra output buffer for RACH data + * \param[in] burst Input burst data + * \param[in] bsic BSIC used in this cell + * \returns 0 on success; negative on error (e.g. CRC error) */ int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) { ubit_t conv[14]; @@ -2635,6 +2857,11 @@ return 0; } +/*! \brief Encode the (8-bit) RACH according to TS 05.03 + * \param[out] burst Caller-allocated output burst buffer + * \param[in] ra Input RACH data + * \param[in] bsic BSIC used in this cell + * \returns 0 on success; negative on error */ int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) { ubit_t conv[14]; @@ -2653,6 +2880,11 @@ /* * GSM SCH transcoding */ + +/*! \brief Decode the SCH according to TS 05.03 + * \param[out] sb_info output buffer for SCH data + * \param[in] burst Input burst data + * \returns 0 on success; negative on error (e.g. CRC error) */ int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst) { ubit_t conv[35]; @@ -2669,6 +2901,10 @@ return 0; } +/*! \brief Encode the SCH according to TS 05.03 + * \param[out] burst Caller-allocated output burst buffer + * \param[in] sb_info Input SCH data + * \returns 0 on success; negative on error */ int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info) { ubit_t conv[35]; @@ -2681,3 +2917,5 @@ return 0; } + +/*! @} */ diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 22ad6f6..61d4fdc 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -1,6 +1,7 @@ /* * (C) 2013 by Andreas Eversberg * (C) 2016 by Tom Tsou + * (C) 2017 by Hrald Welte * * All Rights Reserved * @@ -26,6 +27,16 @@ #include #include +/*! \addtogroup interleaving + * @{ + * \brief GSM TS 05.03 interleaving + * + * This module contains interleaving / de-interleaving routines for + * various channel types, as defined in 3GPP TS 05.03 / 45.003 + */ + +/*! \file gsm0503_interleaving.c */ + /* * GSM xCCH interleaving and burst mapping * @@ -48,6 +59,9 @@ * Where hl(B) and hn(B) are bits in burst B indicating flags. */ +/*! \brief De-Interleave burst bits according to TS 05.03 4.1.4 + * \param[out] cB caller-allocated output buffer for 456 soft coded bits + * \param[in] iB 456 soft input bits */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB) { int j, k, B; @@ -59,6 +73,9 @@ } } +/*! \brief Interleave burst bits according to TS 05.03 4.1.4 + * \param[out] iB caller-allocated output buffer for 456 soft interleaved bits + * \param[in] cB 456 soft input coded bits */ void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -70,6 +87,11 @@ } } +/*! \brief De-Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5 + * \param[out] u caller-allocated output buffer for 12 soft coded bits + * \param[out] hc caller-allocated output buffer for 68 soft coded bits + * \param[out] dc caller-allocated output buffer for 372 soft coded bits + * \param[in] iB 452 interleaved soft input bits */ void gsm0503_mcs1_dl_deinterleave(sbit_t *u, sbit_t *hc, sbit_t *dc, const sbit_t *iB) { @@ -106,6 +128,11 @@ } } +/*! \brief Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5 + * \param[in] up 12 input soft coded bits (usf) + * \param[in] hc 68 input soft coded bits (header) + * \param[in] dc 372 input soft bits (data) + * \param[out] iB 456 interleaved soft output bits */ void gsm0503_mcs1_dl_interleave(const ubit_t *up, const ubit_t *hc, const ubit_t *dc, ubit_t *iB) { @@ -139,6 +166,10 @@ gsm0503_xcch_interleave(cp, iB); } +/*! \brief Interleave MCS1 UL burst bits according to TS 05.03 5.1.5.2.4 + * \param[out] hc caller-allocated output buffer for 80 soft coded header bits + * \param[out] dc caller-allocated output buffer for 372 soft coded data bits + * \param[in] iB 456 interleaved soft input bits */ void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB) { int k; @@ -169,6 +200,10 @@ } } +/*! \brief Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.2.4 + * \param[in] hc 80 input coded bits (header) + * \param[in] dc 372 input bits (data) + * \param[out] iB 456 interleaved output bits */ void gsm0503_mcs1_ul_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *iB) { int k; @@ -199,6 +234,11 @@ gsm0503_xcch_interleave(cp, iB); } +/*! \brief Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4 + * \param[in] hc 136 soft coded header input bits + * \param[in] dc 1248 soft coded data input bits + * \param[out] hi 136 interleaved header output bits + * \param[out] di 1248 interleaved data output bits */ void gsm0503_mcs5_ul_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di) { @@ -217,6 +257,10 @@ } } +/*! \brief De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4 + * \param[out] hc caller-allocated output buffer for 136 soft coded header bits + * \param[out] dc caller-allocated output buffer for 1248 soft coded data bits + * \param[in] iB interleaved soft input bits */ void gsm0503_mcs5_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di) { @@ -239,6 +283,11 @@ } } +/*! \brief Interleave MCS5 DL burst bits according to TS 05.03 5.1.9.1.5 + * \param[in] hc 100 soft coded header input bits + * \param[in] dc 1248 soft coded data input bits + * \param[out] hi 100 interleaved header output bits + * \param[out] di 1248 interleaved data output bits */ void gsm0503_mcs5_dl_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di) { @@ -257,6 +306,10 @@ } } +/*! \brief De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.1.5 + * \param[out] hc caller-allocated output buffer for 100 soft coded header bits + * \param[out] dc caller-allocated output buffer for 1248 soft coded data bits + * \param[in] iB interleaved soft input bits */ void gsm0503_mcs5_dl_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di) { @@ -279,6 +332,12 @@ } } +/*! \brief Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5 + * \param[in] hc 124 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 124 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs7_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -302,7 +361,12 @@ } } - +/*! \brief De-Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5 + * \param[out] hc caller-allocated output buffer for 124 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs7_dl_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -330,6 +394,12 @@ } } +/*! \brief Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4 + * \param[in] hc 124 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 124 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs7_ul_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -353,6 +423,12 @@ } } +/*! \brief De-Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4 + * \param[out] hc caller-allocated output buffer for 160 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs7_ul_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -380,6 +456,12 @@ } } +/*! \brief Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4 + * \param[in] hc 160 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 160 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs8_ul_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -403,6 +485,13 @@ } } + +/*! \brief De-Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4 + * \param[out] hc caller-allocated output buffer for 160 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs8_ul_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -430,6 +519,12 @@ } } +/*! \brief Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5 + * \param[in] hc 124 soft coded header input bits + * \param[in] c1 612 soft coded data input bits + * \param[in] c2 612 soft coded data input bits + * \param[out] hi 124 interleaved header output bits + * \param[out] di 1224 interleaved data output bits */ void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di) { @@ -453,6 +548,12 @@ } } +/*! \brief De-Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5 + * \param[out] hc caller-allocated output buffer for 124 soft coded header bits + * \param[out] c1 caller-allocated output buffer for 612 soft coded data bits + * \param[out] c2 caller-allocated output buffer for 612 soft coded data bits + * \param[in] hi interleaved soft input header bits + * \param[in] di interleaved soft input data bits */ void gsm0503_mcs8_dl_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di) { @@ -504,6 +605,9 @@ * Where hl(B) and hn(B) are bits in burst B indicating flags. */ +/*! \brief GSM TCH FR/EFR/AFS De-Interleaving and burst mapping + * \param[out] cB caller-allocated buffer for 456 unpacked output bits + * \param[in] iB 456 unpacked interleaved input bits */ void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB) { int j, k, B; @@ -515,6 +619,9 @@ } } +/*! \brief GSM TCH FR/EFR/AFS Interleaving and burst mapping + * \param[in] cB caller-allocated buffer for 456 unpacked input bits + * \param[out] iB 456 unpacked interleaved output bits */ void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -550,6 +657,9 @@ * Where hl(B) and hn(B) are bits in burst B indicating flags. */ +/*! \brief GSM TCH HR/AHS De-Interleaving and burst mapping + * \param[out] cB caller-allocated buffer for 228 unpacked output bits + * \param[in] iB 228 unpacked interleaved input bits */ void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB) { int j, k, B; @@ -561,6 +671,9 @@ } } +/*! \brief GSM TCH HR/AHS Interleaving and burst mapping + * \param[in] cB caller-allocated buffer for 228 unpacked input bits + * \param[out] iB 228 unpacked interleaved output bits */ void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -571,3 +684,5 @@ iB[B * 114 + j] = cB[k]; } } + +/*! @} */ diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 4dd3076..82c049c 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -25,6 +25,17 @@ #include #include +/*! \addtogroup mapping + * @{ + * + * \brief GSM TS 05.03 burst mapping + * + * This module contains burst mapping routines as specified in 3GPP TS + * 05.03 / 45.003. + */ + +/*! \file gsm0503_mapping.c */ + void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn) { @@ -289,3 +300,5 @@ eB[191] = t[12]; eB[194] = t[13]; } + +/*! @} */ diff --git a/src/coding/gsm0503_parity.c b/src/coding/gsm0503_parity.c index 99198ba..171feb4 100644 --- a/src/coding/gsm0503_parity.c +++ b/src/coding/gsm0503_parity.c @@ -24,8 +24,18 @@ #include #include -/* - * GSM (SACCH) parity (FIRE code) +/*! \addtogroup parity + * @{ + * + * \brief GSM TS 05.03 parity + * + * This module contains parity/crc code definitions for the various + * parity/crc schemes as defined in 3GPP TS 05.03 / 45.003 + */ + +/*! \file gsm0503_parity.c */ + +/*! \brief GSM (SACCH) parity (FIRE code) * * g(x) = (x^23 + 1)(x^17 + x^3 + 1) * = x^40 + x^26 + x^23 + x^17 + x^3 + a1 @@ -37,8 +47,7 @@ .remainder = 0xffffffffffULL, }; -/* - * GSM PDTCH CS-2, CS-3, CS-4 parity +/*! \brief GSM PDTCH CS-2, CS-3, CS-4 parity * * g(x) = x^16 + x^12 + x^5 + 1 */ @@ -49,8 +58,7 @@ .remainder = 0xffff, }; -/* - * EDGE MCS header parity +/*! \brief EDGE MCS header parity * */ const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr = { @@ -60,8 +68,7 @@ .remainder = 0xff, }; -/* - * EDGE MCS data parity +/*! \brief EDGE MCS data parity * */ const struct osmo_crc16gen_code gsm0503_mcs_crc12 = { @@ -71,8 +78,7 @@ .remainder = 0x0fff, }; -/* - * GSM RACH parity +/*! \brief GSM RACH parity * * g(x) = x^6 + x^5 + x^3 + x^2 + x^1 + 1 */ @@ -83,8 +89,7 @@ .remainder = 0x3f, }; -/* - * GSM SCH parity +/*! \brief GSM SCH parity * * g(x) = x^10 + x^8 + x^6 + x^5 + x^4 + x^2 + 1 */ @@ -95,8 +100,7 @@ .remainder = 0x3ff, }; -/* - * GSM TCH FR/HR/EFR parity +/*! \brief GSM TCH FR/HR/EFR parity * * g(x) = x^3 + x + 1 */ @@ -107,8 +111,7 @@ .remainder = 0x7, }; -/* - * GSM TCH EFR parity +/*! \brief GSM TCH EFR parity * * g(x) = x^8 + x^4 + x^3 + x^2 + 1 */ @@ -119,8 +122,7 @@ .remainder = 0x00, }; -/* - * GSM AMR parity +/*! \brief GSM AMR parity * * g(x) = x^6 + x^5 + x^3 + x^2 + x^1 + 1 */ @@ -130,3 +132,5 @@ .init = 0x00, .remainder = 0x3f, }; + +/*! @} */ diff --git a/src/coding/gsm0503_tables.c b/src/coding/gsm0503_tables.c index 90ca88d..1c85765 100644 --- a/src/coding/gsm0503_tables.c +++ b/src/coding/gsm0503_tables.c @@ -24,6 +24,18 @@ #include #include +/*! \addtogroup tables + * @{ + * + * \brief GSM TS 05.03 tables + * + * This module contains various tables defining parts of 3GPP TS 05.03 + * / 45.003, primarily for the purpose of (de)puncturing, interleaving, + * etc. + */ + +/*! \file gsm0503_tables.c */ + const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8] = { { 1,1, 1,1, 1,1, 1,1 }, { 1,1, 0,0, 1,0, 0,0 }, @@ -1730,3 +1742,5 @@ { 0,0,1,0,0,1,1,0,1, 1,0,1,1,1,1,1,1,1, 0,1,1,0,1,0,0,0,1, 0,0,1,1,1,0,1,0,0, }, { 0,1,1,0,1,0,1,1,1, 0,1,0,1,0,1,1,1,1, 0,0,0,1,1,1,1,1,0, 0,1,0,0,1,0,0,1,1, }, }; + +/*! @} */ -- To view, visit https://gerrit.osmocom.org/2888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74 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 Jun 12 14:34:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:36 +0000 Subject: [MERGED] libosmocore[master]: gsm0503_{coding, mapping}: Mark input arguments as 'const' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0503_{coding,mapping}: Mark input arguments as 'const' ...................................................................... gsm0503_{coding,mapping}: Mark input arguments as 'const' It is generally our coding style to mark pointers to constant input data as 'const *'. For some reason the gsm0503 coding and mapping was not adhering to this, so let's bring it into compliance. Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_mapping.h M src/coding/gsm0503_coding.c M src/coding/gsm0503_mapping.c 4 files changed, 75 insertions(+), 76 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index b8eb205..f6591f5 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -21,43 +21,43 @@ EGPRS_NUM_MCS, }; -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data); -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data); +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_pdtch_egprs_encode(ubit_t *bursts, uint8_t *l2_data, +int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len); -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total); -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order); -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, int net_order, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total); -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len); -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len); +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total); -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr); -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total); -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic); -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic); +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic); +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic); -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info); -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst); +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 4c6550a..93e4b67 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -4,11 +4,11 @@ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); -void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, +void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn); -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd); -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd); +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd); void gsm0503_mcs5_ul_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, int B); diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index baf1ce1..d752454 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -490,7 +490,7 @@ return res; } -static int _xcch_decode_cB(uint8_t *l2_data, sbit_t *cB, +static int _xcch_decode_cB(uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) { ubit_t conv[224]; @@ -509,7 +509,7 @@ return 0; } -static int _xcch_encode_cB(ubit_t *cB, uint8_t *l2_data) +static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data) { ubit_t conv[224]; @@ -525,7 +525,7 @@ /* * GSM xCCH block transcoding */ -int gsm0503_xcch_decode(uint8_t *l2_data, sbit_t *bursts, +int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[456]; @@ -539,7 +539,7 @@ return _xcch_decode_cB(l2_data, cB, n_errors, n_bits_total); } -int gsm0503_xcch_encode(ubit_t *bursts, uint8_t *l2_data) +int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data) { ubit_t iB[456], cB[456], hl = 1, hn = 1; int i; @@ -748,7 +748,7 @@ * 3. CRC check * 4. Block combining (MCS-7,8,9 only) */ -static int egprs_decode_data(uint8_t *l2_data, sbit_t *c, +static int egprs_decode_data(uint8_t *l2_data, const sbit_t *c, int mcs, int p, int blk, int *n_errors, int *n_bits_total) { ubit_t u[EGPRS_DATA_U_MAX]; @@ -809,7 +809,7 @@ * 3. Burst unmapping and deinterleaving * 4. Data section decoding */ -int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, sbit_t *bursts, uint16_t nbits, +int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t dc[EGPRS_DATA_DC_MAX]; @@ -879,7 +879,7 @@ * GSM PDTCH block transcoding */ -int gsm0503_pdtch_decode(uint8_t *l2_data, sbit_t *bursts, uint8_t *usf_p, +int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) { sbit_t iB[456], cB[676], hl_hn[8]; @@ -1031,7 +1031,7 @@ /* * EGPRS PDTCH UL block encoding */ -static int egprs_type3_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type3_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; ubit_t iB[456]; @@ -1047,7 +1047,7 @@ return 0; } -static int egprs_type2_map(ubit_t *bursts, ubit_t *hc, ubit_t *dc, int usf) +static int egprs_type2_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) { int i; const ubit_t *up; @@ -1065,8 +1065,8 @@ return 0; } -static int egprs_type1_map(ubit_t *bursts, ubit_t *hc, - ubit_t *c1, ubit_t *c2, int usf, int mcs) +static int egprs_type1_map(ubit_t *bursts, const ubit_t *hc, + const ubit_t *c1, const ubit_t *c2, int usf, int mcs) { int i; const ubit_t *up; @@ -1088,7 +1088,7 @@ return 0; } -static int egprs_encode_hdr(ubit_t *hc, uint8_t *l2_data, int mcs) +static int egprs_encode_hdr(ubit_t *hc, const uint8_t *l2_data, int mcs) { int i, j; ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX]; @@ -1122,7 +1122,7 @@ return 0; } -static int egprs_encode_data(ubit_t *c, uint8_t *l2_data, +static int egprs_encode_data(ubit_t *c, const uint8_t *l2_data, int mcs, int p, int blk) { int i, j, data_len; @@ -1168,7 +1168,7 @@ * Type 3 - MCS-1,2,3,4 */ static int egprs_parse_dl_cps(struct egprs_cps *cps, - union gprs_rlc_dl_hdr_egprs *hdr, int type) + const union gprs_rlc_dl_hdr_egprs *hdr, int type) { uint8_t bits; @@ -1193,7 +1193,7 @@ * EGPRS DL message encoding */ int gsm0503_pdtch_egprs_encode(ubit_t *bursts, - uint8_t *l2_data, uint8_t l2_len) + const uint8_t *l2_data, uint8_t l2_len) { ubit_t hc[EGPRS_DATA_C_MAX], dc[EGPRS_DATA_DC_MAX]; ubit_t c1[EGPRS_DATA_C1], c2[EGPRS_DATA_C2]; @@ -1282,7 +1282,7 @@ return -1; } -int gsm0503_pdtch_encode(ubit_t *bursts, uint8_t *l2_data, uint8_t l2_len) +int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) { ubit_t iB[456], cB[676]; const ubit_t *hl_hn; @@ -1367,7 +1367,7 @@ */ static void tch_fr_reassemble(uint8_t *tch_data, - ubit_t *b_bits, int net_order) + const ubit_t *b_bits, int net_order) { int i, j, k, l, o; @@ -1399,7 +1399,7 @@ } static void tch_fr_disassemble(ubit_t *b_bits, - uint8_t *tch_data, int net_order) + const uint8_t *tch_data, int net_order) { int i, j, k, l, o; @@ -1426,7 +1426,7 @@ } } -static void tch_hr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1437,7 +1437,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_hr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_hr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1445,7 +1445,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_efr_reassemble(uint8_t *tch_data, ubit_t *b_bits) +static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits) { int i, j; @@ -1456,7 +1456,7 @@ tch_data[j >> 3] |= (b_bits[i] << (7 - (j & 7))); } -static void tch_efr_disassemble(ubit_t *b_bits, uint8_t *tch_data) +static void tch_efr_disassemble(ubit_t *b_bits, const uint8_t *tch_data) { int i, j; @@ -1464,7 +1464,7 @@ b_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_amr_reassemble(uint8_t *tch_data, ubit_t *d_bits, int len) +static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len) { int i, j; @@ -1474,7 +1474,7 @@ tch_data[j >> 3] |= (d_bits[i] << (7 - (j & 7))); } -static void tch_amr_disassemble(ubit_t *d_bits, uint8_t *tch_data, int len) +static void tch_amr_disassemble(ubit_t *d_bits, const uint8_t *tch_data, int len) { int i, j; @@ -1482,7 +1482,7 @@ d_bits[i] = (tch_data[j >> 3] >> (7 - (j & 7))) & 1; } -static void tch_fr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1490,7 +1490,7 @@ b_bits[gsm610_bitorder[i]] = d_bits[i]; } -static void tch_fr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1498,7 +1498,7 @@ d_bits[i] = b_bits[gsm610_bitorder[i]]; } -static void tch_hr_d_to_b(ubit_t *b_bits, ubit_t *d_bits) +static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1513,7 +1513,7 @@ b_bits[map[i]] = d_bits[i]; } -static void tch_hr_b_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; const uint16_t *map; @@ -1527,7 +1527,7 @@ d_bits[i] = b_bits[map[i]]; } -static void tch_efr_d_to_w(ubit_t *b_bits, ubit_t *d_bits) +static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits) { int i; @@ -1535,7 +1535,7 @@ b_bits[gsm660_bitorder[i]] = d_bits[i]; } -static void tch_efr_w_to_d(ubit_t *d_bits, ubit_t *b_bits) +static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits) { int i; @@ -1543,7 +1543,7 @@ d_bits[i] = b_bits[gsm660_bitorder[i]]; } -static void tch_efr_protected(ubit_t *s_bits, ubit_t *b_bits) +static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits) { int i; @@ -1551,7 +1551,7 @@ b_bits[i] = s_bits[gsm0503_gsm_efr_protected_bits[i] - 1]; } -static void tch_fr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_fr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { int i; @@ -1564,7 +1564,7 @@ p[i] = u[91 + i]; } -static void tch_fr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_fr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { int i; @@ -1577,19 +1577,19 @@ u[91 + i] = p[i]; } -static void tch_hr_unreorder(ubit_t *d, ubit_t *p, ubit_t *u) +static void tch_hr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u) { memcpy(d, u, 95); memcpy(p, u + 95, 3); } -static void tch_hr_reorder(ubit_t *u, ubit_t *d, ubit_t *p) +static void tch_hr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p) { memcpy(u, d, 95); memcpy(u + 95, p, 3); } -static void tch_efr_reorder(ubit_t *w, ubit_t *s, ubit_t *p) +static void tch_efr_reorder(ubit_t *w, const ubit_t *s, const ubit_t *p) { memcpy(w, s, 71); w[71] = w[72] = s[69]; @@ -1603,7 +1603,7 @@ memcpy(w + 252, p, 8); } -static void tch_efr_unreorder(ubit_t *s, ubit_t *p, ubit_t *w) +static void tch_efr_unreorder(ubit_t *s, ubit_t *p, const ubit_t *w) { int sum; @@ -1623,22 +1623,21 @@ memcpy(p, w + 252, 8); } -static void tch_amr_merge(ubit_t *u, ubit_t *d, ubit_t *p, int len, int prot) +static void tch_amr_merge(ubit_t *u, const ubit_t *d, const ubit_t *p, int len, int prot) { memcpy(u, d, prot); memcpy(u + prot, p, 6); memcpy(u + prot + 6, d + prot, len - prot); } -static void tch_amr_unmerge(ubit_t *d, ubit_t *p, - ubit_t *u, int len, int prot) +static void tch_amr_unmerge(ubit_t *d, ubit_t *p, const ubit_t *u, int len, int prot) { memcpy(d, u, prot); memcpy(p, u + prot, 6); memcpy(d + prot, u + prot + 6, len - prot); } -int gsm0503_tch_fr_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1703,7 +1702,7 @@ return len; } -int gsm0503_tch_fr_encode(ubit_t *bursts, uint8_t *tch_data, +int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) { ubit_t iB[912], cB[456], h; @@ -1761,7 +1760,7 @@ return 0; } -int gsm0503_tch_hr_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { sbit_t iB[912], cB[456], h; @@ -1831,7 +1830,7 @@ return 15; } -int gsm0503_tch_hr_encode(ubit_t *bursts, uint8_t *tch_data, int len) +int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len) { ubit_t iB[912], cB[456], h; ubit_t conv[98], b[112], d[112], p[3]; @@ -1886,7 +1885,7 @@ return 0; } -int gsm0503_tch_afs_decode(uint8_t *tch_data, sbit_t *bursts, +int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2081,7 +2080,7 @@ return len; } -int gsm0503_tch_afs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2241,7 +2240,7 @@ return -1; } -int gsm0503_tch_ahs_decode(uint8_t *tch_data, sbit_t *bursts, int odd, +int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) { @@ -2444,7 +2443,7 @@ return len; } -int gsm0503_tch_ahs_encode(ubit_t *bursts, uint8_t *tch_data, int len, +int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) { @@ -2618,7 +2617,7 @@ return 0; } -int gsm0503_rach_decode(uint8_t *ra, sbit_t *burst, uint8_t bsic) +int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) { ubit_t conv[14]; int rv; @@ -2636,7 +2635,7 @@ return 0; } -int gsm0503_rach_encode(ubit_t *burst, uint8_t *ra, uint8_t bsic) +int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) { ubit_t conv[14]; @@ -2654,7 +2653,7 @@ /* * GSM SCH transcoding */ -int gsm0503_sch_decode(uint8_t *sb_info, sbit_t *burst) +int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst) { ubit_t conv[35]; int rv; @@ -2670,7 +2669,7 @@ return 0; } -int gsm0503_sch_encode(ubit_t *burst, uint8_t *sb_info) +int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info) { ubit_t conv[35]; diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 366eeb4..4dd3076 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -38,7 +38,7 @@ *hn = eB[58]; } -void gsm0503_xcch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *hl, +void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn) { memcpy(eB, iB, 57); @@ -50,7 +50,7 @@ eB[58] = *hn; } -void gsm0503_tch_burst_unmap(sbit_t *iB, sbit_t *eB, sbit_t *h, int odd) +void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd) { int i; @@ -70,7 +70,7 @@ } } -void gsm0503_tch_burst_map(ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) +void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd) { int i; -- To view, visit https://gerrit.osmocom.org/2882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 12 14:34:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:38 +0000 Subject: [MERGED] libosmocore[master]: gsm0503_interleaving: Mark input arguments as 'const *' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0503_interleaving: Mark input arguments as 'const *' ...................................................................... gsm0503_interleaving: Mark input arguments as 'const *' The interleaving/deinterleaving functions were missing 'const' qualifiers on their input data buffers Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9 --- M include/osmocom/coding/gsm0503_interleaving.h M src/coding/gsm0503_interleaving.c 2 files changed, 10 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index 85c7328..a5d25ed 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -11,13 +11,13 @@ */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); -void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB); +void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB); -void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB); -void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB); +void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB); +void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB); -void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB); -void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB); +void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB); +void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB); void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB); void gsm0503_mcs1_ul_interleave(const ubit_t *hc, diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 61d4fdc..cd47cff 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -76,7 +76,7 @@ /*! \brief Interleave burst bits according to TS 05.03 4.1.4 * \param[out] iB caller-allocated output buffer for 456 soft interleaved bits * \param[in] cB 456 soft input coded bits */ -void gsm0503_xcch_interleave(ubit_t *cB, ubit_t *iB) +void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -608,7 +608,7 @@ /*! \brief GSM TCH FR/EFR/AFS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 456 unpacked output bits * \param[in] iB 456 unpacked interleaved input bits */ -void gsm0503_tch_fr_deinterleave(sbit_t *cB, sbit_t *iB) +void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB) { int j, k, B; @@ -622,7 +622,7 @@ /*! \brief GSM TCH FR/EFR/AFS Interleaving and burst mapping * \param[in] cB caller-allocated buffer for 456 unpacked input bits * \param[out] iB 456 unpacked interleaved output bits */ -void gsm0503_tch_fr_interleave(ubit_t *cB, ubit_t *iB) +void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; @@ -660,7 +660,7 @@ /*! \brief GSM TCH HR/AHS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 228 unpacked output bits * \param[in] iB 228 unpacked interleaved input bits */ -void gsm0503_tch_hr_deinterleave(sbit_t *cB, sbit_t *iB) +void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB) { int j, k, B; @@ -674,7 +674,7 @@ /*! \brief GSM TCH HR/AHS Interleaving and burst mapping * \param[in] cB caller-allocated buffer for 228 unpacked input bits * \param[out] iB 228 unpacked interleaved output bits */ -void gsm0503_tch_hr_interleave(ubit_t *cB, ubit_t *iB) +void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; -- To view, visit https://gerrit.osmocom.org/2889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9 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 Jun 12 14:34:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:34:39 +0000 Subject: [MERGED] libosmocore[master]: gsm0503_coding: Mark gsm0503_mcs_{ul, dl}_codes as const In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const ...................................................................... gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const The table describing the various MCS convolutional codes are constant data and should be marked as such. Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511 --- M src/coding/gsm0503_coding.c 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index bf4df1c..7039863 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -186,7 +186,7 @@ /* * EGPRS UL coding parameters */ -struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = { +const struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] = { { .mcs = EGPRS_MCS0, }, @@ -357,7 +357,7 @@ /* * EGPRS DL coding parameters */ -struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = { +const struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] = { { .mcs = EGPRS_MCS0, }, @@ -743,7 +743,7 @@ sbit_t C[EGPRS_HDR_C_MAX]; ubit_t upp[EGPRS_HDR_UPP_MAX]; int i, j, rc; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; code = &gsm0503_mcs_ul_codes[mcs]; @@ -858,7 +858,7 @@ sbit_t C[EGPRS_DATA_C_MAX]; int i, j, rc, data_len; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; if (blk && mcs < EGPRS_MCS7) { /* Invalid MCS-X block state */ @@ -1206,7 +1206,7 @@ { int i, j; ubit_t upp[EGPRS_HDR_UPP_MAX], C[EGPRS_HDR_C_MAX]; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; code = &gsm0503_mcs_dl_codes[mcs]; @@ -1241,7 +1241,7 @@ { int i, j, data_len; ubit_t u[EGPRS_DATA_U_MAX], C[EGPRS_DATA_C_MAX]; - struct gsm0503_mcs_code *code; + const struct gsm0503_mcs_code *code; code = &gsm0503_mcs_dl_codes[mcs]; -- To view, visit https://gerrit.osmocom.org/2890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511 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 Jun 12 14:35:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 14:35:21 +0000 Subject: osmo-trx[master]: uhd: Use map container for for device parameter access In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 15:31:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 15:31:31 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 10: Code-Review+2 (4 comments) some replies and comments that are probably outdated. Patch Set 10 looks good! https://gerrit.osmocom.org/#/c/2779/8//COMMIT_MSG Commit Message: Line 42: register by waiting/polling the method "modem.is_connected()". Tests > ACK. Can I also write there that I don't agree and that I presonally prefer but semantically it doesn't matter which we wait for first; waiting for the modem first makes our pcaps a lot shorter because we don't flood it with ctrl requests. How can your opinion differ! :) https://gerrit.osmocom.org/#/c/2779/8/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 408: result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) > You wrote: "We have to get out of the glib main loop before we can start ra we have not the faintest idea of what magic glib may be doing. Maybe it's calling some C code calling back to python, maybe it has a thread running concurrently to launch callbacks (it doesn't, but are we sure?). We do want our own exceptions to be handled in the way we need: synchronously and with readable tracebacks. I remain certain that we do not want to do anything inside glib code at all, apart from noting that we want to do something later. Line 422: netreg = self.dbus.interface(I_NETREG) > schedule_scan_register should not be called for tests, at least for now, on Have you tested the DBus API? If calling netreg.Register directly without a Scan works, then we should skip the scan. https://gerrit.osmocom.org/#/c/2779/10/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 409: error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) nice! -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 10 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: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 15:39:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 15:39:03 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper Message-ID: Review at https://gerrit.osmocom.org/2891 lc15: add jenkins helper Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_lc15.sh 2 files changed, 57 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/1 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..c44daa7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -18,6 +18,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..d11e910 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +# Get the headers.. +cd "$deps" +git clone git://git.osmocom.org/openbsc || true +cd openbsc +git pull --rebase +cd "$base" + +osmo-build-dep.sh libosmocore + +"$deps"/libosmocore/contrib/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 + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE $PARALLEL_MAKE +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 12 16:04:07 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 16:04:07 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Patch Set 8: (1 comment) https://gerrit.osmocom.org/#/c/2779/8/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 422: def register(self, scanned_operators): > Have you tested the DBus API? If calling netreg.Register directly without a I tested it, there's a register_default.py testing it and I run it sometimes too to test this code path. Registering without calling Register works too, but still doesn't look like the good way just to wait for implementation detail/miracle to occur and become registered. I guess Register can work too because the modem can have cached some info from last run, and it's something we probably want to avoid. Some modems may scan implicitly, who nows, so better call it here just in case, let's be safe. -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 8 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: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 16:04:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 16:04:45 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: Implement network registration during connect() In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: ofono_client: Implement network registration during connect() ...................................................................... ofono_client: Implement network registration during connect() A new mcc_mnc parameter is now optionally passed to connect() in order to manually register to a specific network with a given MCC+MNC pair. If no parameter is passed (or None), then the modem will be instructed to attempt an automatic registration with any available network which permits it. We get the MCC+MNC parameter from the MSC/NITB and we pass it to the modem object at connect time as shown in the modified tests. Two new simple tests to check network registration is working are added in this commit. Ofono modems seem to be automatically registering at some point after they are set Online=true, and we were actually using that 'feature' before this patch. Thus, it is possible that a modem quickly becomes registered, and we then check so before starting the scan+registration process, which can take a few seconds. The scanning method can take a few seconds to complete. To avoid blocking in the dbus ofono Scan() method, this commit adds some code to make use of glib/gdbus async methods, which are not yet supported directly by pydbus. This way, we can continue polling while waiting for the scan process to complete and we can register several modems in parallel. When scan completes, a callback is run which attempts to register. If no MCC+MNC was passed, as we just finished scanning the modem should have enough fresh operator information to take good and quick decisions on where to connect. If we have an MCC+MNC, then we check the operator list received by Scan() method. If operator with desired MCC+MNC is there, we register with it. If it's not there, we start scanning() again asynchronously hoping the operator will show up in next scan. As scanning() and registration is done in the background, tests are expected to call connect(), and then later on wait for the modem to register by waiting/polling the method "modem.is_connected()". Tests first check for the modem being connected and after with MSC subscriber_attached(). The order is intentional because the later has to poll through network and adds unneeded garbage to the pcap files bein recorded. Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c --- M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M suites/aoip_debug/interactive.py M suites/aoip_sms/mo_mt_sms.py M suites/debug/interactive.py A suites/netreg/register.py A suites/netreg/register_default.py A suites/netreg/suite.conf M suites/sms/mo_mt_sms.py 10 files changed, 226 insertions(+), 10 deletions(-) Approvals: Neels Hofmeyr: 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 46300ec..fc9bba4 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -22,6 +22,7 @@ from pydbus import SystemBus, Variant import time import pprint +import sys from gi.repository import GLib glib_main_loop = GLib.MainLoop() @@ -31,6 +32,12 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' + +# See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 +NETREG_ST_REGISTERED = 'registered' +NETREG_ST_ROAMING = 'roaming' + +NETREG_MAX_REGISTER_ATTEMPTS = 3 class DeferredHandling: defer_queue = [] @@ -47,6 +54,9 @@ while DeferredHandling.defer_queue: handler, args, kwargs = DeferredHandling.defer_queue.pop(0) handler(*args, **kwargs) + +def defer(handler, *args, **kwargs): + DeferredHandling.defer_queue.append((handler, args, kwargs)) def dbus_connect(dbus_iface, handler): '''This function shall be used instead of directly connecting DBus signals. @@ -72,6 +82,53 @@ def list_modems(): root = systembus_get('/') return sorted(root.GetModems()) + +def _async_result_handler(obj, result, user_data): + '''Generic callback dispatcher called from glib loop when an async method + call has returned. This callback is set up by method dbus_async_call.''' + (result_callback, error_callback, real_user_data) = user_data + try: + ret = obj.call_finish(result) + except Exception as e: + # return exception as value + if error_callback: + error_callback(obj, e, real_user_data) + else: + result_callback(obj, e, real_user_data) + return + + ret = ret.unpack() + # to be compatible with standard Python behaviour, unbox + # single-element tuples and return None for empty result tuples + if len(ret) == 1: + ret = ret[0] + elif len(ret) == 0: + ret = None + result_callback(obj, ret, real_user_data) + +def dbus_async_call(instance, proxymethod, *proxymethod_args, + result_handler=None, error_handler=None, + user_data=None, timeout=30, + **proxymethod_kwargs): + '''pydbus doesn't support asynchronous methods. This method adds support for + it until pydbus implements it''' + + argdiff = len(proxymethod_args) - len(proxymethod._inargs) + if argdiff < 0: + raise TypeError(proxymethod.__qualname__ + " missing {} required positional argument(s)".format(-argdiff)) + elif argdiff > 0: + raise TypeError(proxymethod.__qualname__ + " takes {} positional argument(s) but {} was/were given".format(len(proxymethod._inargs), len(proxymethod_args))) + + timeout = timeout * 1000 + user_data = (result_handler, error_handler, user_data) + + ret = instance._bus.con.call( + instance._bus_name, instance._path, + proxymethod._iface_name, proxymethod.__name__, + GLib.Variant(proxymethod._sinargs, proxymethod_args), + GLib.VariantType.new(proxymethod._soutargs), + 0, timeout, None, + _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. @@ -257,6 +314,7 @@ self.set_log_category(log.C_TST) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) + self.register_attempts = 0 self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), @@ -323,18 +381,95 @@ def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) - def connect(self, nitb): - 'set the modem up to connect to MCC+MNC from NITB config' - self.log('connect to', nitb) + def is_connected(self, mcc_mnc=None): + netreg = self.dbus.interface(I_NETREG) + prop = netreg.GetProperties() + status = prop.get('Status') + if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): + return False + if mcc_mnc is None: # Any network is fine and we are registered. + return True + mcc = prop.get('MobileCountryCode') + mnc = prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + return True + return False + + def schedule_scan_register(self, mcc_mnc): + if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: + self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + self.register_attempts += 1 + netreg = self.dbus.interface(I_NETREG) + self.dbg('Scanning for operators...') + # Scan method can take several seconds, and we don't want to block + # waiting for that. Make it async and try to register when the scan is + # finished. + register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register + result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) + error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) + dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, + error_handler=error_handler, user_data=mcc_mnc) + + def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): + self.dbg('scanned operators: ', scanned_operators); + for op_path, op_prop in scanned_operators: + if op_prop.get('Status') == 'current': + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + self.log('Already registered with network', (mcc, mnc)) + return + self.log('Registering with the default network') + netreg = self.dbus.interface(I_NETREG) + netreg.Register() + + def scan_cb_register(self, scanned_operators, mcc_mnc): + self.dbg('scanned operators: ', scanned_operators); + matching_op_path = None + for op_path, op_prop in scanned_operators: + mcc = op_prop.get('MobileCountryCode') + mnc = op_prop.get('MobileNetworkCode') + if (mcc, mnc) == mcc_mnc: + if op_prop.get('Status') == 'current': + self.log('Already registered with network', mcc_mnc) + # We discovered the network and we are already registered + # with it. Avoid calling op.Register() in this case (it + # won't act as a NO-OP, it actually returns an error). + return + matching_op_path = op_path + break + if matching_op_path is None: + self.dbg('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + self.schedule_scan_register(mcc_mnc) + return + dbus_op = systembus_get(matching_op_path) + self.log('Registering with operator', matching_op_path, mcc_mnc) + dbus_op.Register() + + def power_cycle(self): + 'Power the modem and put it online, power cycle it if it was already on' if self.is_powered(): - self.dbg('is powered') + self.dbg('Power cycling') self.set_online(False) self.set_powered(False) event_loop.wait(self, lambda: not self.dbus.has_interface(I_NETREG, I_SMS), timeout=10) + else: + self.dbg('Powering on') self.set_powered() self.set_online() event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10) + def connect(self, mcc_mnc=None): + 'Connect to MCC+MNC' + if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): + self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + self.power_cycle() + self.register_attempts = 0 + if self.is_connected(mcc_mnc): + self.log('Already registered with', mcc_mnc if mcc_mnc else 'default network') + else: + self.log('Connect to', mcc_mnc if mcc_mnc else 'default network') + self.schedule_scan_register(mcc_mnc) + def sms_send(self, to_msisdn_or_modem, *tokens): if isinstance(to_msisdn_or_modem, Modem): to_msisdn = to_msisdn_or_modem.msisdn diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2ef88df..3a822f1 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -29,6 +29,7 @@ config_file = None process = None hlr = None + config = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): self.suite_run = suite_run @@ -73,6 +74,7 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -84,6 +86,15 @@ def addr(self): return self.ip_address.get('addr') + def mcc(self): + return self.config['msc']['net']['mcc'] + + def mnc(self): + return self.config['msc']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b2ddfb7..b4bf247 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -76,6 +76,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -91,6 +92,15 @@ self.bts.append(bts) bts.set_bsc(self) + def mcc(self): + return self.config['nitb']['net']['mcc'] + + def mnc(self): + return self.config['nitb']['net']['mnc'] + + def mcc_mnc(self): + return (self.mcc(), self.mnc()) + def subscriber_add(self, modem, msisdn=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 7cc1b76..cfedd3a 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -18,7 +18,7 @@ for m in modems: hlr.subscriber_add(m) - m.connect(bsc) + m.connect(msc.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -30,6 +30,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index b9383ea..8eba842 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -21,13 +21,15 @@ hlr.subscriber_add(ms_mo) hlr.subscriber_add(ms_mt) -ms_mo.connect(bsc) -ms_mt.connect(bsc) +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) sms = ms_mo.sms_send(ms_mt) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 603e395..37076dc 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -13,7 +13,7 @@ for m in modems: nitb.subscriber_add(m) - m.connect(nitb) + m.connect(nitb.mcc_mnc()) while True: cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered') @@ -25,6 +25,8 @@ break elif 'wait-registered'.startswith(cmd): try: + for m in modems: + wait(m.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, *modems) except Timeout: print('Timeout while waiting for registration.') diff --git a/suites/netreg/register.py b/suites/netreg/register.py new file mode 100755 index 0000000..9141986 --- /dev/null +++ b/suites/netreg/register.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +print(ms.info()) + +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/register_default.py b/suites/netreg/register_default.py new file mode 100755 index 0000000..d15b3f5 --- /dev/null +++ b/suites/netreg/register_default.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +print('use resources...') +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect() + +print(ms.info()) + +wait(ms.is_connected) +wait(nitb.subscriber_attached, ms) diff --git a/suites/netreg/suite.conf b/suites/netreg/suite.conf new file mode 100644 index 0000000..1bb1dbb --- /dev/null +++ b/suites/netreg/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 40s diff --git a/suites/sms/mo_mt_sms.py b/suites/sms/mo_mt_sms.py index 860f5e7..4e0ba08 100755 --- a/suites/sms/mo_mt_sms.py +++ b/suites/sms/mo_mt_sms.py @@ -14,13 +14,15 @@ nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) ms_mo.log_info() ms_mt.log_info() print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) sms = ms_mo.sms_send(ms_mt) -- To view, visit https://gerrit.osmocom.org/2779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d9eb47eac1044550d3885adb55105c304b0c15c Gerrit-PatchSet: 10 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 Mon Jun 12 16:04:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 16:04:46 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: Print debug information about network registra... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: ofono_client: Print debug information about network registration changes ...................................................................... ofono_client: Print debug information about network registration changes Change-Id: I61414c49544b7553058d2979b152fde95e0a3b58 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: 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 83f3e0d..46300ec 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -259,6 +259,7 @@ self.dbus = ModemDbusInteraction(self.path) self.dbus.required_signals = { I_SMS: ( ('IncomingMessage', self._on_incoming_message), ), + I_NETREG: ( ('PropertyChanged', self._on_netreg_property_changed), ), } self.dbus.watch_interfaces() @@ -319,6 +320,9 @@ def ki(self): return self.conf.get('ki') + def _on_netreg_property_changed(self, name, value): + self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) + def connect(self, nitb): 'set the modem up to connect to MCC+MNC from NITB config' self.log('connect to', nitb) -- To view, visit https://gerrit.osmocom.org/2805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61414c49544b7553058d2979b152fde95e0a3b58 Gerrit-PatchSet: 3 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 Mon Jun 12 16:24:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 12 Jun 2017 16:24:04 +0000 Subject: osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (9 comments) A few stuff to be fixed. Good job, happy to get rid of the "with" statements :D https://gerrit.osmocom.org/#/c/2886/2/selftest/log_test.py File selftest/log_test.py: Line 89: # some space to keep source line numbers identical to previous code This can be dropped right? it may make sense for this review but doesn't look like it's gonna make sense for 1000 next people reading this code :P https://gerrit.osmocom.org/#/c/2886/2/selftest/suite_test.py File selftest/suite_test.py: Line 23: trial = log.Origin(None, 'trial') worth it seeting this first param as kwargs which defaults to None? https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 93: log_ctx = proc Can we make this variable have a name which looks more special? otherwise at first glance it seems it's a foobar variable which was left here being unused at some point in time, and someone may be willing to remove them. __log_ctx__ ? https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 123: raise RuntimeError('Modem interface is not available:', interface_name) log.Error ? Line 316: raise RuntimeError('No IMSI') log.Error? https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/process.py File src/osmo_gsm_tester/process.py: Line 77: self._set_name(self.name_str, pid=self.process_obj.pid) why have an underscore now? https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 82: self.suite_run = suite_run No need to move suite_run around in here, but not a big issue Line 128: def set_fail(self, fail_type, fail_message, tb_str=None, src=4): Do we really need to pass this over here? Is it expected to be changed by callers in some way? We can directly do the _src=4 below. https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/test.py File src/osmo_gsm_tester/test.py: Line 35: global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout Missed removing them from this line too. How are tests calling log now? Or they should only call print() ? -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 16:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 16:37:37 +0000 Subject: [PATCH] osmo-ci[master]: Add .gitreview Message-ID: Review at https://gerrit.osmocom.org/2892 Add .gitreview Simplify gerrit usage via .gitreview file. Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/2892/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..859c88c --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-ci -- To view, visit https://gerrit.osmocom.org/2892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 12 16:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 16:37:37 +0000 Subject: [PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers Message-ID: Review at https://gerrit.osmocom.org/2893 Add script for fetching BTS-specific L1 headers Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682 --- A scripts/osmo-layer1-headers.sh 1 file changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/1 diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh new file mode 100755 index 0000000..966a7f5 --- /dev/null +++ b/scripts/osmo-layer1-headers.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# -e: fail if any of the subsequent commands fail +# -x: trace each executed command via debug log +set -e -x + +# Usage: +# ./osmo-layer1-headers.sh sysmo superfemto_v5.1 +# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset) +# 2nd parameter is optional and defaults to latest master branch + +case "$1" in + sysmo) + uri="git://git.sysmocom.de/sysmo-bts/layer1-api" + version="origin/master" + ;; + oct) + uri="git://git.osmocom.org/octphy-2g-headers" + version="origin/master" + ;; + lc15) + uri="https://gitlab.com/nrw_litecell15/litecell15-fw" + version="nrw/litecell15-next" + ;; + *) + echo "Unknown BTS model '$1'" + exit 1 + ;; +esac + +# if 2nd parameter was specified and it's not 'master' than use it instead of default +if [ -n "$2" ] + if [ $2 != "master" ]; + then + version=$2 + fi +fi + +if ! test -d layer1-headers; +then + git clone $uri layer1-headers +fi + +cd layer1-headers +git fetch origin +git reset --hard $version -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 12 16:51:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 16:51:16 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 3: Verified-1 Doesn't work (tested with lc15 hw in TCH/H config): measurement.c:150 (bts=0,trx=0,ts=2,ss=0) no space for uplink measurement -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:00:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:00:04 +0000 Subject: [PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Add script for fetching BTS-specific L1 headers Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682 --- A scripts/osmo-layer1-headers.sh 1 file changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/2 diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh new file mode 100755 index 0000000..0f3b6c8 --- /dev/null +++ b/scripts/osmo-layer1-headers.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# -e: fail if any of the subsequent commands fail +# -x: trace each executed command via debug log +set -e -x + +# Usage: +# ./osmo-layer1-headers.sh sysmo superfemto_v5.1 +# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset) +# 2nd parameter is optional and defaults to latest master branch + +case "$1" in + sysmo) + uri="git://git.sysmocom.de/sysmo-bts/layer1-api" + version="origin/master" + ;; + oct) + uri="git://git.osmocom.org/octphy-2g-headers" + version="origin/master" + ;; + lc15) + uri="https://gitlab.com/nrw_litecell15/litecell15-fw" + version="nrw/litecell15-next" + ;; + *) + echo "Unknown BTS model '$1'" + # we assume that unknown BTS model do not require L1 headers + exit 0 + ;; +esac + +# if 2nd parameter was specified and it's not 'master' than use it instead of default +if [ -n "$2" ] + if [ $2 != "master" ]; + then + version=$2 + fi +fi + +if ! test -d layer1-headers; +then + git clone $uri layer1-headers +fi + +cd layer1-headers +git fetch origin +git reset --hard $version -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:10:48 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 12 Jun 2017 17:10:48 +0000 Subject: osmo-ci[master]: Add .gitreview In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:20:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:20:07 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper Message-ID: Review at https://gerrit.osmocom.org/2894 Move common steps into common jenkins helper Move value_string termination check and OpenBSC/OsmoPCU headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 17 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/1 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..bcb2d06 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,5 +1,7 @@ #!/bin/sh bts_model="$1" +base="$PWD" +deps="$base/deps" if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" @@ -8,6 +10,21 @@ set -x -e +cd "$deps" + +# Get OsmoPCU for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + case "$bts_model" in sysmo) diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..512a29b 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -15,19 +15,7 @@ osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..df26b14 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -10,16 +10,7 @@ mkdir "$deps" || true rm -rf "$inst" -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..f546530 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -15,17 +15,7 @@ osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..0f51aff 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -10,16 +10,7 @@ mkdir "$deps" || true rm -rf "$inst" -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:25:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:25:21 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2894 to look at the new patch set (#2). Move common steps into common jenkins helper Move value_string termination check and OpenBSC/OsmoPCU headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 19 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/2 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..8f95524 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,5 +1,7 @@ #!/bin/sh bts_model="$1" +base="$PWD" +deps="$base/deps" if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" @@ -8,6 +10,23 @@ set -x -e +mkdir -p "$deps" + +cd "$deps" + +# Get OsmoPCU for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + case "$bts_model" in sysmo) diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..abe7a85 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -7,7 +7,6 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true rm -rf "$inst" export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" @@ -15,19 +14,7 @@ osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..c2c988b 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -7,19 +7,9 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true rm -rf "$inst" -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..7d41c1e 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -7,7 +7,6 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true rm -rf "$inst" export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" @@ -15,17 +14,7 @@ osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..4568e63 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -7,19 +7,9 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true rm -rf "$inst" -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:30:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:30:35 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2891 to look at the new patch set (#2). lc15: add jenkins helper Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_lc15.sh 2 files changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/2 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 8f95524..70d14d0 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -37,6 +37,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..338d4ef --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +rm -rf "$inst" + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE $PARALLEL_MAKE +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 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 Mon Jun 12 17:39:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:39:53 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2891 to look at the new patch set (#3). lc15: add jenkins helper Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_lc15.sh 2 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/3 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 3e7534b..5a8f8a4 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -44,6 +44,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..43371e5 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +set -ex + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE $PARALLEL_MAKE +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 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 Mon Jun 12 17:39:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:39:53 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2894 to look at the new patch set (#3). Move common steps into common jenkins helper Move value_string termination check and OpenBSC/OsmoPCU headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 26 insertions(+), 72 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/3 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..3e7534b 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,5 +1,13 @@ #!/bin/sh + bts_model="$1" +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +rm -rf "$inst" if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" @@ -8,6 +16,24 @@ set -x -e +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get OsmoPCU for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + case "$bts_model" in sysmo) diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..f10b21b 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -2,32 +2,12 @@ set -ex -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..5da944d 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -2,24 +2,7 @@ set -ex -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..90a5138 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -2,30 +2,12 @@ set -ex -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..724a50f 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -2,24 +2,7 @@ set -ex -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:59:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:59:48 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2891 to look at the new patch set (#4). lc15: add jenkins helper Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_lc15.sh 2 files changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/4 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 06454a7..6f2fb88 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -42,6 +42,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..d95d3f3 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE $PARALLEL_MAKE +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 17:59:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 17:59:48 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2894 to look at the new patch set (#4). Move common steps into common jenkins helper Move value_string termination check and OpenBSC/OsmoPCU headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 28 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/4 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..06454a7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,5 +1,11 @@ #!/bin/sh + bts_model="$1" +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" @@ -8,6 +14,24 @@ set -x -e +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get OsmoPCU for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + case "$bts_model" in sysmo) diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..1d7fdbc 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -5,29 +5,15 @@ base="$PWD" deps="$base/deps" inst="$deps/install" -export deps inst -mkdir "$deps" || true -rm -rf "$inst" +export deps inst export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..85e584e 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -5,21 +5,10 @@ base="$PWD" deps="$base/deps" inst="$deps/install" + export deps inst -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..81101dd 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -5,27 +5,15 @@ base="$PWD" deps="$base/deps" inst="$deps/install" -export deps inst -mkdir "$deps" || true -rm -rf "$inst" +export deps inst export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..d479091 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -5,21 +5,10 @@ base="$PWD" deps="$base/deps" inst="$deps/install" + export deps inst -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 12 18:15:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 18:15:37 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2891 to look at the new patch set (#5). lc15: add jenkins helper Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_lc15.sh 2 files changed, 45 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/5 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 9a012ca..a1d1a05 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -40,6 +40,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..77b03ff --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE $PARALLEL_MAKE +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 18:15:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 12 Jun 2017 18:15:37 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2894 to look at the new patch set (#5). Move common steps into common jenkins helper Move value_string termination check and OpenBSC/OsmoPCU headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_model.sh M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 22 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/5 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..9a012ca 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,5 +1,9 @@ #!/bin/sh + bts_model="$1" +base="$PWD" +deps="$base/deps" +inst="$deps/install" if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" @@ -8,6 +12,24 @@ set -x -e +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get OsmoPCU for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + case "$bts_model" in sysmo) diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..140cfc5 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -7,27 +7,12 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true -rm -rf "$inst" - export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..25f272b 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -7,19 +7,7 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..1ff0cfa 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -7,25 +7,12 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true -rm -rf "$inst" - export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..e2f29ce 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -7,19 +7,7 @@ inst="$deps/install" export deps inst -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" - osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 12 18:31:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 18:31:49 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 Script looks sane to me. Let's merge it so we can easily test on jenkins, and fix any problems later. -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 5 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 Jun 12 18:50:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 18:50:28 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (2 comments) I would prefer keeping the scripts entirely separate, and leaving jenkins_bts_model.sh as a mere "switch" between N completely standalone scripts. After this patch, you can't use e.g. jenkins_sysmobts.sh on its own anymore. Nothing against removing code dup, but if we really need to here, I would rather leave the jenkins_bts_model.sh unchanged, and place common parts in a new file that is sourced by each script (e.g. . "$(dirname "$0")/common.sh" ), so that each is still callable on its own (this is done in the osmo-gsm-tester scripts). Also resolve these... https://gerrit.osmocom.org/#/c/2894/5/contrib/jenkins_bts_model.sh File contrib/jenkins_bts_model.sh: Line 6: inst="$deps/install" are these still duplicated in the individual scripts? Line 21: osmo-deps.sh osmo-pcu not all builds need this -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 18:52:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 18:52:19 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 5: (the jenkins_bts_model.sh was added merely to accomodate the jenkins build matrix, i.e. redirect a call with a given $bts_model env var to the various scripts) -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 19:17:40 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 12 Jun 2017 19:17:40 +0000 Subject: [PATCH] libosmocore[master]: ctrl_test.c: fix build with GCC 7.1.1 Message-ID: Review at https://gerrit.osmocom.org/2895 ctrl_test.c: fix build with GCC 7.1.1 According to GCC's online docs: When an inline function is not static, then the compiler must assume that there may be calls from other source files; since a global symbol can be defined only once in any program, the function must not be defined in the other source files, so the calls therein cannot be integrated. Therefore, a non-static inline function is always compiled on its own in the usual fashion. There is no any (performance or size) benefit from 'inline' keyword in this particular file, so let's replace one by 'static'. Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f --- M tests/ctrl/ctrl_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/2895/1 diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index 3bbab76..08be15f 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -7,7 +7,7 @@ #include #include -inline void check_type(enum ctrl_type c) +static void check_type(enum ctrl_type c) { const char *t = get_value_string(ctrl_type_vals, c); int v = get_string_value(ctrl_type_vals, t); -- To view, visit https://gerrit.osmocom.org/2895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 12 19:38:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 19:38:07 +0000 Subject: openbsc[master]: OML: fix potential OOB memory access In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/2885/1/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 487: if (m_id_len > MAX_BTS_FEATURES/8 + 1) { You also need to drop this +1, right? -- To view, visit https://gerrit.osmocom.org/2885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Mon Jun 12 19:38:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 19:38:11 +0000 Subject: [MERGED] openbsc[master]: OML: fix potential OOB memory access In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OML: fix potential OOB memory access ...................................................................... OML: fix potential OOB memory access Use sizeof target BTS feature storage to make sure we always fit into pre-allocated memory. Also use it for log check. Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Fixes: CID 170581 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 551c0bf..1715688 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -490,13 +490,13 @@ m_id_len = MAX_BTS_FEATURES/8; } - if (m_id_len > _NUM_BTS_FEAT/8 + 1) + if (m_id_len > sizeof(bts->_features_data)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " "feature vector - most likely it was compiled against newer BSC headers. " "Consider upgrading your BSC to later version.\n", bts->nr, m_id_len); - memcpy(bts->_features_data, TLVP_VAL(&tp, NM_ATT_MANUF_ID), m_id_len); + memcpy(bts->_features_data, TLVP_VAL(&tp, NM_ATT_MANUF_ID), sizeof(bts->_features_data)); adjust = m_id_len + 3; /* adjust for parsed TL16V struct */ for (i = 0; i < _NUM_BTS_FEAT; i++) -- To view, visit https://gerrit.osmocom.org/2885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 12 19:45:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 19:45:47 +0000 Subject: [PATCH] libosmocore[master]: Update doxygen main page for libosmo{core, gsm, vty} Message-ID: Review at https://gerrit.osmocom.org/2896 Update doxygen main page for libosmo{core,gsm,vty} We should link to project homepage as well as put the library into the wider Osmocom context. Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b --- M src/application.c M src/gsm/gsm_utils.c M src/vty/vty.c 3 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/2896/1 diff --git a/src/application.c b/src/application.c index 6a18d0e..8f37c93 100644 --- a/src/application.c +++ b/src/application.c @@ -34,6 +34,12 @@ * generic plugin interface, statistics counters, memory allocator, * socket abstraction, message buffers, etc. * \n\n + * libosmocodec is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * * Please note that C language projects inside Osmocom are typically * single-threaded event-loop state machine designs. As such, * routines in libosmocore are not thread-safe. If you must use them in @@ -53,6 +59,13 @@ * FITNESS FOR A PARTICULAR PURPOSE. * \n\n * + * \section sec_tracker Homepage + Issue Tracker + * The libosmocore project home page can be found at + * https://osmocom.org/projects/libosmocore + * + * An Issue Tracker can be found at + * https://osmocom.org/projects/libosmocore/issues + * * \section sec_contact Contact and Support * Community-based support is available at the OpenBSC mailing list * \n diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 7365ab7..d16adf7 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -41,6 +41,12 @@ * routines in libosmogsm are not thread-safe. If you must use them in * a multi-threaded context, you have to add your own locking. * + * libosmogsm is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * * \section sec_copyright Copyright and License * Copyright ? 2008-2011 - Harald Welte, Holger Freyther and contributors\n * All rights reserved. \n\n @@ -55,6 +61,13 @@ * FITNESS FOR A PARTICULAR PURPOSE. * \n\n * + * \section sec_tracker Homepage + Issue Tracker + * libosmogsm is distributed as part of libosmocore and shares its + * project page at http://osmocom.org/projects/libosmocore + * + * An Issue Tracker can be found at + * https://osmocom.org/projects/libosmocore/issues + * * \section sec_contact Contact and Support * Community-based support is available at the OpenBSC mailing list * \n diff --git a/src/vty/vty.c b/src/vty/vty.c index 88ed937..01d5ec0 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -14,6 +14,12 @@ * routines in libosmovty are not thread-safe. If you must use them in * a multi-threaded context, you have to add your own locking. * + * libosmocovty is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * * \section sec_copyright Copyright and License * Copyright ? 1997-2007 - Kuninhiro Ishiguro\n * Copyright ? 2008-2011 - Harald Welte, Holger Freyther and contributors\n @@ -29,6 +35,10 @@ * FITNESS FOR A PARTICULAR PURPOSE. * \n\n * + * \section sec_tracker Homepage + Issue Tracker + * libosmovty is distributed as part of libosmocore and shares its + * project page at http://osmocom.org/projects/libosmocore + * * \section sec_contact Contact and Support * Community-based support is available at the OpenBSC mailing list * \n -- To view, visit https://gerrit.osmocom.org/2896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 12 19:45:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 19:45:48 +0000 Subject: [PATCH] libosmocore[master]: update/extend doxygen documentation Message-ID: Review at https://gerrit.osmocom.org/2897 update/extend doxygen documentation It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3 --- M include/osmocom/core/msgb.h M src/bits.c M src/bitvec.c M src/conv.c M src/crcXXgen.c.tpl M src/fsm.c M src/gb/gprs_ns.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_core.c M src/gsm/auth_milenage.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_gea.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/plugin.c M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/socket.c M src/strrb.c M src/timer.c M src/utils.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c 63 files changed, 827 insertions(+), 157 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/2897/1 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index afb887c..f5dd323 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -29,13 +29,7 @@ * @{ */ -/*! \file msgb.h - * \brief Osmocom message buffers - * The Osmocom message buffers are modelled after the 'struct skb' - * inside the Linux kernel network stack. As they exist in userspace, - * they are much simplified. However, terminology such as headroom, - * tailroom, push/pull/put etc. remains the same. - */ +/*! \file msgb.h */ #define MSGB_DEBUG diff --git a/src/bits.c b/src/bits.c index 0c77b27..fe92f93 100644 --- a/src/bits.c +++ b/src/bits.c @@ -26,12 +26,11 @@ /*! \addtogroup bits * @{ - */ - -/*! \file bits.c * \brief Osmocom bit level support code */ +/*! \file bits.c */ + /*! \brief convert unpacked bits to packed bits, return length in bytes * \param[out] out output buffer of packed bits diff --git a/src/bitvec.c b/src/bitvec.c index c895cff..41e4f64 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -24,12 +24,11 @@ /*! \addtogroup bitvec * @{ - */ - -/*! \file bitvec.c * \brief Osmocom bit vector abstraction */ +/*! \file bitvec.c */ + #include #include #include diff --git a/src/conv.c b/src/conv.c index 79b3a7c..8e97e52 100644 --- a/src/conv.c +++ b/src/conv.c @@ -24,11 +24,10 @@ /*! \addtogroup conv * @{ + * \brief Osmocom convolutional encoder and decoder */ -/*! \file conv.c - * Osmocom convolutional encoder and decoder - */ +/*! \file conv.c */ #include "config.h" #ifdef HAVE_ALLOCA_H #include diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index 7e45c11..1a69e85 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -24,6 +24,7 @@ /*! \addtogroup crcgen * @{ + * \brief Osmocom generic CRC routines */ /*! \file crcXXgen.c diff --git a/src/fsm.c b/src/fsm.c index 5e74482..fbe22d7 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -29,9 +29,6 @@ /*! \addtogroup fsm * @{ - */ - -/*! \file fsm.c * \brief Finite State Machine abstraction * * This is a generic C-language abstraction for implementing finite @@ -84,9 +81,10 @@ * * In order to attach private state to the \ref osmo_fsm_inst, it * offers an opaque priv pointer. - * */ +/*! \file fsm.c */ + LLIST_HEAD(osmo_g_fsms); static bool fsm_log_addr = true; diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 23c0be8..17933ed 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1648,4 +1648,4 @@ DNS = ss; } -/*! }@ */ +/*! @} */ diff --git a/src/gsm/a5.c b/src/gsm/a5.c index dbba0f2..23cbe0c 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -26,13 +26,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup a5 +/*! \addtogroup crypto * @{ + * \brief Osmocom GSM/GPRS ciphering algorithm implementation */ -/*! \file gsm/a5.c - * \brief Osmocom GSM A5 ciphering algorithm implementation - */ +/*! \file gsm/a5.c */ #include #include diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 73759cb..c954902 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -22,6 +22,8 @@ /*! \addtogroup oml * @{ + * \brief GSM Network Management (OML) messages on the A-bis interface + * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ /*! \file abis_nm.c */ diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index c40027e..3b645d2 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -24,6 +24,10 @@ #include #include +/*! \addtogroup auth + * @{ + */ + static int c128v1_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) @@ -45,3 +49,5 @@ { osmo_auth_register(&c128v1_alg); } + +/*! @} */ diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index 168f886..b0900af 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -27,6 +27,10 @@ #include #include +/*! \addtogroup auth + * @{ + */ + static int c128v2_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) @@ -66,3 +70,5 @@ osmo_auth_register(&c128v2_alg); osmo_auth_register(&c128v3_alg); } + +/*! @} */ diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 9ca5d93..c9e403c 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -32,10 +32,10 @@ /*! \addtogroup auth * @{ + * \brief GSM/GPRS/3G authentication core infrastructure */ -/* \file auth_core.c - */ +/* \file auth_core.c */ static LLIST_HEAD(osmo_auths); diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index c1331b5..41e538d 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -25,6 +25,10 @@ #include "milenage/common.h" #include "milenage/milenage.h" +/*! \addtogroup auth + * @{ + */ + static int milenage_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) @@ -160,3 +164,5 @@ { osmo_auth_register(&milenage_alg); } + +/*! @} */ diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c index abb4917..cb3a309 100644 --- a/src/gsm/comp128.c +++ b/src/gsm/comp128.c @@ -68,6 +68,14 @@ #include #include +/*! \addtogroup auth + * @{ + */ + +/*! \file comp128.c + * \brief COMP128 v1; common/old GSM Authentication Algorithm (A3/A8) + */ + /* The compression tables (just copied ...) */ static const uint8_t table_0[512] = { 102, 177, 186, 162, 2, 156, 112, 75, 55, 25, 8, 12, 251, 193, 246, 188, @@ -184,6 +192,11 @@ x[(i>>3)+16] |= bits[(i*17) & 127] << (7-(i&7)); } +/*! \brief Perform COMP128v1 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value */ void comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { @@ -228,8 +241,16 @@ kc[7] = 0; } + +/*! \brief Perform COMP128v1 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value */ void comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { comp128v1(ki, rand, sres, kc); } + +/*! @} */ diff --git a/src/gsm/comp128v23.c b/src/gsm/comp128v23.c index e21b718..bfb4a0e 100644 --- a/src/gsm/comp128v23.c +++ b/src/gsm/comp128v23.c @@ -28,6 +28,14 @@ #include #include +/*! \addtogroup auth + * @{ + */ + +/*! \file comp128v23.c + * \brief COMP128 v2 / v3; Common Algorithm used for GSM Authentication (A3/A8) + */ + static const uint8_t table0[256] = { 197, 235, 60, 151, 98, 96, 3, 100, 248, 118, 42, 117, 172, 211, 181, 203, 61, 126, 156, 87, 149, 224, 55, 132, 186, 63, 238, 255, 85, 83, 152, 33, 160, @@ -101,6 +109,12 @@ } } +/*! \brief Perform COMP128v3 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value + * \returns 0 */ int comp128v3(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { @@ -147,6 +161,12 @@ return 0; } +/*! \brief Perform COMP128v2 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value + * \returns 0 */ int comp128v2(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { @@ -155,3 +175,5 @@ kc[6] &= 0xfc; return r; } + +/*! @} */ diff --git a/src/gsm/gan.c b/src/gsm/gan.c index 0bcaa17..1d98b38 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -21,6 +21,10 @@ #include +/*! \file gan.c + * \brief Generic Access Network (GAN) / UMA according to TS 44.318 + */ + const struct value_string gan_msgt_vals[] = { { GA_MT_RC_DISCOVERY_REQUEST, "GA-RC DISCOVERY REQUEST" }, diff --git a/src/gsm/gea.c b/src/gsm/gea.c index b8f6768..8d026a2 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -30,6 +30,13 @@ #include #include +/*! \addtogroup crypto + * @{ + */ + +/*! \file gsm/gea.c */ + + /*! \brief Performs the GEA4 algorithm as in 3GPP TS 55.226 V9.0.0 * \param[in,out] out Buffer for gamma for encrypted/decrypted * \param[in] len Length of out, in bytes @@ -58,3 +65,5 @@ osmo_c4(ck, kc); return gea4(out, len, ck, iv, direction); } + +/*! @} */ diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index da6e0a8..a0cf185 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -29,6 +29,10 @@ #include +/*! \addtogroup crypto + * @{ + */ + static LLIST_HEAD(gprs_ciphers); static struct gprs_cipher_impl *selected_ciphers[_GPRS_ALGO_NUM]; @@ -125,3 +129,4 @@ { return iov_i + lfn + oc; } +/*! @} */ diff --git a/src/gsm/gprs_gea.c b/src/gsm/gprs_gea.c index 8ff1648..836ee68 100644 --- a/src/gsm/gprs_gea.c +++ b/src/gsm/gprs_gea.c @@ -27,6 +27,10 @@ #include +/*! \addtogroup crypto + * @{ + */ + static struct gprs_cipher_impl gea3_impl = { .algo = GPRS_ALGO_GEA3, .name = "GEA3 (libosmogsm built-in)", @@ -46,3 +50,5 @@ gprs_cipher_register(&gea3_impl); gprs_cipher_register(&gea4_impl); } + +/*! @} */ diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index a4053ef..d1247be 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -5,6 +5,10 @@ #include #include +/*! \file gsm/gprs_rlc.c + * \brief helper functions for (E)GPRS RLC according to 3GPP TS 44.060 + */ + #define EGPRS_CPS_TYPE1_TBL_SZ 29 #define EGPRS_CPS_TYPE2_TBL_SZ 8 #define EGPRS_CPS_TYPE3_TBL_SZ 16 diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 1c14d3e..2592b54 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -27,6 +27,22 @@ #include #include +/*! \addtogroup sms + * @{ + */ + +/*! \brief Encode a 3GPP TS 03.41 SMS-CB message + * \param[in] ctx talloc allocation context + * \param[in] geo_scope Geographic Scope + * \param[in] msg_code Message Code + * \param[in] update Is this an update? + * \param[in] msg_id Message ID + * \param[in] dcs Data Coding Scheme + * \param[in] page_total Total number of pages + * \param[in] page_cur Current Page (up to \a page_total) + * \param[in] data Message data (copied 1:1) + * \param[in] len Length of \a data in bytes (up to 88) + * \returns callee-allocated TS 03.41 message with encoded data */ struct gsm341_ms_message * gsm0341_build_msg(void *ctx, uint8_t geo_scope, uint8_t msg_code, uint8_t update, uint16_t msg_id, uint8_t dcs, @@ -57,3 +73,5 @@ return cbmsg; } + +/*! @} */ diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 4c08365..03016b9 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -60,6 +60,11 @@ #include #include +/*! \addtogroup sms + * @{ + * \brief Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11 + */ + static void cp_timer_expired(void *data); #define MAX_SMS_RETRY 2 @@ -569,3 +574,5 @@ return rc; } + +/*! @} */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index eb8aec0..d120f2d 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -62,6 +62,10 @@ #define SMR_LOG_STR "SMR(%" PRIu64 ") " +/*! \addtogroup sms + * @{ + */ + static void rp_timer_expired(void *data); /* init a new instance */ @@ -484,3 +488,5 @@ return rc; } + +/*! @} */ diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index b84c9f2..543775c 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -38,16 +38,24 @@ #include #include +/*! \addtogroup sms + * @{ + */ + #define GSM411_ALLOC_SIZE 1024 #define GSM411_ALLOC_HEADROOM 128 +/*! \brief Allocate a message buffer for use as TS 04.11 message + * \returns allocated message buffer */ struct msgb *gsm411_msgb_alloc(void) { return msgb_alloc_headroom(GSM411_ALLOC_SIZE, GSM411_ALLOC_HEADROOM, "GSM 04.11"); } -/* Turn int into semi-octet representation: 98 => 0x89 */ +/*! \brief Turn int into semi-octet representation: 98 => 0x89 + * \param[in] integer value representing decimal number 0..99 + * \returns BSC encoded as nibbles, swapped */ uint8_t gsm411_bcdify(uint8_t value) { uint8_t ret; @@ -58,7 +66,9 @@ return ret; } -/* Turn semi-octet representation into int: 0x89 => 98 */ +/*! \brief Turn semi-octet representation into int: 0x89 => 98 + * \param[in] value byte containing two BCD nibbles in revere order + * \returns integer representing decoded, re-ordered nibbles */ uint8_t gsm411_unbcdify(uint8_t value) { uint8_t ret; @@ -73,7 +83,9 @@ return ret; } -/* Generate 03.40 TP-SCTS */ +/*! \brief Generate 03.40 TP-SCTS + * \param[out] scts Caller-provided buffer to store SCTS (7 octets) + * \param[in] time to encode */ void gsm340_gen_scts(uint8_t *scts, time_t time) { struct tm *tm = gmtime(&time); @@ -92,7 +104,9 @@ #endif } -/* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */ +/*! \brief Decode 03.40 TP-SCTS (into utc/gmt timestamp) + * \param[in] scts SMS Center Time Stamp + * \return time in UTC time_t format */ time_t gsm340_scts(uint8_t *scts) { struct tm tm; @@ -190,7 +204,10 @@ return minutes; } -/* decode validity period. return minutes */ +/*! \brief decode validity period. return minutes + * \param[in] sms_vpf Validity Period Format in 03.40 encoding + * \param[in] sms_vp Validity Period Information Element + * \returns validity period in minutes */ unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp) { uint8_t fi; /* functionality indicator */ @@ -228,7 +245,9 @@ } } -/* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */ +/*! \brief determine coding alphabet dependent on GSM 03.38 Section 4 DCS + * \param[in] dcs Data Coding Scheme in 03.38 encoding + * \returns libosmogsm internal enum \ref sms_alphabet */ enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs) { uint8_t cgbits = dcs >> 4; @@ -266,7 +285,13 @@ return alpha; } -/* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */ +/*! \brief generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 + * \param[out] oa caller-provided output buffer + * \param[in] oa_len caller-specified length of \a oa in bytes + * \param[in] type GSM340_TYPE_* + * \param[in] plan Numbering Plan + * \param[in] number string containing number + * \reurns number of bytes of \a oa that have been used */ int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len, uint8_t type, uint8_t plan, const char *number) { @@ -296,7 +321,11 @@ return len_in_bytes; } -/* Prefix msg with a RP header */ +/*! \brief Prefix \ref msgb with a RP header + * \param msg Message Buffer containing message + * \param[in] rp_msg_type RP Message Type + * \param[in] rp_msg_ref RP Message Reference + * \returns 0 */ int gsm411_push_rp_header(struct msgb *msg, uint8_t rp_msg_type, uint8_t rp_msg_ref) { @@ -312,7 +341,12 @@ return 0; } -/* Prefix msg with a 04.08/04.11 CP header */ +/*! \brief Prefix \ref msgb with a 04.08/04.11 CP header + * \param msg Message Buffer containing message + * \param[in] proto Protocol + * \param[in] trans Transaction + * \param[in] msg_type Message Type + * \retrns 0 */ int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type) { @@ -320,3 +354,5 @@ gsm0480_l3hdr_push(msg, proto | (trans << 4), msg_type); return 0; } + +/*! @} */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 04c2f01..c96dc77 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -24,9 +24,22 @@ #include #include +/*! \addtogroup gsm0808 + * @{ + * \brief Helper functions regarding the TS 08.08 / 48.008 A interface + */ + #define BSSMAP_MSG_SIZE 512 #define BSSMAP_MSG_HEADROOM 128 +/*! \brief Create "Complete L3 Info" for AoIP + * \param[in] msg_l3 msgb containing Layer 3 Message + * \param[in] nc Mobile Network Code + * \param[in] cc Mobile Country Code + * \param[in] lac Location Area Code + * \param[in] _ci Cell Identity + * \param[in] scl Speech Codec List + * \returns callee-allocated msgb with Complete L3 Info message */ struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci, const struct gsm0808_speech_codec_list @@ -68,12 +81,21 @@ return msg; } +/*! \brief Create "Complete L3 Info" for A + * \param[in] msg_l3 msgb containing Layer 3 Message + * \param[in] nc Mobile Network Code + * \param[in] cc Mobile Country Code + * \param[in] lac Location Area Code + * \param[in] _ci Cell Identity + * \returns callee-allocated msgb with Complete L3 Info message */ struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci) { return gsm0808_create_layer3_aoip(msg_l3, nc, cc, lac, _ci, NULL); } +/*! \brief Create BSSMAP RESET message + * \returns callee-allocated msgb with BSSMAP Reset message */ struct msgb *gsm0808_create_reset(void) { uint8_t cause = GSM0808_CAUSE_EQUIPMENT_FAILURE; @@ -89,6 +111,8 @@ return msg; } +/*! \brief Create BSSMAP RESET ACK message + * \returns callee-allocated msgb with BSSMAP Reset ACK message */ struct msgb *gsm0808_create_reset_ack(void) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -102,6 +126,8 @@ return msg; } +/*! \brief Create BSSMAP Clear Complete message + * \returns callee-allocated msgb with BSSMAP Clear Complete message */ struct msgb *gsm0808_create_clear_complete(void) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -116,6 +142,9 @@ return msg; } +/*! \brief Create BSSMAP Clear Command message + * \param[in] reason TS 08.08 cause value + * \returns callee-allocated msgb with BSSMAP Clear Command message */ struct msgb *gsm0808_create_clear_command(uint8_t reason) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -130,6 +159,10 @@ return msg; } +/*! \brief Create BSSMAP Cipher Mode Command message + * \param[in] ei Mandatory Encryption Information + * \param[in] cipher_response_mode optional 1-byte Cipher Response Mode + * \returns callee-allocated msgb with BSSMAP Cipher Mode Command message */ struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei, const uint8_t *cipher_response_mode) { @@ -163,6 +196,10 @@ return msg; } +/*! \brief Create BSSMAP Cipher Mode Complete message + * \param[in] layer3 L3 Message to be included + * \param[in] alg_id Chosen Encrpytion Algorithm + * \returns callee-allocated msgb with BSSMAP Cipher Mode Complete message */ struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -188,6 +225,9 @@ return msg; } +/*! \brief Create BSSMAP Cipher Mode Reject message + * \param[in] reason TS 08.08 cause value + * \returns callee-allocated msgb with BSSMAP Cipher Mode Reject message */ struct msgb *gsm0808_create_cipher_reject(uint8_t cause) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -202,6 +242,12 @@ return msg; } +/*! \brief Create BSSMAP Classmark Update message + * \param[in] cm2 Classmark 2 + * \param[in] cm2_len length (in octets) of \a cm2 + * \param[in] cm3 Classmark 3 + * \param[in] cm3_len length (in octets) of \a cm3 + * \returns callee-allocated msgb with BSSMAP Classmark Update message */ struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len) { @@ -221,6 +267,9 @@ return msg; } +/*! \brief Create BSSMAP SAPI N Reject message + * \param[in] link_id Link Identifier + * \returns callee-allocated msgb with BSSMAP SAPI N Reject message */ struct msgb *gsm0808_create_sapi_reject(uint8_t link_id) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -237,6 +286,13 @@ return msg; } +/*! \brief Create BSSMAP Assignment Request message + * \param[in] ct Channel Type + * \param[in] cic Circuit Identity Code (Classic A only) + * \param[in] ss Socket Address of MSC-side RTP socket (AoIP only) + * \param[in] scl Speech Codec List (AoIP only) + * \param[in] ci Call Identifier (Optional, LCLS) + * \returns callee-allocated msgb with BSSMAP Assignment Request message */ struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct, const uint16_t *cic, const struct sockaddr_storage *ss, @@ -293,6 +349,15 @@ return msg; } +/*! \brief Create BSSMAP Assignment Completed message + * \param[in] rr_cause GSM 04.08 RR Cause value + * \param[in] chosen_channel Chosen Channel + * \param[in] encr_alg_id Encryption Algorithm ID + * \param[in] speech_mode Speech Mode + * \param[in] ss Socket Address of BSS-side RTP socket + * \param[in] sc Speech Codec (current) + * \param[in] scl Speech Codec List (permitted) + * \returns callee-allocated msgb with BSSMAP Assignment Complete message */ struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode, const struct sockaddr_storage *ss, @@ -342,6 +407,12 @@ return msg; } +/*! \brief Create BSSMAP Assignment Completed message + * \param[in] rr_cause GSM 04.08 RR Cause value + * \param[in] chosen_channel Chosen Channel + * \param[in] encr_alg_id Encryption Algorithm ID + * \param[in] speech_mode Speech Mode + * \returns callee-allocated msgb with BSSMAP Assignment Complete message */ struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, @@ -351,6 +422,11 @@ speech_mode, NULL, NULL, NULL); } +/*! \brief Create BSSMAP Assignment Failure message + * \param[in] cause BSSMAP Cause value + * \param[in] rr_cause GSM 04.08 RR Cause value + * \param[in] scl Optional Speech Cdec List (AoIP) + * \returns callee-allocated msgb with BSSMAP Assignment Failure message */ struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause, const struct gsm0808_speech_codec_list *scl) @@ -380,12 +456,19 @@ return msg; } +/*! \brief Create BSSMAP Assignment Failure message + * \param[in] cause BSSMAP Cause value + * \param[in] rr_cause GSM 04.08 RR Cause value + * \returns callee-allocated msgb with BSSMAP Assignment Failure message */ struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause) { return gsm0808_create_ass_fail(cause, rr_cause, NULL); } +/*! \brief Create BSSMAP Clear Request message + * \param[in] cause BSSMAP Cause value + * \returns callee-allocated msgb with BSSMAP Clear Request message */ struct msgb *gsm0808_create_clear_rqst(uint8_t cause) { struct msgb *msg; @@ -402,6 +485,12 @@ return msg; } +/*! \brief Create BSSMAP PAGING message + * \param[in] imsi Mandatory paged IMSI in string representation + * \param[in] tmsi Optional paged TMSI + * \param[in] cil Cell Identity List (where to page) + * \param[in] chan_needed Channel Type needed + * \returns callee-allocated msgb with BSSMAP PAGING message */ struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list *cil, const uint8_t *chan_needed) @@ -454,6 +543,9 @@ return msg; } +/*! \brief Prepend a DTAP header to given Message Buffer + * \param[in] msgb Message Buffer + * \param[in] link_id Link Identifier */ void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id) { uint8_t *hh = msgb_push(msg, 3); @@ -462,6 +554,10 @@ hh[2] = msg->len - 3; } +/*! \brief Create BSSMAP DTAP message + * \param[in] msg_l3 Messge Buffer containing Layer3 message + * \param[in] link_id Link Identifier + * \returns callee-allocated msgb with BSSMAP DTAP message */ struct msgb *gsm0808_create_dtap(struct msgb *msg_l3, uint8_t link_id) { struct dtap_header *header; @@ -722,6 +818,7 @@ { 0, NULL } }; +/*! \brief Return string name of BSSMAP Message Type */ const char *gsm0808_bssmap_name(uint8_t msg_type) { return get_value_string(gsm0808_msgt_names, msg_type); @@ -733,7 +830,10 @@ { 0, NULL } }; +/*! \brief Return string name of BSSAP Message Type */ const char *gsm0808_bssap_name(uint8_t msg_type) { return get_value_string(gsm0808_bssap_names, msg_type); } + +/*! @} */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index ff97b2d..bdd02e5 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -39,7 +39,15 @@ #include #include -/* Encode AoIP transport address element */ + +/*! \addtogroup gsm0808 + * @{ + */ + +/*! \brief Encode TS 08.08 AoIP transport address IE + * \param[out] msg Message Buffer to which to append IE + * \param[in] ss Socket Address to be used in IE + * \returns number of bytes added to \a msg */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss) { @@ -80,7 +88,11 @@ return *tlv_len + 2; } -/* Decode AoIP transport address element */ +/*! \brief Decode TS 08.08 AoIP transport address IE + * \param[out] ss Caller-provided memory where decoded socket addr is stored + * \param[in] elem pointer to IE value + * \param[in] len length of \a elem in bytes + * \returns number of bytes parsed */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len) { @@ -168,7 +180,10 @@ return (uint8_t) (msg->tail - old_tail); } -/* Encode Speech Codec element */ +/*! \brief Encode TS 08.08 Speech Codec IE + * \param[out] msg Message Buffer to which IE will be appended + * \param[in] sc Speech Codec to be encoded into IE + * \returns number of bytes appended to \a msg */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc) { @@ -188,7 +203,11 @@ return *tlv_len + 2; } -/* Decode Speech Codec element */ +/*! \brief Decode TS 08.08 Speech Codec IE + * \param[out] sc Caller-allocated memory for Speech Codec + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len) { @@ -244,7 +263,10 @@ return (int)(elem - old_elem); } -/* Encode Speech Codec list */ +/*! \brief Encode TS 08.08 Speech Codec list + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] scl Speech Codec List to be encoded into IE + * \returns number of bytes added to \a msg */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl) { @@ -275,7 +297,11 @@ return *tlv_len + 2; } -/* Decode Speech Codec list */ +/*! \brief Decode TS 08.08 Speech Codec list IE + * \param[out] scl Caller-provided memory to store codec list + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len) { @@ -315,7 +341,10 @@ return (int)(elem - old_elem); } -/* Encode Channel Type element */ +/*! \brief Encode TS 08.08 Channel Type IE + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] ct Channel Type to be encoded + * \returns number of bytes added to \a msg */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct) { @@ -353,7 +382,11 @@ return *tlv_len + 2; } -/* Decode Channel Type element */ +/*! \brief Decode TS 08.08 Channel Type IE + * \param[out] ct Caller-provided memory to store channel type + * \param[in] elem IE Value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len) { @@ -386,7 +419,10 @@ return (int)(elem - old_elem); } -/* Encode Encryption Information element */ +/*! \brief Encode TS 08.08 Encryption Information IE + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] ei Encryption Information to be encoded + * \returns number of bytes appended to \a msg */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei) { @@ -421,7 +457,11 @@ return *tlv_len + 2; } -/* Decode Encryption Information element */ +/*! \brief Decode TS 08.08 Encryption Information IE + * \param[out] ei Caller-provided memory to store encryption information + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len) { @@ -456,7 +496,10 @@ return (int)(elem - old_elem); } -/* Encode Cell Identifier List element */ +/*! \brief Encode TS 08.08 Cell Identifier List IE + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] cil Cell ID List to be encoded + * \returns number of bytes appended to \a msg */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil) { @@ -492,7 +535,11 @@ return *tlv_len + 2; } -/* Decode Cell Identifier List element */ +/*! \brief Decode Cell Identifier List IE + * \param[out] cil Caller-provided memory to store Cell ID list + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len) { @@ -533,3 +580,5 @@ cil->id_list_len = item_count; return (int)(elem - old_elem); } + +/*! @} */ diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 543c9c0..1b25538 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -39,6 +39,12 @@ #include #include +/*! \addtogroup gsm0408 + * @{ + * \brief GSM Mobile Radion Interface L3 messages / TS 04.08 + */ + +/*! \brief TLV parser definitions for TS 04.08 CC */ const struct tlv_definition gsm48_att_tlvdef = { .def = { [GSM48_IE_MOBILE_ID] = { TLV_TYPE_TLV }, @@ -80,7 +86,7 @@ }, }; -/* RR elements */ +/*! \brief TLV parser definitions for TS 04.08 RR */ const struct tlv_definition gsm48_rr_att_tlvdef = { .def = { /* NOTE: Don't add IE 17 = MOBILE_ID here, it already used. */ @@ -125,7 +131,7 @@ }, }; -/* MM elements */ +/*! \brief TLV parser definitions for TS 04.08 MM */ const struct tlv_definition gsm48_mm_att_tlvdef = { .def = { [GSM48_IE_MOBILE_ID] = { TLV_TYPE_TLV }, @@ -164,6 +170,7 @@ { 0, NULL }, }; +/*! \brief return string representation of RR Cause value */ const char *rr_cause_name(uint8_t cause) { return get_value_string(rr_cause_names, cause); @@ -205,6 +212,7 @@ "illegal state 31", }; +/*! \brief return string representation of CC State */ const char *gsm48_cc_state_name(uint8_t state) { if (state < ARRAY_SIZE(cc_state_names)) @@ -252,6 +260,7 @@ { 0, NULL } }; +/*! \brief return string representation of CC Message Type */ const char *gsm48_cc_msg_name(uint8_t msgtype) { return get_value_string(cc_msg_names, msgtype); @@ -359,6 +368,7 @@ { 0, NULL } }; +/*! \brief return string representation of RR Message Type */ const char *gsm48_rr_msg_name(uint8_t msgtype) { return get_value_string(rr_msg_names, msgtype); @@ -398,6 +408,7 @@ { 0, NULL } }; +/*! \brief return string representation of Mobile Identity Type */ const char *gsm48_mi_type_name(uint8_t mi) { return get_value_string(mi_type_names, mi); @@ -437,7 +448,12 @@ } } -/* Convert given mcc and mnc to BCD and write to *bcd_dst, which must be an +/* \brief Convert MCC + MNC to BCD representation + * \param[out] bcd_dst caller-allocated memory for output + * \param[in] mcc Mobile Country Code + * \param[in] mnc Mobile Network Code + * + * Convert given mcc and mnc to BCD and write to *bcd_dst, which must be an * allocated buffer of (at least) 3 bytes length. */ void gsm48_mcc_mnc_to_bcd(uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc) { @@ -477,6 +493,11 @@ } } +/*! \brief Encode TS 04.08 Location Area Identifier + * \param[out] caller-provided memory for output + * \param[in] mcc Mobile Country Code + * \param[in] mnc Mobile Network Code + * \param[in] lac Location Area Code */ void gsm48_generate_lai(struct gsm48_loc_area_id *lai48, uint16_t mcc, uint16_t mnc, uint16_t lac) { @@ -484,7 +505,14 @@ lai48->lac = osmo_htons(lac); } -/* Attention: this function returns true integers, not hex! */ +/*! \brief Decode TS 04.08 Location Area Identifier + * \param[in] Location Area Identifier (encoded) + * \param[out] mcc Mobile Country Code + * \param[out] mnc Mobile Network Code + * \param[out] lac Location Area Code + * \returns 0 + * + * Attention: this function returns true integers, not hex! */ int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) { @@ -537,6 +565,10 @@ } } +/*! \brief Generate TS 04.08 Mobile ID from TMSI + * \param[out] buf Caller-provided output buffer (7 bytes) + * \param[in] tmsi TMSI to be encoded + * \returns number of byes encoded (always 7) */ int gsm48_generate_mid_from_tmsi(uint8_t *buf, uint32_t tmsi) { uint32_t tmsi_be = osmo_htonl(tmsi); @@ -549,6 +581,10 @@ return 7; } +/*! \brief Generate TS 04.08 Mobile ID from IMSI + * \param[out] buf Caller-provided output buffer + * \param[in] imsi IMSI to be encoded + * \returns number of bytes used in \a buf */ int gsm48_generate_mid_from_imsi(uint8_t *buf, const char *imsi) { unsigned int length = strlen(imsi), i, off = 0; @@ -578,7 +614,12 @@ return 2 + buf[1]; } -/* Convert Mobile Identity (10.5.1.4) to string */ +/*! \brief Convert TS 04.08 Mobile Identity (10.5.1.4) to string + * \param[out] string Caller-provided buffer for output + * \param[in] str_len Length of \a string in bytes + * \param[in] mi Mobile Identity to be stringified + * \param[in] mi_len Length of \a mi in bytes + * \returns length of string written to \a string */ int gsm48_mi_to_string(char *string, const int str_len, const uint8_t *mi, const int mi_len) { @@ -621,6 +662,9 @@ return str_cur - string; } +/*! \brief Parse TS 04.08 Routing Area Identifier + * \param[out] Caller-provided memory for decoded RA ID + * \param[in] buf Input buffer pointing to RAI IE value */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf) { raid->mcc = (buf[0] & 0xf) * 100; @@ -642,6 +686,10 @@ raid->rac = buf[5]; } +/*! \brief Encode a TS 04.08 Routing Area Identifier + * \param[out] buf Caller-provided output buffer of 6 bytes + * \param[in] raid Routing Area ID to be encoded + * \returns number of bytes used in \a buf */ int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) { uint16_t mcc = raid->mcc; @@ -669,7 +717,13 @@ return 6; } -/* From Table 10.5.33 of GSM 04.08 */ +/*! \brief Determine number of paging sub-channels + * \param[in] chan_desc Control Channel Description + * \returns number of paging sub-channels + * + * Uses From Table 10.5.33 of GSM 04.08 to determine the number of + * paging sub-channels in the given control channel configuration + */ int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc) { unsigned int n_pag_blocks = gsm0502_get_n_pag_blocks(chan_desc); @@ -680,6 +734,7 @@ return n_pag_blocks * (chan_desc->bs_pa_mfrms + 2); } +/*! \brief TS 04.08 Protocol Descriptor names */ const struct value_string gsm48_pdisc_names[] = { OSMO_VALUE_STRING(GSM48_PDISC_GROUP_CC), OSMO_VALUE_STRING(GSM48_PDISC_BCAST_CC), @@ -699,6 +754,7 @@ { 0, NULL } }; +/*! \brief TS 04.08 RR Message Type names */ const struct value_string gsm48_rr_msgtype_names[] = { OSMO_VALUE_STRING(GSM48_MT_RR_INIT_REQ), OSMO_VALUE_STRING(GSM48_MT_RR_ADD_ASS), @@ -791,6 +847,7 @@ { 0, NULL } }; +/*! \brief TS 04.08 MM Message Type names */ const struct value_string gsm48_mm_msgtype_names[] = { OSMO_VALUE_STRING(GSM48_MT_MM_IMSI_DETACH_IND), OSMO_VALUE_STRING(GSM48_MT_MM_LOC_UPD_ACCEPT), @@ -820,6 +877,7 @@ { 0, NULL } }; +/*! \brief TS 04.08 CC Message Type names */ const struct value_string gsm48_cc_msgtype_names[] = { OSMO_VALUE_STRING(GSM48_MT_CC_ALERTING), OSMO_VALUE_STRING(GSM48_MT_CC_CALL_CONF), @@ -862,12 +920,12 @@ { 0, NULL } }; -/*! /brief Compose a string naming the message type for given protocol. +/*! \brief Compose a string naming the message type for given protocol. * If the message type string is known, return the message type name, otherwise * return ":". - * /param pdisc[in] protocol discriminator like GSM48_PDISC_MM - * /param msg_type[in] message type like GSM48_MT_MM_LOC_UPD_REQUEST - * /returns statically allocated string or string constant. + * \param[in] pdisc protocol discriminator like GSM48_PDISC_MM + * \param[in] msg_type message type like GSM48_MT_MM_LOC_UPD_REQUEST + * \returns statically allocated string or string constant. */ const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type) { @@ -896,3 +954,5 @@ gsm48_pdisc_name(pdisc), msg_type); return namebuf; } + +/*! @} */ diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index 2cc0645..20d0075 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -34,12 +34,20 @@ #include #include +/*! \addtogroup gsm0408 + * @{ + */ + static const char bcd_num_digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '#', 'a', 'b', 'c', '\0' }; -/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */ +/*! \brief decode a 'called/calling/connect party BCD number' as in 10.5.4.7 + * \param[out] Caller-provided output buffer + * \param[in] bcd_lv Length-Value portion of to-be-decoded IE + * \param[in] h_len Length of an optional heder between L and V portion + * \returns - in case of success; negative on error */ int gsm48_decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv, int h_len) { @@ -65,7 +73,7 @@ return 0; } -/* convert a single ASCII character to call-control BCD */ +/*! \brief convert a single ASCII character to call-control BCD */ static int asc_to_bcd(const char asc) { int i; @@ -77,7 +85,12 @@ return -EINVAL; } -/* convert a ASCII phone number to 'called/calling/connect party BCD number' */ +/*! \brief convert a ASCII phone number to 'called/calling/connect party BCD number' + * \param[out] bcd_lv Caller-provided output buffer + * \param[in] max_len Maximum Length of \a bcd_lv + * \param[in] h_len Length of an optional heder between L and V portion + * \param[in] input phone number as 0-terminated ASCII + * \returns number of bytes used in \a bcd_lv */ int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len, int h_len, const char *input) { @@ -110,7 +123,10 @@ return (bcd_cur - bcd_lv); } -/* TS 04.08 10.5.4.5: decode 'bearer capability' */ +/*! \brief Decode TS 04.08 Bearer Capability IE (10.5.4.5) + * \param[out] Caller-provided memory for decoded output + * \[aram[in] LV portion of TS 04.08 Bearer Capability + * \returns 0 on success; negative on error */ int gsm48_decode_bearer_cap(struct gsm_mncc_bearer_cap *bcap, const uint8_t *lv) { @@ -219,7 +235,11 @@ return 0; } -/* TS 04.08 10.5.4.5: encode 'bearer capability' */ +/*! \brief Encode TS 04.08 Bearer Capability IE (10.5.4.5) + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] lv_only Write only LV portion (1) or TLV (0) + * \param[in] bcap Decoded Bearer Capability to be encoded + * \returns 0 on success; negative on error */ int gsm48_encode_bearer_cap(struct msgb *msg, int lv_only, const struct gsm_mncc_bearer_cap *bcap) { @@ -274,7 +294,10 @@ return 0; } -/* TS 04.08 10.5.4.5a: decode 'call control cap' */ +/*! \brief Decode TS 04.08 Call Control Capabilities IE (10.5.4.5a) + * \param[out] Caller-provided memory for decoded CC capabilities + * \param[in] lv Length-Value of IE + * \retursns 0 on success; negative on error */ int gsm48_decode_cccap(struct gsm_mncc_cccap *ccap, const uint8_t *lv) { uint8_t in_len = lv[0]; @@ -289,7 +312,10 @@ return 0; } -/* TS 04.08 10.5.4.5a: encode 'call control cap' */ +/*! \brief Encodoe TS 04.08 Call Control Capabilities (10.5.4.5a) + * \param[out] msg Message Buffer to which to append IE (as TLV) + * \param[in] ccap Decoded CC Capabilities to be encoded + * \returns 0 on success; negative on error */ int gsm48_encode_cccap(struct msgb *msg, const struct gsm_mncc_cccap *ccap) { @@ -307,7 +333,10 @@ return 0; } -/* TS 04.08 10.5.4.7: decode 'called party BCD number' */ +/*! \brief Decode TS 04.08 Called Party BCD Number IE (10.5.4.7) + * \param[out] called Caller-provided memory for decoded number + * \param[in] lv Length-Value portion of IE + * \returns 0 on success; negative on error */ int gsm48_decode_called(struct gsm_mncc_number *called, const uint8_t *lv) { @@ -326,7 +355,10 @@ return 0; } -/* TS 04.08 10.5.4.7: encode 'called party BCD number' */ +/*! \brief Encode TS 04.08 Called Party IE (10.5.4.7) + * \param[out] msg Mesage Buffer to which to append IE (as TLV) + * \param[in] called MNCC Number to encode/append + * \returns 0 on success; negative on error */ int gsm48_encode_called(struct msgb *msg, const struct gsm_mncc_number *called) { @@ -348,7 +380,10 @@ return 0; } -/* decode callerid of various IEs */ +/*! \brief Decode TS 04.08 Caller ID + * \param[out] called Caller-provided memory for decoded number + * \param[in] lv Length-Value portion of IE + * \returns 0 on success; negative on error */ int gsm48_decode_callerid(struct gsm_mncc_number *callerid, const uint8_t *lv) { @@ -375,7 +410,12 @@ return 0; } -/* encode callerid of various IEs */ +/*! \brief Encode TS 04.08 Caller ID IE + * \param[out] msg Mesage Buffer to which to append IE (as TLV) + * \param[in] ie IE Identifier (tag) + * \param[in] max_len maximum generated output in bytes + * \param[in] callerid MNCC Number to encode/append + * \returns 0 on success; negative on error */ int gsm48_encode_callerid(struct msgb *msg, int ie, int max_len, const struct gsm_mncc_number *callerid) { @@ -406,7 +446,10 @@ return 0; } -/* TS 04.08 10.5.4.11: decode 'cause' */ +/*! \brief Decode TS 04.08 Cause IE (10.5.4.11) + * \param[out] cause Caller-provided memory for output + * \param[in] lv LV portion of Cause IE + * \returns 0 on success; negative on error */ int gsm48_decode_cause(struct gsm_mncc_cause *cause, const uint8_t *lv) { @@ -449,7 +492,11 @@ return 0; } -/* TS 04.08 10.5.4.11: encode 'cause' */ +/*! \brief Encode TS 04.08 Cause IE (10.5.4.11) + * \param[out] msg Message Buffer to which to append IE + * \param[in] lv_only Encode as LV (1) or TLV (0) + * \param[in] cause Cause value to be encoded + * \returns 0 on success; negative on error */ int gsm48_encode_cause(struct msgb *msg, int lv_only, const struct gsm_mncc_cause *cause) { @@ -489,49 +536,49 @@ return 0; } -/* TS 04.08 10.5.4.9: decode 'calling number' */ +/*! \brief Decode TS 04.08 Calling Number IE (10.5.4.9) */ int gsm48_decode_calling(struct gsm_mncc_number *calling, const uint8_t *lv) { return gsm48_decode_callerid(calling, lv); } -/* TS 04.08 10.5.4.9: encode 'calling number' */ +/*! \brief Encode TS 04.08 Calling Number IE (10.5.4.9) */ int gsm48_encode_calling(struct msgb *msg, const struct gsm_mncc_number *calling) { return gsm48_encode_callerid(msg, GSM48_IE_CALLING_BCD, 14, calling); } -/* TS 04.08 10.5.4.13: decode 'connected number' */ +/*! \brief Decode TS 04.08 Connected Number IE (10.5.4.13) */ int gsm48_decode_connected(struct gsm_mncc_number *connected, const uint8_t *lv) { return gsm48_decode_callerid(connected, lv); } -/* TS 04.08 10.5.4.13: encode 'connected number' */ +/*! \brief Encode TS 04.08 Connected Number IE (10.5.4.13) */ int gsm48_encode_connected(struct msgb *msg, const struct gsm_mncc_number *connected) { return gsm48_encode_callerid(msg, GSM48_IE_CONN_BCD, 14, connected); } -/* TS 04.08 10.5.4.21b: decode 'redirecting number' */ +/*! \brief Decode TS 04.08 Redirecting Number IE (10.5.4.21b) */ int gsm48_decode_redirecting(struct gsm_mncc_number *redirecting, const uint8_t *lv) { return gsm48_decode_callerid(redirecting, lv); } -/* TS 04.08 10.5.4.21b: encode 'redirecting number' */ +/*! \brief Encode TS 04.08 Redirecting Number IE (10.5.4.21b) */ int gsm48_encode_redirecting(struct msgb *msg, const struct gsm_mncc_number *redirecting) { return gsm48_encode_callerid(msg, GSM48_IE_REDIR_BCD, 19, redirecting); } -/* TS 04.08 10.5.4.15: decode 'facility' */ +/*! \brief Decode TS 04.08 Facility IE (10.5.4.15) */ int gsm48_decode_facility(struct gsm_mncc_facility *facility, const uint8_t *lv) { @@ -549,7 +596,7 @@ return 0; } -/* TS 04.08 10.5.4.15: encode 'facility' */ +/*! \brief Encode TS 04.08 Facility IE (10.5.4.15) */ int gsm48_encode_facility(struct msgb *msg, int lv_only, const struct gsm_mncc_facility *facility) { @@ -568,7 +615,7 @@ return 0; } -/* TS 04.08 10.5.4.20: decode 'notify' */ +/*! \brief Decode TS 04.08 Notify IE (10.5.4.20) */ int gsm48_decode_notify(int *notify, const uint8_t *v) { *notify = v[0] & 0x7f; @@ -576,7 +623,7 @@ return 0; } -/* TS 04.08 10.5.4.20: encode 'notify' */ +/*! \brief Encode TS 04.08 Notify IE (10.5.4.20) */ int gsm48_encode_notify(struct msgb *msg, int notify) { msgb_v_put(msg, notify | 0x80); @@ -584,7 +631,7 @@ return 0; } -/* TS 04.08 10.5.4.23: decode 'signal' */ +/*! \brief Decode TS 04.08 Signal IE (10.5.4.23) */ int gsm48_decode_signal(int *signal, const uint8_t *v) { *signal = v[0]; @@ -592,7 +639,7 @@ return 0; } -/* TS 04.08 10.5.4.23: encode 'signal' */ +/*! \brief Encode TS 04.08 Signal IE (10.5.4.23) */ int gsm48_encode_signal(struct msgb *msg, int signal) { msgb_tv_put(msg, GSM48_IE_SIGNAL, signal); @@ -600,7 +647,7 @@ return 0; } -/* TS 04.08 10.5.4.17: decode 'keypad' */ +/*! \brief Decode TS 04.08 Keypad IE (10.5.4.17) */ int gsm48_decode_keypad(int *keypad, const uint8_t *lv) { uint8_t in_len = lv[0]; @@ -613,7 +660,7 @@ return 0; } -/* TS 04.08 10.5.4.17: encode 'keypad' */ +/*! \brief Encode TS 04.08 Keypad IE (10.5.4.17) */ int gsm48_encode_keypad(struct msgb *msg, int keypad) { msgb_tv_put(msg, GSM48_IE_KPD_FACILITY, keypad); @@ -621,7 +668,7 @@ return 0; } -/* TS 04.08 10.5.4.21: decode 'progress' */ +/*! \brief Decode TS 04.08 Progress IE (10.5.4.21) */ int gsm48_decode_progress(struct gsm_mncc_progress *progress, const uint8_t *lv) { @@ -637,7 +684,7 @@ return 0; } -/* TS 04.08 10.5.4.21: encode 'progress' */ +/*! \brief Encode TS 04.08 Progress IE (10.5.4.21) */ int gsm48_encode_progress(struct msgb *msg, int lv_only, const struct gsm_mncc_progress *p) { @@ -654,7 +701,7 @@ return 0; } -/* TS 04.08 10.5.4.25: decode 'user-user' */ +/*! \brief Decode TS 04.08 User-User IE (10.5.4.25) */ int gsm48_decode_useruser(struct gsm_mncc_useruser *uu, const uint8_t *lv) { @@ -680,7 +727,7 @@ return 0; } -/* TS 04.08 10.5.4.25: encode 'useruser' */ +/*! \brief Encode TS 04.08 User-User IE (10.5.4.25) */ int gsm48_encode_useruser(struct msgb *msg, int lv_only, const struct gsm_mncc_useruser *uu) { @@ -700,7 +747,7 @@ return 0; } -/* TS 04.08 10.5.4.24: decode 'ss version' */ +/*! \brief Decode TS 04.08 SS Version IE (10.5.4.24) */ int gsm48_decode_ssversion(struct gsm_mncc_ssversion *ssv, const uint8_t *lv) { @@ -715,7 +762,7 @@ return 0; } -/* TS 04.08 10.5.4.24: encode 'ss version' */ +/*! \brief Encode TS 04.08 SS Version IE (10.5.4.24) */ int gsm48_encode_ssversion(struct msgb *msg, const struct gsm_mncc_ssversion *ssv) { @@ -733,7 +780,7 @@ /* decode 'more data' does not require a function, because it has no value */ -/* TS 04.08 10.5.4.19: encode 'more data' */ +/*! \brief Encode TS 04.08 More Data IE (10.5.4.19) */ int gsm48_encode_more(struct msgb *msg) { uint8_t *ie; @@ -756,7 +803,11 @@ return res; } -/* decode "Cell Channel Description" (10.5.2.1b) and other frequency lists */ +/*! \brief Decode TS 04.08 Cell Channel Description IE (10.5.2.1b) and other frequency lists + * \param[out] f Caller-provided output memory + * \param[in] cd Cell Channel Description IE + * \param[in] len Length of \a cd in bytes + * \returns 0 on success; negative on error */ int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd, uint8_t len, uint8_t mask, uint8_t frqt) { @@ -1190,3 +1241,4 @@ return 0; } +/*! @} */ diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 5fef208..bd986d7 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -26,9 +26,11 @@ #include -/* Protocol related stuff, should go into libosmocore */ +/*! \addtogroup gsm0408 + * @{ + */ -/* 10.5.5.14 GPRS MM Cause / Table 10.5.147 */ +/*! \brief 10.5.5.14 GPRS MM Cause / Table 10.5.147 */ const struct value_string gsm48_gmm_cause_names_[] = { { GMM_CAUSE_IMSI_UNKNOWN, "IMSI unknown in HLR" }, { GMM_CAUSE_ILLEGAL_MS, "Illegal MS" }, @@ -73,7 +75,7 @@ const struct value_string *gsm48_gmm_cause_names = gsm48_gmm_cause_names_; -/* 10.5.6.6 SM Cause / Table 10.5.157 */ +/*! \brief 10.5.6.6 SM Cause / Table 10.5.157 */ const struct value_string gsm48_gsm_cause_names_[] = { { GSM_CAUSE_OPER_DET_BARR, "Operator Determined Barring" }, { GSM_CAUSE_MBMS_CAP_INSUF, "MBMS bearer capabilities insufficient for the service" }, @@ -140,6 +142,7 @@ } } +/*! \brief String names of GMM message types */ const struct value_string gprs_msgt_gmm_names[] = { { GSM48_MT_GMM_ATTACH_REQ, "ATTACH REQUEST" }, { GSM48_MT_GMM_ATTACH_ACK, "ATTACH ACK" }, @@ -164,7 +167,7 @@ { 0, NULL } }; -/* 10.5.5.2 */ +/*! \brief String names of GPRS Attach types according to 10.5.5.2 */ const struct value_string gprs_att_t_strs_[] = { { GPRS_ATT_T_ATTACH, "GPRS attach" }, { GPRS_ATT_T_ATT_WHILE_IMSI, "GPRS attach while IMSI attached" }, @@ -174,6 +177,7 @@ const struct value_string *gprs_att_t_strs = gprs_att_t_strs_; +/*! \brief String names of GPRS Location Update Types */ const struct value_string gprs_upd_t_strs_[] = { { GPRS_UPD_T_RA, "RA updating" }, { GPRS_UPD_T_RA_LA, "combined RA/LA updating" }, @@ -184,7 +188,7 @@ const struct value_string *gprs_upd_t_strs = gprs_upd_t_strs_; -/* 10.5.5.5 */ +/*! \brief String names of GMM MO Detach Types according to 10.5.5.5 */ const struct value_string gprs_det_t_mo_strs_[] = { { GPRS_DET_T_MO_GPRS, "GPRS detach" }, { GPRS_DET_T_MO_IMSI, "IMSI detach" }, @@ -194,6 +198,7 @@ const struct value_string *gprs_det_t_mo_strs = gprs_det_t_mo_strs_; +/*! \brief String names of GMM MT Detach Types according to 10.5.5.5 */ const struct value_string gprs_det_t_mt_strs_[] = { { GPRS_DET_T_MT_REATT_REQ, "re-attach required" }, { GPRS_DET_T_MT_REATT_NOTREQ, "re-attach not required" }, @@ -203,6 +208,7 @@ const struct value_string *gprs_det_t_mt_strs = gprs_det_t_mt_strs_; +/*! \brief String names of GMM Service Types */ const struct value_string gprs_service_t_strs_[] = { { GPRS_SERVICE_T_SIGNALLING, "signalling" }, { GPRS_SERVICE_T_DATA, "data" }, @@ -213,3 +219,5 @@ }; const struct value_string *gprs_service_t_strs = gprs_service_t_strs_; + +/*! @} */ diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index d16adf7..9cb5df6 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -134,7 +134,10 @@ return -1; } -/* Compute the number of octets from the number of septets, for instance: 47 septets needs 41,125 = 42 octets */ +/*! \brife Compute number of octets from number of septets, + * for instance: 47 septets needs 41,125 = 42 octets + * \param[in sept_len Number of Septets + * \returns Number of octets required */ uint8_t gsm_get_octet_len(const uint8_t sept_len){ int octet_len = (sept_len * 7) / 8; if ((sept_len * 7) % 8 != 0) @@ -143,7 +146,13 @@ return octet_len; } -/* GSM 03.38 6.2.1 Character unpacking */ +/*! \brief TS 03.38 7-bit Character unpacking (6.2.1) + * \param[out] text Caller-provided output text buffer + * \param[in] n Length of \a text + * \param[in] user_data Input Data (septets) + * \param[in] septet_l Number of septets in \a user_data + * \param[in] ud_hdr_ind User Data Header present in data + * \returns number of bytes written to \a text */ int gsm_7bit_decode_n_hdr(char *text, size_t n, const uint8_t *user_data, uint8_t septet_l, uint8_t ud_hdr_ind) { unsigned shift = 0; @@ -201,11 +210,13 @@ return text - text_buf_begin; } +/*! \brief Decode 7bit GSM Alphabet */ int gsm_7bit_decode_n(char *text, size_t n, const uint8_t *user_data, uint8_t septet_l) { return gsm_7bit_decode_n_hdr(text, n, user_data, septet_l, 0); } +/*! \brief Decode 7bit GSM Alphabet (USSD) */ int gsm_7bit_decode_n_ussd(char *text, size_t n, const uint8_t *user_data, uint8_t length) { int nchars; @@ -218,7 +229,15 @@ return nchars; } -/* GSM 03.38 6.2.1 Prepare character packing */ +/*! \brief Encode a ASCII characterrs as 7-bit GSM alphabet (TS 03.38) + * + * This function converts a zero-terminated input string \a data from + * ASCII into octet-aligned 7-bit GSM characters. No packing is + * performed. + * + * \param[out] result caller-allocated output buffer + * \param[in] data input data, ASCII + * \returns number of octets used in \a result */ int gsm_septet_encode(uint8_t *result, const char *data) { int i, y = 0; @@ -247,7 +266,12 @@ return y; } -/* 7bit to octet packing */ +/*! \brief GSM Default Alphabet 7bit to octet packing + * \param[out] result Caller-provided output buffer + * \param[in] rdata Input data septets + * \param[in] septet_len Length of \a rdata + * \param[in] padding padding bits at start + * \returns number of bytes used in \a result */ int gsm_septets2octets(uint8_t *result, const uint8_t *rdata, uint8_t septet_len, uint8_t padding) { int i = 0, z = 0; @@ -293,7 +317,12 @@ return z; } -/* GSM 03.38 6.2.1 Character packing */ +/*! \brief GSM 7-bit alphabet TS 03.38 6.2.1 Character packing + * \param[out] result Caller-provided output buffer + * \param[in] n Maximum length of \a result in bytes + * \param[in] data octet-aligned string + * \param[out] octets Number of octets encoded + * \returns number of septets encoded */ int gsm_7bit_encode_n(uint8_t *result, size_t n, const char *data, int *octets) { int y = 0; @@ -332,6 +361,12 @@ return y; } +/*! \brief Encode according to GSM 7-bit alphabet (TS 03.38 6.2.1) for USSD + * \param[out] result Caller-provided output buffer + * \param[in] n Maximum length of \a result in bytes + * \param[in] data octet-aligned string + * \param[out] octets Number of octets encoded + * \returns number of septets encoded */ int gsm_7bit_encode_n_ussd(uint8_t *result, size_t n, const char *data, int *octets) { int y; @@ -368,7 +403,10 @@ return 3; } -/* convert power class to dBm according to GSM TS 05.05 */ +/*! \brief Convert power class to dBm according to GSM TS 05.05 + * \param[in] band GSM frequency band + * \param[in] class GSM power class + * \returns maximum transmit power of power class in dBm */ unsigned int ms_class_gmsk_dbm(enum gsm_band band, int class) { switch (band) { @@ -409,8 +447,11 @@ return -EINVAL; } -/* determine power control level for given dBm value, as indicated - * by the tables in chapter 4.1.1 of GSM TS 05.05 */ +/*! \brief determine power control level for given dBm value, as indicated + * by the tables in chapter 4.1.1 of GSM TS 05.05 + * \param[in] GSM frequency band + * \param[in] dbm RF power value in dBm + * \returns TS 05.05 power control level */ int ms_pwr_ctl_lvl(enum gsm_band band, unsigned int dbm) { switch (band) { @@ -459,6 +500,10 @@ return -EINVAL; } +/*! \brief Convert TS 05.05 power level to absolute dBm value + * \param[in] band GSM frequency band + * \param[in] lvl TS 05.05 power control level + * \returns RF power level in dBm */ int ms_pwr_dbm(enum gsm_band band, uint8_t lvl) { lvl &= 0x1f; @@ -497,7 +542,9 @@ return -EINVAL; } -/* According to TS 05.08 Chapter 8.1.4 */ +/*! \brief Convert TS 05.08 RxLev to dBm (TS 05.08 Chapter 8.1.4) + * \param[in] rxlev TS 05.08 RxLev value + * \returns Received RF power in dBm */ int rxlev2dbm(uint8_t rxlev) { if (rxlev > 63) @@ -506,7 +553,9 @@ return -110 + rxlev; } -/* According to TS 05.08 Chapter 8.1.4 */ +/*! \brief Convert RF signal level in dBm to TS 05.08 RxLev (TS 05.08 Chapter 8.1.4) + * \param[in] dbm RF signal level in dBm + * \returns TS 05.08 RxLev value */ uint8_t dbm2rxlev(int dbm) { int rxlev = dbm + 110; @@ -519,6 +568,7 @@ return rxlev; } +/*! \brief Return string name of a given GSM Band */ const char *gsm_band_name(enum gsm_band band) { switch (band) { @@ -542,6 +592,7 @@ return "invalid"; } +/*! \brief Parse string name of a GSM band */ enum gsm_band gsm_band_parse(const char* mhz) { while (*mhz && !isdigit(*mhz)) @@ -572,6 +623,10 @@ } } +/*! \brief Resolve GSM band from ARFCN + * In Osmocom, we use the highest bit of the \a arfcn to indicate PCS + * \param[in] arfcn Osmocom ARFCN, highest bit determines PCS mode + * \returns GSM Band */ enum gsm_band gsm_arfcn2band(uint16_t arfcn) { int is_pcs = arfcn & ARFCN_PCS; @@ -621,7 +676,10 @@ { /* Guard */ } }; -/* Convert an ARFCN to the frequency in MHz * 10 */ +/*! \brief Convert an ARFCN to the frequency in MHz * 10 + * \param[in] arfcn GSM ARFCN to convert + * \param[in] uplink Uplink (1) or Downlink (0) frequency + * \returns Frequency in units of 1/10ths of MHz (100kHz) */ uint16_t gsm_arfcn2freq10(uint16_t arfcn, int uplink) { struct gsm_freq_range *r; @@ -645,7 +703,10 @@ return uplink ? freq10_ul : freq10_dl; } -/* Convert a Frequency in MHz * 10 to ARFCN */ +/*! \brief Convert a Frequency in MHz * 10 to ARFCN + * \param[in] freq10 Frequency in units of 1/10ths of MHz (100kHz) + * \param[in] uplink Frequency is Uplink (1) or Downlink (0) + * \returns ARFCN in case of success; 0xffff on error */ uint16_t gsm_freq102arfcn(uint16_t freq10, int uplink) { struct gsm_freq_range *r; @@ -675,6 +736,9 @@ return arfcn; } +/*! \brief Parse GSM Frame Number into struct \ref gsm_time + * \param[out] time Caller-provided memory for \ref gsm_time + * \param[in] fn GSM Frame Number */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn) { time->fn = fn; @@ -684,13 +748,18 @@ time->tc = (time->fn / 51) % 8; } +/*! \brief Encode decoded \ref gsm_time to Frame Number + * \param[in] time GSM Time in decoded structure + * \returns GSM Frame Number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time) { /* TS 05.02 Chapter 4.3.3 TDMA frame number */ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } -/*! \brief append range1024 encoded data to bit vector */ +/*! \brief append range1024 encoded data to bit vector + * \param[out] bv Caller-provided output bit-vector + * \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); @@ -724,7 +793,7 @@ bitvec_set_uint(bv, r->w16, 6); } -/* TS 23.003 Chapter 2.6 */ +/*! \brief Determine GPRS TLLI Type (TS 23.003 Chapter 2.6) */ int gprs_tlli_type(uint32_t tlli) { if ((tlli & 0xc0000000) == 0xc0000000) @@ -743,6 +812,10 @@ return TLLI_RESERVED; } +/*! \brief Determine TLLI from P-TMSI + * \param[in] p_tmsi P-TMSI + * \param[in] type TLLI Type we want to derive from \a p_tmsi + * \returns TLLI of given type */ uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type) { uint32_t tlli; diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index a813ed8..3cac201 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -31,6 +31,11 @@ #include +/*! \addtogroup gsup + * @{ + * \brief Osmocom Generic Subscriber Update Protocol + */ + const struct value_string osmo_gsup_message_type_names[] = { OSMO_VALUE_STRING(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST), OSMO_VALUE_STRING(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR), @@ -536,3 +541,5 @@ msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn); } } + +/*! @} */ diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index fa6a8b0..5c37d64 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -41,6 +41,11 @@ #include #include +/*! \addtogroup ipa + * @{ + * \brief IPA Multiplex utility routines + */ + #define IPA_ALLOC_SIZE 1200 /* @@ -581,3 +586,5 @@ return NULL; return nmsg; } + +/*! @} */ diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 310df65..b7a9539 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -23,6 +23,7 @@ /*! \addtogroup lapd * @{ + * \brief Osmocom LAPD core, used for Q.921, LAPDm and others */ /*! \file lapd_core.c */ diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 99099d1..8ec942f 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -23,6 +23,7 @@ /*! \addtogroup lapdm * @{ + * \brief GSM LAPDm (TS 04.06) implementation */ /*! \file lapdm.c */ diff --git a/src/gsm/oap.c b/src/gsm/oap.c index 1494a6a..5706e8f 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -28,6 +28,11 @@ #include +/*! \addtogroup oap + * @{ + * \brief Osmocom Authentication Protocol + */ + /*! \brief Decode OAP message data. * \param[out] oap_msg Parsed data is written to this instance. * \param[in] data Pointer to the data buffer containing the OAP message. @@ -182,3 +187,5 @@ msg->l2h = msg->data; } + +/*! @} */ diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 910e848..5bdb006 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -30,6 +30,7 @@ /*! \addtogroup rsl * @{ + * \brief GSM Radio Signalling Link (TS 08.58) */ /*! \file rsl.c */ @@ -39,7 +40,9 @@ /*! \brief Headroom size for RSL \ref msgb_alloc */ #define RSL_ALLOC_HEADROOM 56 -/*! \brief Initialize a RSL RLL header */ +/*! \brief Initialize a RSL RLL header + * \param[out] dh Caller-allocated RSL RLL header + * \param[in] msg_type Message Type */ void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type) { dh->c.msg_discr = ABIS_RSL_MDISC_RLL; @@ -48,7 +51,9 @@ dh->ie_link_id = RSL_IE_LINK_IDENT; } -/*! \brief Initialize a RSL Common Channel header */ +/*! \brief Initialize a RSL Common Channel header + * \param[out] ch Caller-allocated RSL Common Channel Header + * \param[in] msg_type Message Type */ void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type) { ch->c.msg_discr = ABIS_RSL_MDISC_COM_CHAN; @@ -137,7 +142,11 @@ }, }; -/*! \brief Encode channel number as per Section 9.3.1 */ +/*! \brief Encode channel number as per Section 9.3.1 + * \param[in] Channel Type (RSL_CHAN_...) + * \param[in] subch Sub-Channel within Channel + * \param[in] timeslot Air interface timeslot + * \returns RSL Channel Number (TS 08.58 9.3.1) */ uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot) { uint8_t ret; @@ -455,7 +464,12 @@ } } -/*! \brief Push a RSL RLL header onto an existing msgb */ +/*! \brief Push a RSL RLL header onto an existing msgb + * \param msg Message Buffer to which RLL header shall be pushed + * \param[in] msg_type RSL Message Type + * \param[in] chan_nr RSL Channel Number + * \param[in] link_id RSL Link Identifier + * \param[in] transparent Transparent to BTS (1) or not (0) */ void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent) { @@ -472,7 +486,12 @@ msg->l2h = (uint8_t *)rh; } -/*! \brief Push a RSL RLL header with L3_INFO IE */ +/*! \brief Wrap msgb in L3 Info IE and push a RSL RLL header + * \param[in] msg Message Buffer to which L3 Header shall be appended + * \param[in] msg_type RSL Message Type + * \param[in] chan_hr RSL Channel Number + * \param[in] link_id Link Identififer + * \param[in] transparent Transparent to BTS (1) or not (0) */ void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent) { @@ -488,7 +507,12 @@ rsl_rll_push_hdr(msg, msg_type, chan_nr, link_id, transparent); } -/*! \brief Create msgb with RSL RLL header */ +/*! \brief Create msgb with RSL RLL header + * \param[in] msg_type RSL Message Type + * \param[in] chan_nr RSL Channel Number + * \param[in] link_id RSL Link Identifier + * \param[in] transparent Transparent to BTS (1) or not (0) + * \returns callee-allocated msgb; NULL on error */ struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent) { @@ -515,6 +539,7 @@ return msg; } +/*! \brief TLV parser definitions for IPA embedded IEs */ const struct tlv_definition rsl_ipac_eie_tlvdef = { .def = { [RSL_IPAC_EIE_RXLEV] = { TLV_TYPE_TV }, @@ -541,6 +566,7 @@ }, }; +/*! \brief String names of RSL Channel Activation Types */ const struct value_string rsl_act_type_names[] = { { RSL_ACT_TYPE_INITIAL, "INITIAL" }, { RSL_ACT_TYPE_REACT, "REACT" }, diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index 4cc43f6..d7604c6 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -25,7 +25,22 @@ /*! \addtogroup tlv * @{ + * \brief Osmocom TLV Parser + * + * The Osmocom TLV parser is intended to operate as a low-level C + * implementation without dynamic memory allocations. Basically, it + * iterates over the IE (Information Elements) of the message and fills + * an array of pointers, indexed by the IEI (IE Identifier). The + * parser output is thus an array of pointers to the start of the + * respective IE inside the message. + * + * The TLV parser is configured by a TLV parser definition, which + * determines which if the IEIs for a given protocol are of which + * particular type. Types are e.g. TV (Tag + single byte value), Tag + + * fixed-length value, TLV with 8bit length, TLV with 16bit length, TLV + * with variable-length length field, etc. */ + /*! \file tlv_parser.c */ struct tlv_definition tvlv_att_def; @@ -262,7 +277,9 @@ return num_parsed; } -/*! \brief take a master (src) tlvdev and fill up all empty slots in 'dst' */ +/*! \brief take a master (src) tlvdev and fill up all empty slots in 'dst' + * \param dst TLV parser definition that is to be patched + * \param[in] src TLV parser definition whose content is patched into \a dst */ void tlv_def_patch(struct tlv_definition *dst, const struct tlv_definition *src) { int i; diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 74f3b48..64b54f3 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -43,6 +43,7 @@ /*! \addtogroup gsmtap * @{ + * \brief GSMTAP utility routines. Encapsulates GSM messages over UDP */ /*! \file gsmtap_util.c */ diff --git a/src/logging.c b/src/logging.c index 0d2b6da..3b3dd05 100644 --- a/src/logging.c +++ b/src/logging.c @@ -22,6 +22,7 @@ /* \addtogroup logging * @{ + * \brief libosmocore Logging sub-system */ /* \file logging.c */ diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index f37f8e7..7358bf6 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -23,7 +23,13 @@ * @{ */ -/*! \file logging_gsmtap.c */ +/*! \file logging_gsmtap.c + * \brief libosmocore log output encapsulated in GSMTAP + * + * Encapsulating the log output inside GSMTAP frames allows us to + * observer protocol traces (of Um, Abis, A or any other interface in + * the Osmocom world) with synchronous interspersed log messages. + */ #include "../config.h" diff --git a/src/logging_syslog.c b/src/logging_syslog.c index 5b0ae5f..6fe3c71 100644 --- a/src/logging_syslog.c +++ b/src/logging_syslog.c @@ -23,7 +23,9 @@ * @{ */ -/*! \file logging_syslog.c */ +/*! \file logging_syslog.c + * \brief libosmocore logging output via syslog + */ #include "../config.h" diff --git a/src/loggingrb.c b/src/loggingrb.c index bd093b7..3fb38ca 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -23,7 +23,9 @@ * @{ */ -/*! \file loggingrb.c */ +/*! \file loggingrb.c + * \brief libosmocore logging backend for a ring-buffer of last log messages + */ #include #include diff --git a/src/macaddr.c b/src/macaddr.c index ceb1e0a..e5db8cf 100644 --- a/src/macaddr.c +++ b/src/macaddr.c @@ -24,7 +24,9 @@ * @{ */ -/*! \file loggingrb.c */ +/*! \file macaddr.c + * \brief MAC address utility routines + */ #include "config.h" diff --git a/src/msgb.c b/src/msgb.c index a27100c..136ad88 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -20,10 +20,35 @@ /*! \addtogroup msgb * @{ + * \brief libosmocore message buffers, inspired by Linux kernel skbuff + * + * Inspired by the 'struct skbuff' of the Linux kernel, we implement a + * 'struct msgb' which we use for handling network + * packets aka messages aka PDUs. + * + * A msgb consists of + * * a header with some metadata, such as + * * a linked list header for message queues or the like + * * pointers to the headers of various protocol layers inside + * the packet + * * a data section consisting of + * * headroom, i.e. space in front of the message, to allow + * for additional headers being pushed in front of the current + * data + * * the curently occupied data for the message + * * tailroom, i.e. space at the end of the message, to + * allow more data to be added after the end of the current + * data + * + * We have plenty of utility functions around the \ref msgb: + * * allocation / release + * * enqueue / dequeue from/to message queues + * * prepending (pushing) and appending (putting) data + * * copying / resizing + * * hex-dumping to a string for debug purposes */ -/*! \file msgb.c - */ +/*! \file msgb.c */ #include #include diff --git a/src/plugin.c b/src/plugin.c index 52887ac..71df88b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -20,6 +20,10 @@ * */ +/*! \addtogroup utils + * @{ + */ + /*! \file plugin.c * \brief Routines for loading and managing shared library plug-ins. */ @@ -69,3 +73,5 @@ return 0; } #endif /* HAVE_DLFCN_H */ + +/*! @} */ diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 3ccd065..47067fb 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -22,6 +22,7 @@ /*! \addtogroup rate_ctr * @{ + * \brief conters about events and their event rates */ /*! \file rate_ctr.c */ diff --git a/src/select.c b/src/select.c index afc8198..bdd53b2 100644 --- a/src/select.c +++ b/src/select.c @@ -36,11 +36,10 @@ /*! \addtogroup select * @{ + * \brief select() loop abstraction */ -/*! \file select.c - * \brief select loop abstraction - */ +/*! \file select.c */ static int maxfd = 0; static LLIST_HEAD(osmo_fds); diff --git a/src/sercomm.c b/src/sercomm.c index 2f693ef..33d4853 100644 --- a/src/sercomm.c +++ b/src/sercomm.c @@ -22,6 +22,7 @@ /*! \addtogroup sercomm * @{ + * \brief Serial communications layer, based on HDLC */ /*! \file sercomm.c diff --git a/src/serial.c b/src/serial.c index 05bdc86..51a32bb 100644 --- a/src/serial.c +++ b/src/serial.c @@ -24,11 +24,10 @@ /*! \addtogroup serial * @{ + * \brief Osmocom serial port helpers */ -/*! \file serial.c - * Osmocom serial port helpers - */ +/*! \file serial.c */ #include #include diff --git a/src/signal.c b/src/signal.c index 8402591..1d11617 100644 --- a/src/signal.c +++ b/src/signal.c @@ -27,7 +27,9 @@ /*! \addtogroup signal * @{ + * \brief Generic signalling/notification infrastructure */ + /*! \file signal.c */ diff --git a/src/socket.c b/src/socket.c index 9d22d61..6fa05a8 100644 --- a/src/socket.c +++ b/src/socket.c @@ -23,12 +23,11 @@ /*! \addtogroup socket * @{ - */ - -/*! \file socket.c * \brief Osmocom socket convenience functions */ +/*! \file socket.c */ + #ifdef HAVE_SYS_SOCKET_H #include diff --git a/src/strrb.c b/src/strrb.c index 069a699..69c4dda 100644 --- a/src/strrb.c +++ b/src/strrb.c @@ -21,6 +21,10 @@ * */ +/*! \addtogroup utils + * @{ + */ + /*! \file strrb.c * \brief Lossy string ringbuffer for logging; keeps newest messages. */ @@ -170,3 +174,5 @@ } return ret; } + +/*! @} */ diff --git a/src/timer.c b/src/timer.c index a8cd42b..72176b8 100644 --- a/src/timer.c +++ b/src/timer.c @@ -26,10 +26,10 @@ /*! \addtogroup timer * @{ + * \brief Osmocom timer abstraction; modelled after linux kernel timers */ -/*! \file timer.c - */ +/*! \file timer.c */ #include #include diff --git a/src/utils.c b/src/utils.c index 1a4aab4..e7c6bcf 100644 --- a/src/utils.c +++ b/src/utils.c @@ -33,6 +33,7 @@ /*! \addtogroup utils * @{ + * \brief various utility routines */ /*! \file utils.c */ diff --git a/src/vty/command.c b/src/vty/command.c index 587bd62..e50706e 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -42,7 +42,8 @@ #include /*! \addtogroup command - * @{ + * @{ + * \brief VTY command handling */ /*! \file command.c */ diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index 422de9d..3824fe8 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -33,6 +33,16 @@ #include #include +/*! \addtogroup fsm + * @{ + * \brief VTY interface for Osmocom FSM + * + * This is code implementing generic VTY access to Osmocom FSMs from + * libosmocore. This means that any application can expose all state + * of all instances of all registered FSM classes by calling a single + * command during startup: \ref osmo_fsm_vty_add_cmds + */ + /* we don't want to add this to a public header file; this is simply * exported by libosmocore and used by libmsomvty but not for public * consumption. */ @@ -175,3 +185,5 @@ 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 7ec212e..8c8a323 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -39,6 +39,16 @@ #define LOG_STR "Configure logging sub-system\n" +/*! \addtogroup logging + * @{ + * \brief 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, ... + */ + extern const struct log_info *osmo_log_info; static void _vty_output(struct log_target *tgt, @@ -778,3 +788,5 @@ #endif install_element(CONFIG_NODE, &cfg_log_gsmtap_cmd); } + +/* @} */ diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index c03546b..af69289 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -41,6 +41,11 @@ #define SHOW_STATS_STR "Show statistical values\n" +/*! \addtogroup stats + * @{ + * \brief VTY interface for statsd / statistic items + */ + /* containing version info */ extern struct host host; @@ -571,6 +576,10 @@ return 1; } +/*! \brief Add stats related commands to the VTY + * Call this once during your application initialization if you would + * like to have stats VTY commands enabled. + */ void osmo_stats_vty_add_cmds() { install_element_ve(&show_stats_cmd); @@ -599,3 +608,5 @@ install_element_ve(&show_stats_asciidoc_table_cmd); } + +/*! @} */ diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index 218f9ab..d53881a 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -38,6 +38,12 @@ /*! \addtogroup telnet_interface * @{ + * \brief Telnet interface towards Osmocom VTY + * + * This module contains the code implementing a telnet server for VTY + * access. This telnet server gets linked into each libosmovty-using + * process in order to enable interactive command-line introspection, + * interaction and configuration. */ /*! \file telnet_interface.c */ diff --git a/src/vty/utils.c b/src/vty/utils.c index 27c1a85..6772593 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -82,6 +82,33 @@ rate_ctr_for_each_counter(ctrg, rate_ctr_handler, &vctx); } +static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *vctx_) +{ + struct vty_out_context *vctx = vctx_; + struct vty *vty = vctx->vty; + + if (ctrg->desc->class_id > vctx->max_level) + return 0; + + if (ctrg->idx) + vty_out(vty, "%s%s (%d):%s", vctx->prefix, + ctrg->desc->group_description, ctrg->idx, VTY_NEWLINE); + else + vty_out(vty, "%s%s:%s", vctx->prefix, + ctrg->desc->group_description, VTY_NEWLINE); + + rate_ctr_for_each_counter(ctrg, rate_ctr_handler, vctx); + + return 0; +} + +/*! @} */ + + +/*! \addtogroup stats + * @{ + */ + static int osmo_stat_item_handler( struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *vctx_) { @@ -135,25 +162,11 @@ return 0; } -static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *vctx_) -{ - struct vty_out_context *vctx = vctx_; - struct vty *vty = vctx->vty; +/*! @} */ - if (ctrg->desc->class_id > vctx->max_level) - return 0; - - if (ctrg->idx) - vty_out(vty, "%s%s (%d):%s", vctx->prefix, - ctrg->desc->group_description, ctrg->idx, VTY_NEWLINE); - else - vty_out(vty, "%s%s:%s", vctx->prefix, - ctrg->desc->group_description, VTY_NEWLINE); - - rate_ctr_for_each_counter(ctrg, rate_ctr_handler, vctx); - - return 0; -} +/*! \addtogroup vty + * @{ + */ static int handle_counter(struct osmo_counter *counter, void *vctx_) { @@ -238,6 +251,5 @@ str[size-1] = '\0'; return str; } - /*! @} */ diff --git a/src/vty/vector.c b/src/vty/vector.c index c5a99af..b95e15c 100644 --- a/src/vty/vector.c +++ b/src/vty/vector.c @@ -27,6 +27,11 @@ #include #include +/*! \addtogroup vector + * @{ + * \brief Generic vector routines, used by VTY internally + */ + void *tall_vty_vec_ctx; /* Initialize vector : allocate memory and return vector. */ @@ -190,3 +195,5 @@ return count; } + +/*! @} */ diff --git a/src/vty/vty.c b/src/vty/vty.c index 01d5ec0..2ec9538 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -14,7 +14,7 @@ * routines in libosmovty are not thread-safe. If you must use them in * a multi-threaded context, you have to add your own locking. * - * libosmocovty is developed as part of the Osmocom (Open Source Mobile + * libosmovty is developed as part of the Osmocom (Open Source Mobile * Communications) project, a community-based, collaborative development * project to create Free and Open Source implementations of mobile * communications systems. For more information about Osmocom, please diff --git a/src/write_queue.c b/src/write_queue.c index c7a4320..1e4cda5 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -27,6 +27,7 @@ /*! \addtogroup write_queue * @{ + * \brief write queue for writing \ref msgb to sockets/fd's */ /*! \file write_queue.c */ -- To view, visit https://gerrit.osmocom.org/2897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 12 20:06:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 20:06:16 +0000 Subject: libosmocore[master]: update/extend doxygen documentation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3 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 Jun 12 20:41:19 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 12 Jun 2017 20:41:19 +0000 Subject: osmo-trx[master]: build: Require and check for gcc C++11 support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96477e4125390b17b43a3705bb1daf98fa01c9bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 12 20:47:33 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 12 Jun 2017 20:47:33 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Use map container for for device parameter access 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/2871 to look at the new patch set (#3). uhd: Use map container for for device parameter access OsmoTRX is written in C++ so we might as well use built-in container types when applicable. Map access allows removal of significant amounts of special device handling code. Aggregate device rates and timing offsets into a single table with access keyed by device/tx-sps/rx-sps tuples. Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 83 insertions(+), 273 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/71/2871/3 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ce6d1be..cea68cc 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -21,6 +21,7 @@ * See the COPYING file in the main directory for details. */ +#include #include "radioDevice.h" #include "Threads.h" #include "Logger.h" @@ -37,12 +38,6 @@ #include #endif -#define B2XX_CLK_RT 26e6 -#define B2XX_MCBTS_CLK_RT 51.2e6 -#define E1XX_CLK_RT 52e6 -#define LIMESDR_CLK_RT (GSMRATE*32) -#define B100_BASE_RT 400000 -#define USRP2_BASE_RT 390625 #define USRP_TX_AMPL 0.3 #define UMTRX_TX_AMPL 0.7 #define LIMESDR_TX_AMPL 0.3 @@ -73,15 +68,6 @@ X3XX, UMTRX, LIMESDR, - NUM_USRP_TYPES, -}; - -struct uhd_dev_offset { - enum uhd_dev_type type; - size_t tx_sps; - size_t rx_sps; - double offset; - const std::string desc; }; /* @@ -109,76 +95,44 @@ * Notes: * USRP1 with timestamps is not supported by UHD. */ -static struct uhd_dev_offset uhd_offsets[] = { - { USRP1, 1, 1, 0.0, "USRP1 not supported" }, - { USRP1, 4, 1, 0.0, "USRP1 not supported"}, - { USRP2, 1, 1, 1.2184e-4, "N2XX 1 SPS" }, - { USRP2, 4, 1, 7.6547e-5, "N2XX 4/1 SPS" }, - { B100, 1, 1, 1.2104e-4, "B100 1 SPS" }, - { B100, 4, 1, 7.9307e-5, "B100 4 SPS" }, - { B200, 1, 1, B2XX_TIMING_1SPS, "B200 1 SPS" }, - { B200, 4, 1, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" }, - { B210, 1, 1, B2XX_TIMING_1SPS, "B210 1 SPS" }, - { B210, 4, 1, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" }, - { B2XX_MCBTS, 4, 4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" }, - { E1XX, 1, 1, 9.5192e-5, "E1XX 1 SPS" }, - { E1XX, 4, 1, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" }, - { E3XX, 1, 1, 1.84616e-4, "E3XX 1 SPS" }, - { E3XX, 4, 1, 1.29231e-4, "E3XX 4/1 Tx/Rx SPS" }, - { X3XX, 1, 1, 1.5360e-4, "X3XX 1 SPS"}, - { X3XX, 4, 1, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS"}, - { UMTRX, 1, 1, 9.9692e-5, "UmTRX 1 SPS" }, - { UMTRX, 4, 1, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS" }, - { USRP2, 4, 4, 4.6080e-5, "N2XX 4 SPS" }, - { B200, 4, 4, B2XX_TIMING_4_4SPS, "B200 4 SPS" }, - { B210, 4, 4, B2XX_TIMING_4_4SPS, "B210 4 SPS" }, - { X3XX, 4, 4, 5.6567e-5, "X3XX 4 SPS"}, - { UMTRX, 4, 4, 5.1503e-5, "UmTRX 4 SPS" }, - { LIMESDR, 4, 4, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" }, + +/* Device Type, Tx-SPS, Rx-SPS */ +typedef std::tuple dev_key; + +/* Device parameter descriptor */ +struct dev_desc { + unsigned channels; + double mcr; + double rate; + double offset; + std::string str; }; -#define NUM_UHD_OFFSETS (sizeof(uhd_offsets)/sizeof(uhd_offsets[0])) -/* - * Select sample rate based on device type and requested samples-per-symbol. - * The base rate is either GSM symbol rate, 270.833 kHz, or the minimum - * usable channel spacing of 400 kHz. - */ -static double select_rate(uhd_dev_type type, int sps, - RadioDevice::InterfaceType iface) -{ - if ((sps != 4) && (sps != 1)) - return -9999.99; - - if (iface == RadioDevice::MULTI_ARFCN) { - switch (type) { - case B2XX_MCBTS: - return 4 * MCBTS_SPACING; - default: - LOG(ALERT) << "Invalid device combination"; - return -9999.99; - } - } - - switch (type) { - case USRP2: - case X3XX: - return USRP2_BASE_RT * sps; - case B100: - return B100_BASE_RT * sps; - case B200: - case B210: - case E1XX: - case E3XX: - case UMTRX: - case LIMESDR: - return GSMRATE * sps; - default: - break; - } - - LOG(ALERT) << "Unknown device type " << type; - return -9999.99; -} +static const std::map dev_param_map { + { std::make_tuple(USRP2, 1, 1), { 1, 0.0, 390625, 1.2184e-4, "N2XX 1 SPS" } }, + { std::make_tuple(USRP2, 4, 1), { 1, 0.0, 390625, 7.6547e-5, "N2XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(USRP2, 4, 4), { 1, 0.0, 390625, 4.6080e-5, "N2XX 4 SPS" } }, + { std::make_tuple(B100, 1, 1), { 1, 0.0, 400000, 1.2104e-4, "B100 1 SPS" } }, + { std::make_tuple(B100, 4, 1), { 1, 0.0, 400000, 7.9307e-5, "B100 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B200, 1, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B200 1 SPS" } }, + { std::make_tuple(B200, 4, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B200, 4, 4), { 1, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B200 4 SPS" } }, + { std::make_tuple(B210, 1, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B210 1 SPS" } }, + { std::make_tuple(B210, 4, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B210, 4, 4), { 2, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B210 4 SPS" } }, + { std::make_tuple(E1XX, 1, 1), { 1, 52e6, GSMRATE, 9.5192e-5, "E1XX 1 SPS" } }, + { std::make_tuple(E1XX, 4, 1), { 1, 52e6, GSMRATE, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(E3XX, 1, 1), { 2, 26e6, GSMRATE, 1.8462e-4, "E3XX 1 SPS" } }, + { std::make_tuple(E3XX, 4, 1), { 2, 26e6, GSMRATE, 1.2923e-4, "E3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 1, 1), { 2, 0.0, 390625, 1.5360e-4, "X3XX 1 SPS" } }, + { std::make_tuple(X3XX, 4, 1), { 2, 0.0, 390625, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 4, 4), { 2, 0.0, 390625, 5.6567e-5, "X3XX 4 SPS" } }, + { std::make_tuple(UMTRX, 1, 1), { 2, 0.0, GSMRATE, 9.9692e-5, "UmTRX 1 SPS" } }, + { std::make_tuple(UMTRX, 4, 1), { 2, 0.0, GSMRATE, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS"} }, + { std::make_tuple(UMTRX, 4, 4), { 2, 0.0, GSMRATE, 5.1503e-5, "UmTRX 4 SPS" } }, + { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" } }, + { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, +}; /* Sample Buffer - Allows reading and writing of timed samples using osmo-trx @@ -339,9 +293,7 @@ std::vector rx_buffers; void init_gains(); - double get_dev_offset(); - int set_master_clk(double rate); - int set_rates(double tx_rate, double rx_rate); + void set_rates(); bool parse_dev_type(); bool flush_recv(size_t num_pkts); int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls); @@ -470,105 +422,22 @@ } -double uhd_device::get_dev_offset() +void uhd_device::set_rates() { - struct uhd_dev_offset *offset = NULL; + dev_desc desc = dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)); + if (desc.mcr != 0.0) + usrp_dev->set_master_clock_rate(desc.mcr); - /* Reject USRP1 */ - if (dev_type == USRP1) { - LOG(ERR) << "Invalid device type"; - return 0.0; - } + tx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * tx_sps : desc.rate; + rx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * rx_sps : desc.rate; - /* Search for matching offset value */ - for (size_t i = 0; i < NUM_UHD_OFFSETS; i++) { - if ((dev_type == uhd_offsets[i].type) && - (tx_sps == uhd_offsets[i].tx_sps) && - (rx_sps == uhd_offsets[i].rx_sps)) { - offset = &uhd_offsets[i]; - break; - } - } + usrp_dev->set_tx_rate(tx_rate); + usrp_dev->set_rx_rate(rx_rate); + tx_rate = usrp_dev->get_tx_rate(); + rx_rate = usrp_dev->get_rx_rate(); - if (!offset) { - LOG(ERR) << "Invalid device configuration"; - return 0.0; - } - - std::cout << "-- Setting " << offset->desc << std::endl; - - return offset->offset; -} - -int uhd_device::set_master_clk(double clk_rate) -{ - double actual, offset, limit = 1.0; - - try { - usrp_dev->set_master_clock_rate(clk_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD clock rate setting failed: " << clk_rate; - LOG(ALERT) << ex.what(); - return -1; - } - - actual = usrp_dev->get_master_clock_rate(); - offset = fabs(clk_rate - actual); - - if (offset > limit) { - LOG(ALERT) << "Failed to set master clock rate"; - LOG(ALERT) << "Requested clock rate " << clk_rate; - LOG(ALERT) << "Actual clock rate " << actual; - return -1; - } - - return 0; -} - -int uhd_device::set_rates(double tx_rate, double rx_rate) -{ - double offset_limit = 1.0; - double tx_offset, rx_offset; - - /* B2XX and E1xx are the only device where we set FPGA clocking */ - if ((dev_type == B200) || (dev_type == B210) || (dev_type == E3XX)) { - if (set_master_clk(B2XX_CLK_RT) < 0) - return -1; - } else if (dev_type == E1XX) { - if (set_master_clk(E1XX_CLK_RT) < 0) - return -1; - } else if (dev_type == B2XX_MCBTS) { - if (set_master_clk(B2XX_MCBTS_CLK_RT) < 0) - return -1; - } - else if (dev_type == LIMESDR) { - if (set_master_clk(LIMESDR_CLK_RT) < 0) - return -1; - } - - - // Set sample rates - try { - usrp_dev->set_tx_rate(tx_rate); - usrp_dev->set_rx_rate(rx_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD rate setting failed"; - LOG(ALERT) << ex.what(); - return -1; - } - this->tx_rate = usrp_dev->get_tx_rate(); - this->rx_rate = usrp_dev->get_rx_rate(); - - tx_offset = fabs(this->tx_rate - tx_rate); - rx_offset = fabs(this->rx_rate - rx_rate); - if ((tx_offset > offset_limit) || (rx_offset > offset_limit)) { - LOG(ALERT) << "Actual sample rate differs from desired rate"; - LOG(ALERT) << "Tx/Rx (" << this->tx_rate << "/" - << this->rx_rate << ")"; - return -1; - } - - return 0; + ts_offset = (TIMESTAMP) desc.offset * rx_rate; + LOG(INFO) << "Rates configured for " << desc.str; } double uhd_device::setTxGain(double db, size_t chan) @@ -641,85 +510,39 @@ */ bool uhd_device::parse_dev_type() { - std::string mboard_str, dev_str; - uhd::property_tree::sptr prop_tree; - size_t usrp1_str, usrp2_str, e100_str, e110_str, e310_str, e3xx_str, - b100_str, b200_str, b210_str, x300_str, x310_str, umtrx_str, limesdr_str; + uhd::property_tree::sptr prop_tree = usrp_dev->get_device()->get_tree(); + std::string devString = prop_tree->access("/name").get(); + std::string mboardString = usrp_dev->get_mboard_name(); - prop_tree = usrp_dev->get_device()->get_tree(); - dev_str = prop_tree->access("/name").get(); - mboard_str = usrp_dev->get_mboard_name(); + const std::map> devStringMap { + { "B100", { B100, TX_WINDOW_USRP1 } }, + { "B200", { B200, TX_WINDOW_USRP1 } }, + { "B200mini", { B200, TX_WINDOW_USRP1 } }, + { "B210", { B210, TX_WINDOW_USRP1 } }, + { "E100", { E1XX, TX_WINDOW_FIXED } }, + { "E110", { E1XX, TX_WINDOW_FIXED } }, + { "E310", { E3XX, TX_WINDOW_FIXED } }, + { "E3XX", { E3XX, TX_WINDOW_FIXED } }, + { "X300", { X3XX, TX_WINDOW_FIXED } }, + { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, + { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, + }; - usrp1_str = dev_str.find("USRP1"); - usrp2_str = dev_str.find("USRP2"); - b100_str = mboard_str.find("B100"); - b200_str = mboard_str.find("B200"); - b210_str = mboard_str.find("B210"); - e100_str = mboard_str.find("E100"); - e110_str = mboard_str.find("E110"); - e310_str = mboard_str.find("E310"); - e3xx_str = mboard_str.find("E3XX"); - x300_str = mboard_str.find("X300"); - x310_str = mboard_str.find("X310"); - umtrx_str = dev_str.find("UmTRX"); - // LimeSDR is based on STREAM board, so it's advertized as such - limesdr_str = dev_str.find("STREAM"); + // Compare UHD motherboard and device strings */ + std::string found; + if (devStringMap.find(devString) != devStringMap.end()) + found = devString; + else if (devStringMap.find(mboardString) != devStringMap.end()) + found = mboardString; - if (usrp1_str != std::string::npos) { - LOG(ALERT) << "USRP1 is not supported using the UHD driver"; - LOG(ALERT) << "Please compile with GNU Radio libusrp support"; - dev_type = USRP1; + if (found.empty()) { + LOG(ALERT) << "Unsupported device " << devString; return false; } - if (b100_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B100; - } else if (b200_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B200; - } else if (b210_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B210; - } else if (e100_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (e110_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (usrp2_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = USRP2; - } else if ((e310_str != std::string::npos) || - (e3xx_str != std::string::npos)) { - tx_window = TX_WINDOW_FIXED; - dev_type = E3XX; - } else if (x300_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (x310_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (umtrx_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = UMTRX; - } else if (limesdr_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = LIMESDR; - } else { - LOG(ALERT) << "Unknown UHD device type " - << dev_str << " " << mboard_str; - return false; - } - - if (tx_window == TX_WINDOW_USRP1) { - LOG(INFO) << "Using USRP1 type transmit window for " - << dev_str << " " << mboard_str; - } else { - LOG(INFO) << "Using fixed transmit window for " - << dev_str << " " << mboard_str; - } - + dev_type = devStringMap.at(found).first; + tx_window = devStringMap.at(found).second; return true; } @@ -820,14 +643,12 @@ usrp_dev->set_clock_source(refstr); - // Set rates - double _rx_rate = select_rate(dev_type, rx_sps, iface); - double _tx_rate = select_rate(dev_type, tx_sps, iface); - - if ((_tx_rate < 0.0) || (_rx_rate < 0.0)) + try { + set_rates(); + } catch (const std::exception &e) { + LOG(ALERT) << "UHD rate setting failed - " << e.what(); return -1; - if (set_rates(_tx_rate, _rx_rate) < 0) - return -1; + } // Set RF frontend bandwidth if (dev_type == UMTRX) { @@ -859,17 +680,6 @@ size_t buf_len = SAMPLE_BUF_SZ / sizeof(uint32_t); for (size_t i = 0; i < rx_buffers.size(); i++) rx_buffers[i] = new smpl_buf(buf_len, rx_rate); - - // Set receive chain sample offset. Trigger the EDGE offset - // table by checking for 4 SPS on the receive path. No other - // configuration supports using 4 SPS. - double offset = get_dev_offset(); - if (offset == 0.0) { - LOG(ERR) << "Unsupported configuration, no correction applied"; - ts_offset = 0; - } else { - ts_offset = (TIMESTAMP) (offset * rx_rate); - } // Initialize and shadow gain values init_gains(); @@ -1236,7 +1046,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > B2XX_CLK_RT) { + if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 12 21:08:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 21:08:04 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (4 comments) adding stow seems to be really simple. I'm generally in favor, because this finds errors in our installation targets. Let's resolve the questions though (marking -1 for that). Generally it could be helpful to put explanations as a comment in the build script instead of / in addition to the commit log, so future readers of the code can benefit. https://gerrit.osmocom.org/#/c/2691/2//COMMIT_MSG Commit Message: Line 12: has the advantage of letting the build fail if not all location listings I find this really hard to read. "Installing dependent libraries in..."? Rather write more and shorter sentences? Line 18: building when dependencies are installed in distinct directories what so forth? AFAIK those two are all that is needed? Does it also manage CFLAGS=$include_dir somehow? https://gerrit.osmocom.org/#/c/2691/2/scripts/osmo-build-dep.sh File scripts/osmo-build-dep.sh: Line 51: mkdir -p "$inst/stow" $inst is already an empty folder intended as prefix target. Do you really need another subfolder? Line 56: STOW_DIR="$inst/stow" stow --restow $project I'm curious what this does. Could it get a single line comment? -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 21:38:56 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 12 Jun 2017 21:38:56 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Remove unused functions from public interface Message-ID: Review at https://gerrit.osmocom.org/2898 sigProcLib: Remove unused functions from public interface Also remove entirely completely unused calls. Most of these calls have been around since OpenBTS conception. Nearly a decade is long enough time for deprecation. Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0 --- M Transceiver52M/sigProcLib.cpp M Transceiver52M/sigProcLib.h 2 files changed, 52 insertions(+), 467 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/98/2898/1 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 9a8c824..3a9a529 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -46,9 +46,9 @@ #define CLIP_THRESH 30000.0f /** Lookup tables for trigonometric approximation */ -float cosTable[TABLESIZE+1]; // add 1 element for wrap around -float sinTable[TABLESIZE+1]; -float sincTable[TABLESIZE+1]; +static float cosTable[TABLESIZE+1]; // add 1 element for wrap around +static float sinTable[TABLESIZE+1]; +static float sincTable[TABLESIZE+1]; /** Constants */ static const float M_PI_F = (float)M_PI; @@ -64,7 +64,7 @@ /* Precomputed fractional delay filters */ static signalVector *delayFilters[DELAYFILTS]; -static Complex psk8_table[8] = { +static const Complex psk8_table[8] = { Complex(-0.70710678, 0.70710678), Complex( 0.0, -1.0), Complex( 0.0, 1.0), @@ -172,67 +172,7 @@ GSMPulse4 = NULL; } -// dB relative to 1.0. -// if > 1.0, then return 0 dB -float dB(float x) { - - float arg = 1.0F; - float dB = 0.0F; - - if (x >= 1.0F) return 0.0F; - if (x <= 0.0F) return -200.0F; - - float prevArg = arg; - float prevdB = dB; - float stepSize = 16.0F; - float dBstepSize = 12.0F; - while (stepSize > 1.0F) { - do { - prevArg = arg; - prevdB = dB; - arg /= stepSize; - dB -= dBstepSize; - } while (arg > x); - arg = prevArg; - dB = prevdB; - stepSize *= 0.5F; - dBstepSize -= 3.0F; - } - return ((arg-x)*(dB-3.0F) + (x-arg*0.5F)*dB)/(arg - arg*0.5F); - -} - -// 10^(-dB/10), inverse of dB func. -float dBinv(float x) { - - float arg = 1.0F; - float dB = 0.0F; - - if (x >= 0.0F) return 1.0F; - if (x <= -200.0F) return 0.0F; - - float prevArg = arg; - float prevdB = dB; - float stepSize = 16.0F; - float dBstepSize = 12.0F; - while (stepSize > 1.0F) { - do { - prevArg = arg; - prevdB = dB; - arg /= stepSize; - dB -= dBstepSize; - } while (dB > x); - arg = prevArg; - dB = prevdB; - stepSize *= 0.5F; - dBstepSize -= 3.0F; - } - - return ((dB-x)*(arg*0.5F)+(x-(dB-3.0F))*(arg))/3.0F; - -} - -float vectorNorm2(const signalVector &x) +static float vectorNorm2(const signalVector &x) { signalVector::const_iterator xPtr = x.begin(); float Energy = 0.0; @@ -241,41 +181,6 @@ } return Energy; } - - -float vectorPower(const signalVector &x) -{ - return vectorNorm2(x)/x.size(); -} - -/** compute cosine via lookup table */ -float cosLookup(const float x) -{ - float arg = x*M_1_2PI_F; - while (arg > 1.0F) arg -= 1.0F; - while (arg < 0.0F) arg += 1.0F; - - const float argT = arg*((float)TABLESIZE); - const int argI = (int)argT; - const float delta = argT-argI; - const float iDelta = 1.0F-delta; - return iDelta*cosTable[argI] + delta*cosTable[argI+1]; -} - -/** compute sine via lookup table */ -float sinLookup(const float x) -{ - float arg = x*M_1_2PI_F; - while (arg > 1.0F) arg -= 1.0F; - while (arg < 0.0F) arg += 1.0F; - - const float argT = arg*((float)TABLESIZE); - const int argI = (int)argT; - const float delta = argT-argI; - const float iDelta = 1.0F-delta; - return iDelta*sinTable[argI] + delta*sinTable[argI+1]; -} - /** compute e^(-jx) via lookup table. */ static complex expjLookup(float x) @@ -401,11 +306,18 @@ return true; } -signalVector *convolve(const signalVector *x, - const signalVector *h, - signalVector *y, - ConvType spanType, size_t start, - size_t len, size_t step, int offset) +/** Convolution type indicator */ +enum ConvType { + START_ONLY, + NO_DELAY, + CUSTOM, + UNDEFINED, +}; + +static signalVector *convolve(const signalVector *x, const signalVector *h, + signalVector *y, ConvType spanType, + size_t start = 0, size_t len = 0, + size_t step = 1, int offset = 0) { int rc; size_t head = 0, tail = 0; @@ -652,29 +564,6 @@ generateInvertC0Pulse(pulse); return pulse; -} - -signalVector* reverseConjugate(signalVector *b) -{ - signalVector *tmp = new signalVector(b->size()); - tmp->isReal(b->isReal()); - signalVector::iterator bP = b->begin(); - signalVector::iterator bPEnd = b->end(); - signalVector::iterator tmpP = tmp->end()-1; - if (!b->isReal()) { - while (bP < bPEnd) { - *tmpP-- = bP->conj(); - bP++; - } - } - else { - while (bP < bPEnd) { - *tmpP-- = bP->real(); - bP++; - } - } - - return tmp; } bool vectorSlicer(SoftVector *x) @@ -1158,7 +1047,7 @@ } } -float sinc(float x) +static float sinc(float x) { if (fabs(x) >= 8 * M_PI) return 0.0; @@ -1173,7 +1062,7 @@ * sinc function generator. The number of filters generated is specified * by the DELAYFILTS value. */ -void generateDelayFilters() +static void generateDelayFilters() { int h_len = 20; complex *data; @@ -1268,31 +1157,8 @@ return out; } -signalVector *gaussianNoise(int length, - float variance, - complex mean) +static complex interpolatePoint(const signalVector &inSig, float ix) { - - signalVector *noise = new signalVector(length); - signalVector::iterator nPtr = noise->begin(); - float stddev = sqrtf(variance); - while (nPtr < noise->end()) { - float u1 = (float) rand()/ (float) RAND_MAX; - while (u1==0.0) - u1 = (float) rand()/ (float) RAND_MAX; - float u2 = (float) rand()/ (float) RAND_MAX; - float arg = 2.0*M_PI*u2; - *nPtr = mean + stddev*complex(cos(arg),sin(arg))*sqrtf(-2.0*log(u1)); - nPtr++; - } - - return noise; -} - -complex interpolatePoint(const signalVector &inSig, - float ix) -{ - int start = (int) (floor(ix) - 10); if (start < 0) start = 0; int end = (int) (floor(ix) + 11); @@ -1332,12 +1198,9 @@ return amp; } -complex peakDetect(const signalVector &rxBurst, - float *peakIndex, - float *avgPwr) +static complex peakDetect(const signalVector &rxBurst, + float *peakIndex, float *avgPwr) { - - complex maxVal = 0.0; float maxIndex = -1; float sumPower = 0.0; @@ -1410,7 +1273,7 @@ } /** in-place conjugation */ -void conjugateVector(signalVector &x) +static void conjugateVector(signalVector &x) { if (x.isReal()) return; signalVector::iterator xP = x.begin(); @@ -1419,37 +1282,6 @@ *xP = xP->conj(); xP++; } -} - - -// in-place addition!! -bool addVector(signalVector &x, - signalVector &y) -{ - signalVector::iterator xP = x.begin(); - signalVector::iterator yP = y.begin(); - signalVector::iterator xPEnd = x.end(); - signalVector::iterator yPEnd = y.end(); - while ((xP < xPEnd) && (yP < yPEnd)) { - *xP = *xP + *yP; - xP++; yP++; - } - return true; -} - -// in-place multiplication!! -bool multVector(signalVector &x, - signalVector &y) -{ - signalVector::iterator xP = x.begin(); - signalVector::iterator yP = y.begin(); - signalVector::iterator xPEnd = x.end(); - signalVector::iterator yPEnd = y.end(); - while ((xP < xPEnd) && (yP < yPEnd)) { - *xP = (*xP) * (*yP); - xP++; yP++; - } - return true; } static bool generateMidamble(int sps, int tsc) @@ -1528,7 +1360,7 @@ return status; } -CorrelationSequence *generateEdgeMidamble(int tsc) +static CorrelationSequence *generateEdgeMidamble(int tsc) { complex *data = NULL; signalVector *midamble = NULL, *_midamble = NULL; @@ -1682,6 +1514,24 @@ return energy/windowLength; } +static signalVector *downsampleBurst(const signalVector &burst) +{ + signalVector *in, *out; + + in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); + out = new signalVector(DOWNSAMPLE_OUT_LEN); + memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); + + if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, + (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { + delete out; + out = NULL; + } + + delete in; + return out; +}; + /* * Detect a burst based on correlation and peak-to-average ratio * @@ -1816,12 +1666,8 @@ * head: Search 8 symbols before target * tail: Search 8 symbols + maximum expected delay */ -int detectRACHBurst(const signalVector &burst, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa) +static int detectRACHBurst(const signalVector &burst, float threshold, int sps, + complex &litude, float &toa, unsigned max_toa) { int rc, target, head, tail; CorrelationSequence *sync; @@ -1845,8 +1691,8 @@ * head: Search 6 symbols before target * tail: Search 6 symbols + maximum expected delay */ -int analyzeTrafficBurst(const signalVector &burst, unsigned tsc, float threshold, - int sps, complex &litude, float &toa, unsigned max_toa) +static int analyzeTrafficBurst(const signalVector &burst, unsigned tsc, float threshold, + int sps, complex &litude, float &toa, unsigned max_toa) { int rc, target, head, tail; CorrelationSequence *sync; @@ -1864,8 +1710,8 @@ return rc; } -int detectEdgeBurst(const signalVector &burst, unsigned tsc, float threshold, - int sps, complex &litude, float &toa, unsigned max_toa) +static int detectEdgeBurst(const signalVector &burst, unsigned tsc, float threshold, + int sps, complex &litude, float &toa, unsigned max_toa) { int rc, target, head, tail; CorrelationSequence *sync; @@ -1913,41 +1759,6 @@ return type; return rc; -} - -signalVector *downsampleBurst(const signalVector &burst) -{ - signalVector *in, *out; - - in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); - out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - - if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, - (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { - delete out; - out = NULL; - } - - delete in; - return out; -}; - -signalVector *decimateVector(signalVector &wVector, size_t factor) -{ - signalVector *dec; - - if (factor <= 1) - return NULL; - - dec = new signalVector(wVector.size() / factor); - dec->isReal(wVector.isReal()); - - signalVector::iterator itr = dec->begin(); - for (size_t i = 0; i < wVector.size(); i += factor) - *itr++ = wVector[i]; - - return dec; } /* @@ -2046,8 +1857,8 @@ * 4 SPS (if activated) to minimize distortion through the fractional * delay filters. Symbol rotation and after always operates at 1 SPS. */ -SoftVector *demodGmskBurst(const signalVector &rxBurst, int sps, - complex channel, float TOA) +static SoftVector *demodGmskBurst(const signalVector &rxBurst, + int sps, complex channel, float TOA) { SoftVector *bits; signalVector *dec; @@ -2075,8 +1886,8 @@ * through the fractional delay filters at 1 SPS renders signal * nearly unrecoverable. */ -SoftVector *demodEdgeBurst(const signalVector &burst, int sps, - complex chan, float toa) +static SoftVector *demodEdgeBurst(const signalVector &burst, + int sps, complex chan, float toa) { SoftVector *bits; signalVector *dec, *rot, *eq; @@ -2136,27 +1947,4 @@ fail: sigProcLibDestroy(); return false; -} - -std::string corrTypeToString(CorrType corr) { - switch (corr) { - case OFF: - return "OFF"; - case TSC: - return "TSC"; - case RACH: - return "RACH"; - case EDGE: - return "EDGE"; - case IDLE: - return "IDLE"; - default: - return "unknown"; - } -} - -std::ostream& operator<<(std::ostream& os, CorrType corr) -{ - os << corrTypeToString(corr); - return os; } diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h index 4318fe0..9bc7e10 100644 --- a/Transceiver52M/sigProcLib.h +++ b/Transceiver52M/sigProcLib.h @@ -25,14 +25,6 @@ #define EDGE_BURST_NBITS 444 #define EDGE_BURST_NSYMS (EDGE_BURST_NBITS / 3) -/** Convolution type indicator */ -enum ConvType { - START_ONLY, - NO_DELAY, - CUSTOM, - UNDEFINED, -}; - /** Codes for burst types of received bursts*/ enum CorrType{ OFF, ///< timeslot is off @@ -41,8 +33,6 @@ EDGE, ///< timeslot should contain an EDGE burst IDLE ///< timeslot is an idle (or dummy) burst }; -std::string corrTypeToString(CorrType corr); -std::ostream& operator<<(std::ostream& os, CorrType corr); enum SignalError { SIGERR_NONE, @@ -61,65 +51,11 @@ */ #define BURST_THRESH 4.0 -/** Convert a linear number to a dB value */ -float dB(float x); - -/** Convert a dB value into a linear value */ -float dBinv(float x); - -/** Compute the energy of a vector */ -float vectorNorm2(const signalVector &x); - -/** Compute the average power of a vector */ -float vectorPower(const signalVector &x); - /** Setup the signal processing library */ bool sigProcLibSetup(); /** Destroy the signal processing library */ void sigProcLibDestroy(void); - -/** - Convolve two vectors. - @param a,b The vectors to be convolved. - @param c, A preallocated vector to hold the convolution result. - @param spanType The type/span of the convolution. - @return The convolution result or NULL on error. -*/ -signalVector *convolve(const signalVector *a, const signalVector *b, - signalVector *c, ConvType spanType, - size_t start = 0, size_t len = 0, - size_t step = 1, int offset = 0); - -/** - Frequency shift a vector. - @param y The frequency shifted vector. - @param x The vector to-be-shifted. - @param freq The digital frequency shift - @param startPhase The starting phase of the oscillator - @param finalPhase The final phase of the oscillator - @return The frequency shifted vector. -*/ -signalVector* frequencyShift(signalVector *y, - signalVector *x, - float freq = 0.0, - float startPhase = 0.0, - float *finalPhase=NULL); - -/** - Correlate two vectors. - @param a,b The vectors to be correlated. - @param c, A preallocated vector to hold the correlation result. - @param spanType The type/span of the correlation. - @return The correlation result. -*/ -signalVector* correlate(signalVector *a, - signalVector *b, - signalVector *c, - ConvType spanType, - bool bReversedConjugated = false, - unsigned startIx = 0, - unsigned len = 0); /** Operate soft slicer on a soft-bit vector */ bool vectorSlicer(SoftVector *x); @@ -148,45 +84,6 @@ /** Generate a dummy GSM burst - 4 or 1 SPS */ signalVector *generateDummyBurst(int sps, int tn); -/** Sinc function */ -float sinc(float x); - -/** Delay a vector */ -signalVector *delayVector(const signalVector *in, signalVector *out, float delay); - -/** Add two vectors in-place */ -bool addVector(signalVector &x, - signalVector &y); - -/** Multiply two vectors in-place*/ -bool multVector(signalVector &x, - signalVector &y); - -/** Generate a vector of gaussian noise */ -signalVector *gaussianNoise(int length, - float variance = 1.0, - complex mean = complex(0.0)); - -/** - Given a non-integer index, interpolate a sample. - @param inSig The signal from which to interpolate. - @param ix The index. - @return The interpolated signal value. -*/ -complex interpolatePoint(const signalVector &inSig, - float ix); - -/** - Given a correlator output, locate the correlation peak. - @param rxBurst The correlator result. - @param peakIndex Pointer to value to receive interpolated peak index. - @param avgPower Power to value to receive mean power. - @return Peak value. -*/ -complex peakDetect(const signalVector &rxBurst, - float *peakIndex, - float *avgPwr); - /** Apply a scalar to a vector. @param x The vector of interest. @@ -203,68 +100,6 @@ */ float energyDetect(const signalVector &rxBurst, unsigned windowLength); - -/** - RACH aka Access Burst correlator/detector. - @param burst The received GSM burst of interest. - @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity. - @param sps The number of samples per GSM symbol. - @param amplitude The estimated amplitude of received RACH burst. - @param toa The estimate time-of-arrival of received RACH burst. - @param max_toa The maximum expected time-of-arrival - @return 1 if threshold value is reached, - negative value (-SignalError) on error, - zero (SIGERR_NONE) if no burst is detected -*/ -int detectRACHBurst(const signalVector &burst, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa); - -/** - GMSK Normal Burst correlator/detector. - @param rxBurst The received GSM burst of interest. - @param tsc Midamble type (0..7) also known as TSC - @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity. - @param sps The number of samples per GSM symbol. - @param amplitude The estimated amplitude of received TSC burst. - @param toa The estimate time-of-arrival of received TSC burst. - @param max_toa The maximum expected time-of-arrival - @return 1 if threshold value is reached, - negative value (-SignalError) on error, - zero (SIGERR_NONE) if no burst is detected -*/ -int analyzeTrafficBurst(const signalVector &burst, - unsigned tsc, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa); - -/** - EDGE/8-PSK Normal Burst correlator/detector - @param burst The received GSM burst of interest - @param tsc Midamble type (0..7) also known as TSC - @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity. - @param sps The number of samples per GSM symbol. - @param amplitude The estimated amplitude of received TSC burst. - @param toa The estimate time-of-arrival of received TSC burst. - @param max_toa The maximum expected time-of-arrival - @return 1 if threshold value is reached, - negative value (-SignalError) on error, - zero (SIGERR_NONE) if no burst is detected -*/ -int detectEdgeBurst(const signalVector &burst, - unsigned tsc, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa); - /** 8-PSK/GMSK/RACH burst detector @param burst The received GSM burst of interest @@ -286,44 +121,6 @@ complex &, float &toa, unsigned max_toa); - -/** - Downsample 4 SPS to 1 SPS using a polyphase filterbank - @param burst Input burst of at least 624 symbols - @return Decimated signal vector of 156 symbols -*/ -signalVector *downsampleBurst(const signalVector &burst); - -/** - Decimate a vector. - @param wVector The vector of interest. - @param factor Decimation factor. - @return The decimated signal vector. -*/ -signalVector *decimateVector(signalVector &wVector, size_t factor); - -/** - Demodulates a GMSK burst using a soft-slicer. - @param rxBurst The burst to be demodulated. - @param gsmPulse The GSM pulse. - @param sps The number of samples per GSM symbol. - @param channel The amplitude estimate of the received burst. - @param TOA The time-of-arrival of the received burst. - @return The demodulated bit sequence. -*/ -SoftVector *demodGmskBurst(const signalVector &rxBurst, int sps, - complex channel, float TOA); - -/** - Demodulate 8-PSK EDGE burst with soft symbol ooutput - @param rxBurst The burst to be demodulated. - @param sps The number of samples per GSM symbol. - @param channel The amplitude estimate of the received burst. - @param TOA The time-of-arrival of the received burst. - @return The demodulated bit sequence. -*/ -SoftVector *demodEdgeBurst(const signalVector &rxBurst, int sps, - complex channel, float TOA); /** Demodulate burst basde on type and output soft bits */ SoftVector *demodAnyBurst(const signalVector &burst, int sps, -- To view, visit https://gerrit.osmocom.org/2898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 12 21:55:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 21:55:27 +0000 Subject: libosmocore[master]: Update doxygen main page for libosmo{core, gsm, vty} In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b 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 Mon Jun 12 21:55:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 21:55:47 +0000 Subject: [MERGED] libosmocore[master]: Update doxygen main page for libosmo{core, gsm, vty} In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update doxygen main page for libosmo{core,gsm,vty} ...................................................................... Update doxygen main page for libosmo{core,gsm,vty} We should link to project homepage as well as put the library into the wider Osmocom context. Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b --- M src/application.c M src/gsm/gsm_utils.c M src/vty/vty.c 3 files changed, 36 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 6a18d0e..8f37c93 100644 --- a/src/application.c +++ b/src/application.c @@ -34,6 +34,12 @@ * generic plugin interface, statistics counters, memory allocator, * socket abstraction, message buffers, etc. * \n\n + * libosmocodec is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * * Please note that C language projects inside Osmocom are typically * single-threaded event-loop state machine designs. As such, * routines in libosmocore are not thread-safe. If you must use them in @@ -53,6 +59,13 @@ * FITNESS FOR A PARTICULAR PURPOSE. * \n\n * + * \section sec_tracker Homepage + Issue Tracker + * The libosmocore project home page can be found at + * https://osmocom.org/projects/libosmocore + * + * An Issue Tracker can be found at + * https://osmocom.org/projects/libosmocore/issues + * * \section sec_contact Contact and Support * Community-based support is available at the OpenBSC mailing list * \n diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 7365ab7..d16adf7 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -41,6 +41,12 @@ * routines in libosmogsm are not thread-safe. If you must use them in * a multi-threaded context, you have to add your own locking. * + * libosmogsm is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * * \section sec_copyright Copyright and License * Copyright ? 2008-2011 - Harald Welte, Holger Freyther and contributors\n * All rights reserved. \n\n @@ -55,6 +61,13 @@ * FITNESS FOR A PARTICULAR PURPOSE. * \n\n * + * \section sec_tracker Homepage + Issue Tracker + * libosmogsm is distributed as part of libosmocore and shares its + * project page at http://osmocom.org/projects/libosmocore + * + * An Issue Tracker can be found at + * https://osmocom.org/projects/libosmocore/issues + * * \section sec_contact Contact and Support * Community-based support is available at the OpenBSC mailing list * \n diff --git a/src/vty/vty.c b/src/vty/vty.c index 88ed937..01d5ec0 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -14,6 +14,12 @@ * routines in libosmovty are not thread-safe. If you must use them in * a multi-threaded context, you have to add your own locking. * + * libosmocovty is developed as part of the Osmocom (Open Source Mobile + * Communications) project, a community-based, collaborative development + * project to create Free and Open Source implementations of mobile + * communications systems. For more information about Osmocom, please + * see https://osmocom.org/ + * * \section sec_copyright Copyright and License * Copyright ? 1997-2007 - Kuninhiro Ishiguro\n * Copyright ? 2008-2011 - Harald Welte, Holger Freyther and contributors\n @@ -29,6 +35,10 @@ * FITNESS FOR A PARTICULAR PURPOSE. * \n\n * + * \section sec_tracker Homepage + Issue Tracker + * libosmovty is distributed as part of libosmocore and shares its + * project page at http://osmocom.org/projects/libosmocore + * * \section sec_contact Contact and Support * Community-based support is available at the OpenBSC mailing list * \n -- To view, visit https://gerrit.osmocom.org/2896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b 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 Mon Jun 12 21:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 21:56:01 +0000 Subject: [MERGED] libosmocore[master]: update/extend doxygen documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update/extend doxygen documentation ...................................................................... update/extend doxygen documentation It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3 --- M include/osmocom/core/msgb.h M src/bits.c M src/bitvec.c M src/conv.c M src/crcXXgen.c.tpl M src/fsm.c M src/gb/gprs_ns.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_core.c M src/gsm/auth_milenage.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_gea.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/plugin.c M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/socket.c M src/strrb.c M src/timer.c M src/utils.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c 63 files changed, 827 insertions(+), 157 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index afb887c..f5dd323 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -29,13 +29,7 @@ * @{ */ -/*! \file msgb.h - * \brief Osmocom message buffers - * The Osmocom message buffers are modelled after the 'struct skb' - * inside the Linux kernel network stack. As they exist in userspace, - * they are much simplified. However, terminology such as headroom, - * tailroom, push/pull/put etc. remains the same. - */ +/*! \file msgb.h */ #define MSGB_DEBUG diff --git a/src/bits.c b/src/bits.c index 0c77b27..fe92f93 100644 --- a/src/bits.c +++ b/src/bits.c @@ -26,12 +26,11 @@ /*! \addtogroup bits * @{ - */ - -/*! \file bits.c * \brief Osmocom bit level support code */ +/*! \file bits.c */ + /*! \brief convert unpacked bits to packed bits, return length in bytes * \param[out] out output buffer of packed bits diff --git a/src/bitvec.c b/src/bitvec.c index c895cff..41e4f64 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -24,12 +24,11 @@ /*! \addtogroup bitvec * @{ - */ - -/*! \file bitvec.c * \brief Osmocom bit vector abstraction */ +/*! \file bitvec.c */ + #include #include #include diff --git a/src/conv.c b/src/conv.c index 79b3a7c..8e97e52 100644 --- a/src/conv.c +++ b/src/conv.c @@ -24,11 +24,10 @@ /*! \addtogroup conv * @{ + * \brief Osmocom convolutional encoder and decoder */ -/*! \file conv.c - * Osmocom convolutional encoder and decoder - */ +/*! \file conv.c */ #include "config.h" #ifdef HAVE_ALLOCA_H #include diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index 7e45c11..1a69e85 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -24,6 +24,7 @@ /*! \addtogroup crcgen * @{ + * \brief Osmocom generic CRC routines */ /*! \file crcXXgen.c diff --git a/src/fsm.c b/src/fsm.c index 5e74482..fbe22d7 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -29,9 +29,6 @@ /*! \addtogroup fsm * @{ - */ - -/*! \file fsm.c * \brief Finite State Machine abstraction * * This is a generic C-language abstraction for implementing finite @@ -84,9 +81,10 @@ * * In order to attach private state to the \ref osmo_fsm_inst, it * offers an opaque priv pointer. - * */ +/*! \file fsm.c */ + LLIST_HEAD(osmo_g_fsms); static bool fsm_log_addr = true; diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 23c0be8..17933ed 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1648,4 +1648,4 @@ DNS = ss; } -/*! }@ */ +/*! @} */ diff --git a/src/gsm/a5.c b/src/gsm/a5.c index dbba0f2..23cbe0c 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -26,13 +26,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/*! \addtogroup a5 +/*! \addtogroup crypto * @{ + * \brief Osmocom GSM/GPRS ciphering algorithm implementation */ -/*! \file gsm/a5.c - * \brief Osmocom GSM A5 ciphering algorithm implementation - */ +/*! \file gsm/a5.c */ #include #include diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 73759cb..c954902 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -22,6 +22,8 @@ /*! \addtogroup oml * @{ + * \brief GSM Network Management (OML) messages on the A-bis interface + * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ /*! \file abis_nm.c */ diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index c40027e..3b645d2 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -24,6 +24,10 @@ #include #include +/*! \addtogroup auth + * @{ + */ + static int c128v1_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) @@ -45,3 +49,5 @@ { osmo_auth_register(&c128v1_alg); } + +/*! @} */ diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index 168f886..b0900af 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -27,6 +27,10 @@ #include #include +/*! \addtogroup auth + * @{ + */ + static int c128v2_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) @@ -66,3 +70,5 @@ osmo_auth_register(&c128v2_alg); osmo_auth_register(&c128v3_alg); } + +/*! @} */ diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 9ca5d93..c9e403c 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -32,10 +32,10 @@ /*! \addtogroup auth * @{ + * \brief GSM/GPRS/3G authentication core infrastructure */ -/* \file auth_core.c - */ +/* \file auth_core.c */ static LLIST_HEAD(osmo_auths); diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index c1331b5..41e538d 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -25,6 +25,10 @@ #include "milenage/common.h" #include "milenage/milenage.h" +/*! \addtogroup auth + * @{ + */ + static int milenage_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) @@ -160,3 +164,5 @@ { osmo_auth_register(&milenage_alg); } + +/*! @} */ diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c index abb4917..cb3a309 100644 --- a/src/gsm/comp128.c +++ b/src/gsm/comp128.c @@ -68,6 +68,14 @@ #include #include +/*! \addtogroup auth + * @{ + */ + +/*! \file comp128.c + * \brief COMP128 v1; common/old GSM Authentication Algorithm (A3/A8) + */ + /* The compression tables (just copied ...) */ static const uint8_t table_0[512] = { 102, 177, 186, 162, 2, 156, 112, 75, 55, 25, 8, 12, 251, 193, 246, 188, @@ -184,6 +192,11 @@ x[(i>>3)+16] |= bits[(i*17) & 127] << (7-(i&7)); } +/*! \brief Perform COMP128v1 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value */ void comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { @@ -228,8 +241,16 @@ kc[7] = 0; } + +/*! \brief Perform COMP128v1 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value */ void comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { comp128v1(ki, rand, sres, kc); } + +/*! @} */ diff --git a/src/gsm/comp128v23.c b/src/gsm/comp128v23.c index e21b718..bfb4a0e 100644 --- a/src/gsm/comp128v23.c +++ b/src/gsm/comp128v23.c @@ -28,6 +28,14 @@ #include #include +/*! \addtogroup auth + * @{ + */ + +/*! \file comp128v23.c + * \brief COMP128 v2 / v3; Common Algorithm used for GSM Authentication (A3/A8) + */ + static const uint8_t table0[256] = { 197, 235, 60, 151, 98, 96, 3, 100, 248, 118, 42, 117, 172, 211, 181, 203, 61, 126, 156, 87, 149, 224, 55, 132, 186, 63, 238, 255, 85, 83, 152, 33, 160, @@ -101,6 +109,12 @@ } } +/*! \brief Perform COMP128v3 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value + * \returns 0 */ int comp128v3(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { @@ -147,6 +161,12 @@ return 0; } +/*! \brief Perform COMP128v2 algorithm + * \param[in] ki Secret Key K(i) of subscriber + * \param[in] rand Random Challenge + * \param[out] sres user-supplied buffer for storing computed SRES value + * \param[out] kc user-supplied buffer for storing computed Kc value + * \returns 0 */ int comp128v2(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { @@ -155,3 +175,5 @@ kc[6] &= 0xfc; return r; } + +/*! @} */ diff --git a/src/gsm/gan.c b/src/gsm/gan.c index 0bcaa17..1d98b38 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -21,6 +21,10 @@ #include +/*! \file gan.c + * \brief Generic Access Network (GAN) / UMA according to TS 44.318 + */ + const struct value_string gan_msgt_vals[] = { { GA_MT_RC_DISCOVERY_REQUEST, "GA-RC DISCOVERY REQUEST" }, diff --git a/src/gsm/gea.c b/src/gsm/gea.c index b8f6768..8d026a2 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -30,6 +30,13 @@ #include #include +/*! \addtogroup crypto + * @{ + */ + +/*! \file gsm/gea.c */ + + /*! \brief Performs the GEA4 algorithm as in 3GPP TS 55.226 V9.0.0 * \param[in,out] out Buffer for gamma for encrypted/decrypted * \param[in] len Length of out, in bytes @@ -58,3 +65,5 @@ osmo_c4(ck, kc); return gea4(out, len, ck, iv, direction); } + +/*! @} */ diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index da6e0a8..a0cf185 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -29,6 +29,10 @@ #include +/*! \addtogroup crypto + * @{ + */ + static LLIST_HEAD(gprs_ciphers); static struct gprs_cipher_impl *selected_ciphers[_GPRS_ALGO_NUM]; @@ -125,3 +129,4 @@ { return iov_i + lfn + oc; } +/*! @} */ diff --git a/src/gsm/gprs_gea.c b/src/gsm/gprs_gea.c index 8ff1648..836ee68 100644 --- a/src/gsm/gprs_gea.c +++ b/src/gsm/gprs_gea.c @@ -27,6 +27,10 @@ #include +/*! \addtogroup crypto + * @{ + */ + static struct gprs_cipher_impl gea3_impl = { .algo = GPRS_ALGO_GEA3, .name = "GEA3 (libosmogsm built-in)", @@ -46,3 +50,5 @@ gprs_cipher_register(&gea3_impl); gprs_cipher_register(&gea4_impl); } + +/*! @} */ diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index a4053ef..d1247be 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -5,6 +5,10 @@ #include #include +/*! \file gsm/gprs_rlc.c + * \brief helper functions for (E)GPRS RLC according to 3GPP TS 44.060 + */ + #define EGPRS_CPS_TYPE1_TBL_SZ 29 #define EGPRS_CPS_TYPE2_TBL_SZ 8 #define EGPRS_CPS_TYPE3_TBL_SZ 16 diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 1c14d3e..2592b54 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -27,6 +27,22 @@ #include #include +/*! \addtogroup sms + * @{ + */ + +/*! \brief Encode a 3GPP TS 03.41 SMS-CB message + * \param[in] ctx talloc allocation context + * \param[in] geo_scope Geographic Scope + * \param[in] msg_code Message Code + * \param[in] update Is this an update? + * \param[in] msg_id Message ID + * \param[in] dcs Data Coding Scheme + * \param[in] page_total Total number of pages + * \param[in] page_cur Current Page (up to \a page_total) + * \param[in] data Message data (copied 1:1) + * \param[in] len Length of \a data in bytes (up to 88) + * \returns callee-allocated TS 03.41 message with encoded data */ struct gsm341_ms_message * gsm0341_build_msg(void *ctx, uint8_t geo_scope, uint8_t msg_code, uint8_t update, uint16_t msg_id, uint8_t dcs, @@ -57,3 +73,5 @@ return cbmsg; } + +/*! @} */ diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 4c08365..03016b9 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -60,6 +60,11 @@ #include #include +/*! \addtogroup sms + * @{ + * \brief Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11 + */ + static void cp_timer_expired(void *data); #define MAX_SMS_RETRY 2 @@ -569,3 +574,5 @@ return rc; } + +/*! @} */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index eb8aec0..d120f2d 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -62,6 +62,10 @@ #define SMR_LOG_STR "SMR(%" PRIu64 ") " +/*! \addtogroup sms + * @{ + */ + static void rp_timer_expired(void *data); /* init a new instance */ @@ -484,3 +488,5 @@ return rc; } + +/*! @} */ diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index b84c9f2..543775c 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -38,16 +38,24 @@ #include #include +/*! \addtogroup sms + * @{ + */ + #define GSM411_ALLOC_SIZE 1024 #define GSM411_ALLOC_HEADROOM 128 +/*! \brief Allocate a message buffer for use as TS 04.11 message + * \returns allocated message buffer */ struct msgb *gsm411_msgb_alloc(void) { return msgb_alloc_headroom(GSM411_ALLOC_SIZE, GSM411_ALLOC_HEADROOM, "GSM 04.11"); } -/* Turn int into semi-octet representation: 98 => 0x89 */ +/*! \brief Turn int into semi-octet representation: 98 => 0x89 + * \param[in] integer value representing decimal number 0..99 + * \returns BSC encoded as nibbles, swapped */ uint8_t gsm411_bcdify(uint8_t value) { uint8_t ret; @@ -58,7 +66,9 @@ return ret; } -/* Turn semi-octet representation into int: 0x89 => 98 */ +/*! \brief Turn semi-octet representation into int: 0x89 => 98 + * \param[in] value byte containing two BCD nibbles in revere order + * \returns integer representing decoded, re-ordered nibbles */ uint8_t gsm411_unbcdify(uint8_t value) { uint8_t ret; @@ -73,7 +83,9 @@ return ret; } -/* Generate 03.40 TP-SCTS */ +/*! \brief Generate 03.40 TP-SCTS + * \param[out] scts Caller-provided buffer to store SCTS (7 octets) + * \param[in] time to encode */ void gsm340_gen_scts(uint8_t *scts, time_t time) { struct tm *tm = gmtime(&time); @@ -92,7 +104,9 @@ #endif } -/* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */ +/*! \brief Decode 03.40 TP-SCTS (into utc/gmt timestamp) + * \param[in] scts SMS Center Time Stamp + * \return time in UTC time_t format */ time_t gsm340_scts(uint8_t *scts) { struct tm tm; @@ -190,7 +204,10 @@ return minutes; } -/* decode validity period. return minutes */ +/*! \brief decode validity period. return minutes + * \param[in] sms_vpf Validity Period Format in 03.40 encoding + * \param[in] sms_vp Validity Period Information Element + * \returns validity period in minutes */ unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp) { uint8_t fi; /* functionality indicator */ @@ -228,7 +245,9 @@ } } -/* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */ +/*! \brief determine coding alphabet dependent on GSM 03.38 Section 4 DCS + * \param[in] dcs Data Coding Scheme in 03.38 encoding + * \returns libosmogsm internal enum \ref sms_alphabet */ enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs) { uint8_t cgbits = dcs >> 4; @@ -266,7 +285,13 @@ return alpha; } -/* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */ +/*! \brief generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 + * \param[out] oa caller-provided output buffer + * \param[in] oa_len caller-specified length of \a oa in bytes + * \param[in] type GSM340_TYPE_* + * \param[in] plan Numbering Plan + * \param[in] number string containing number + * \reurns number of bytes of \a oa that have been used */ int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len, uint8_t type, uint8_t plan, const char *number) { @@ -296,7 +321,11 @@ return len_in_bytes; } -/* Prefix msg with a RP header */ +/*! \brief Prefix \ref msgb with a RP header + * \param msg Message Buffer containing message + * \param[in] rp_msg_type RP Message Type + * \param[in] rp_msg_ref RP Message Reference + * \returns 0 */ int gsm411_push_rp_header(struct msgb *msg, uint8_t rp_msg_type, uint8_t rp_msg_ref) { @@ -312,7 +341,12 @@ return 0; } -/* Prefix msg with a 04.08/04.11 CP header */ +/*! \brief Prefix \ref msgb with a 04.08/04.11 CP header + * \param msg Message Buffer containing message + * \param[in] proto Protocol + * \param[in] trans Transaction + * \param[in] msg_type Message Type + * \retrns 0 */ int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type) { @@ -320,3 +354,5 @@ gsm0480_l3hdr_push(msg, proto | (trans << 4), msg_type); return 0; } + +/*! @} */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 04c2f01..c96dc77 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -24,9 +24,22 @@ #include #include +/*! \addtogroup gsm0808 + * @{ + * \brief Helper functions regarding the TS 08.08 / 48.008 A interface + */ + #define BSSMAP_MSG_SIZE 512 #define BSSMAP_MSG_HEADROOM 128 +/*! \brief Create "Complete L3 Info" for AoIP + * \param[in] msg_l3 msgb containing Layer 3 Message + * \param[in] nc Mobile Network Code + * \param[in] cc Mobile Country Code + * \param[in] lac Location Area Code + * \param[in] _ci Cell Identity + * \param[in] scl Speech Codec List + * \returns callee-allocated msgb with Complete L3 Info message */ struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci, const struct gsm0808_speech_codec_list @@ -68,12 +81,21 @@ return msg; } +/*! \brief Create "Complete L3 Info" for A + * \param[in] msg_l3 msgb containing Layer 3 Message + * \param[in] nc Mobile Network Code + * \param[in] cc Mobile Country Code + * \param[in] lac Location Area Code + * \param[in] _ci Cell Identity + * \returns callee-allocated msgb with Complete L3 Info message */ struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci) { return gsm0808_create_layer3_aoip(msg_l3, nc, cc, lac, _ci, NULL); } +/*! \brief Create BSSMAP RESET message + * \returns callee-allocated msgb with BSSMAP Reset message */ struct msgb *gsm0808_create_reset(void) { uint8_t cause = GSM0808_CAUSE_EQUIPMENT_FAILURE; @@ -89,6 +111,8 @@ return msg; } +/*! \brief Create BSSMAP RESET ACK message + * \returns callee-allocated msgb with BSSMAP Reset ACK message */ struct msgb *gsm0808_create_reset_ack(void) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -102,6 +126,8 @@ return msg; } +/*! \brief Create BSSMAP Clear Complete message + * \returns callee-allocated msgb with BSSMAP Clear Complete message */ struct msgb *gsm0808_create_clear_complete(void) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -116,6 +142,9 @@ return msg; } +/*! \brief Create BSSMAP Clear Command message + * \param[in] reason TS 08.08 cause value + * \returns callee-allocated msgb with BSSMAP Clear Command message */ struct msgb *gsm0808_create_clear_command(uint8_t reason) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -130,6 +159,10 @@ return msg; } +/*! \brief Create BSSMAP Cipher Mode Command message + * \param[in] ei Mandatory Encryption Information + * \param[in] cipher_response_mode optional 1-byte Cipher Response Mode + * \returns callee-allocated msgb with BSSMAP Cipher Mode Command message */ struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei, const uint8_t *cipher_response_mode) { @@ -163,6 +196,10 @@ return msg; } +/*! \brief Create BSSMAP Cipher Mode Complete message + * \param[in] layer3 L3 Message to be included + * \param[in] alg_id Chosen Encrpytion Algorithm + * \returns callee-allocated msgb with BSSMAP Cipher Mode Complete message */ struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -188,6 +225,9 @@ return msg; } +/*! \brief Create BSSMAP Cipher Mode Reject message + * \param[in] reason TS 08.08 cause value + * \returns callee-allocated msgb with BSSMAP Cipher Mode Reject message */ struct msgb *gsm0808_create_cipher_reject(uint8_t cause) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -202,6 +242,12 @@ return msg; } +/*! \brief Create BSSMAP Classmark Update message + * \param[in] cm2 Classmark 2 + * \param[in] cm2_len length (in octets) of \a cm2 + * \param[in] cm3 Classmark 3 + * \param[in] cm3_len length (in octets) of \a cm3 + * \returns callee-allocated msgb with BSSMAP Classmark Update message */ struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len) { @@ -221,6 +267,9 @@ return msg; } +/*! \brief Create BSSMAP SAPI N Reject message + * \param[in] link_id Link Identifier + * \returns callee-allocated msgb with BSSMAP SAPI N Reject message */ struct msgb *gsm0808_create_sapi_reject(uint8_t link_id) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, @@ -237,6 +286,13 @@ return msg; } +/*! \brief Create BSSMAP Assignment Request message + * \param[in] ct Channel Type + * \param[in] cic Circuit Identity Code (Classic A only) + * \param[in] ss Socket Address of MSC-side RTP socket (AoIP only) + * \param[in] scl Speech Codec List (AoIP only) + * \param[in] ci Call Identifier (Optional, LCLS) + * \returns callee-allocated msgb with BSSMAP Assignment Request message */ struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct, const uint16_t *cic, const struct sockaddr_storage *ss, @@ -293,6 +349,15 @@ return msg; } +/*! \brief Create BSSMAP Assignment Completed message + * \param[in] rr_cause GSM 04.08 RR Cause value + * \param[in] chosen_channel Chosen Channel + * \param[in] encr_alg_id Encryption Algorithm ID + * \param[in] speech_mode Speech Mode + * \param[in] ss Socket Address of BSS-side RTP socket + * \param[in] sc Speech Codec (current) + * \param[in] scl Speech Codec List (permitted) + * \returns callee-allocated msgb with BSSMAP Assignment Complete message */ struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode, const struct sockaddr_storage *ss, @@ -342,6 +407,12 @@ return msg; } +/*! \brief Create BSSMAP Assignment Completed message + * \param[in] rr_cause GSM 04.08 RR Cause value + * \param[in] chosen_channel Chosen Channel + * \param[in] encr_alg_id Encryption Algorithm ID + * \param[in] speech_mode Speech Mode + * \returns callee-allocated msgb with BSSMAP Assignment Complete message */ struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, @@ -351,6 +422,11 @@ speech_mode, NULL, NULL, NULL); } +/*! \brief Create BSSMAP Assignment Failure message + * \param[in] cause BSSMAP Cause value + * \param[in] rr_cause GSM 04.08 RR Cause value + * \param[in] scl Optional Speech Cdec List (AoIP) + * \returns callee-allocated msgb with BSSMAP Assignment Failure message */ struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause, const struct gsm0808_speech_codec_list *scl) @@ -380,12 +456,19 @@ return msg; } +/*! \brief Create BSSMAP Assignment Failure message + * \param[in] cause BSSMAP Cause value + * \param[in] rr_cause GSM 04.08 RR Cause value + * \returns callee-allocated msgb with BSSMAP Assignment Failure message */ struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause) { return gsm0808_create_ass_fail(cause, rr_cause, NULL); } +/*! \brief Create BSSMAP Clear Request message + * \param[in] cause BSSMAP Cause value + * \returns callee-allocated msgb with BSSMAP Clear Request message */ struct msgb *gsm0808_create_clear_rqst(uint8_t cause) { struct msgb *msg; @@ -402,6 +485,12 @@ return msg; } +/*! \brief Create BSSMAP PAGING message + * \param[in] imsi Mandatory paged IMSI in string representation + * \param[in] tmsi Optional paged TMSI + * \param[in] cil Cell Identity List (where to page) + * \param[in] chan_needed Channel Type needed + * \returns callee-allocated msgb with BSSMAP PAGING message */ struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list *cil, const uint8_t *chan_needed) @@ -454,6 +543,9 @@ return msg; } +/*! \brief Prepend a DTAP header to given Message Buffer + * \param[in] msgb Message Buffer + * \param[in] link_id Link Identifier */ void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id) { uint8_t *hh = msgb_push(msg, 3); @@ -462,6 +554,10 @@ hh[2] = msg->len - 3; } +/*! \brief Create BSSMAP DTAP message + * \param[in] msg_l3 Messge Buffer containing Layer3 message + * \param[in] link_id Link Identifier + * \returns callee-allocated msgb with BSSMAP DTAP message */ struct msgb *gsm0808_create_dtap(struct msgb *msg_l3, uint8_t link_id) { struct dtap_header *header; @@ -722,6 +818,7 @@ { 0, NULL } }; +/*! \brief Return string name of BSSMAP Message Type */ const char *gsm0808_bssmap_name(uint8_t msg_type) { return get_value_string(gsm0808_msgt_names, msg_type); @@ -733,7 +830,10 @@ { 0, NULL } }; +/*! \brief Return string name of BSSAP Message Type */ const char *gsm0808_bssap_name(uint8_t msg_type) { return get_value_string(gsm0808_bssap_names, msg_type); } + +/*! @} */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index ff97b2d..bdd02e5 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -39,7 +39,15 @@ #include #include -/* Encode AoIP transport address element */ + +/*! \addtogroup gsm0808 + * @{ + */ + +/*! \brief Encode TS 08.08 AoIP transport address IE + * \param[out] msg Message Buffer to which to append IE + * \param[in] ss Socket Address to be used in IE + * \returns number of bytes added to \a msg */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss) { @@ -80,7 +88,11 @@ return *tlv_len + 2; } -/* Decode AoIP transport address element */ +/*! \brief Decode TS 08.08 AoIP transport address IE + * \param[out] ss Caller-provided memory where decoded socket addr is stored + * \param[in] elem pointer to IE value + * \param[in] len length of \a elem in bytes + * \returns number of bytes parsed */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len) { @@ -168,7 +180,10 @@ return (uint8_t) (msg->tail - old_tail); } -/* Encode Speech Codec element */ +/*! \brief Encode TS 08.08 Speech Codec IE + * \param[out] msg Message Buffer to which IE will be appended + * \param[in] sc Speech Codec to be encoded into IE + * \returns number of bytes appended to \a msg */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc) { @@ -188,7 +203,11 @@ return *tlv_len + 2; } -/* Decode Speech Codec element */ +/*! \brief Decode TS 08.08 Speech Codec IE + * \param[out] sc Caller-allocated memory for Speech Codec + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len) { @@ -244,7 +263,10 @@ return (int)(elem - old_elem); } -/* Encode Speech Codec list */ +/*! \brief Encode TS 08.08 Speech Codec list + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] scl Speech Codec List to be encoded into IE + * \returns number of bytes added to \a msg */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl) { @@ -275,7 +297,11 @@ return *tlv_len + 2; } -/* Decode Speech Codec list */ +/*! \brief Decode TS 08.08 Speech Codec list IE + * \param[out] scl Caller-provided memory to store codec list + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len) { @@ -315,7 +341,10 @@ return (int)(elem - old_elem); } -/* Encode Channel Type element */ +/*! \brief Encode TS 08.08 Channel Type IE + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] ct Channel Type to be encoded + * \returns number of bytes added to \a msg */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct) { @@ -353,7 +382,11 @@ return *tlv_len + 2; } -/* Decode Channel Type element */ +/*! \brief Decode TS 08.08 Channel Type IE + * \param[out] ct Caller-provided memory to store channel type + * \param[in] elem IE Value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len) { @@ -386,7 +419,10 @@ return (int)(elem - old_elem); } -/* Encode Encryption Information element */ +/*! \brief Encode TS 08.08 Encryption Information IE + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] ei Encryption Information to be encoded + * \returns number of bytes appended to \a msg */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei) { @@ -421,7 +457,11 @@ return *tlv_len + 2; } -/* Decode Encryption Information element */ +/*! \brief Decode TS 08.08 Encryption Information IE + * \param[out] ei Caller-provided memory to store encryption information + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len) { @@ -456,7 +496,10 @@ return (int)(elem - old_elem); } -/* Encode Cell Identifier List element */ +/*! \brief Encode TS 08.08 Cell Identifier List IE + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] cil Cell ID List to be encoded + * \returns number of bytes appended to \a msg */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil) { @@ -492,7 +535,11 @@ return *tlv_len + 2; } -/* Decode Cell Identifier List element */ +/*! \brief Decode Cell Identifier List IE + * \param[out] cil Caller-provided memory to store Cell ID list + * \param[in] elem IE value to be decoded + * \param[in] len Length of \a elem in bytes + * \returns number of bytes parsed; negative on error */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len) { @@ -533,3 +580,5 @@ cil->id_list_len = item_count; return (int)(elem - old_elem); } + +/*! @} */ diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 543c9c0..1b25538 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -39,6 +39,12 @@ #include #include +/*! \addtogroup gsm0408 + * @{ + * \brief GSM Mobile Radion Interface L3 messages / TS 04.08 + */ + +/*! \brief TLV parser definitions for TS 04.08 CC */ const struct tlv_definition gsm48_att_tlvdef = { .def = { [GSM48_IE_MOBILE_ID] = { TLV_TYPE_TLV }, @@ -80,7 +86,7 @@ }, }; -/* RR elements */ +/*! \brief TLV parser definitions for TS 04.08 RR */ const struct tlv_definition gsm48_rr_att_tlvdef = { .def = { /* NOTE: Don't add IE 17 = MOBILE_ID here, it already used. */ @@ -125,7 +131,7 @@ }, }; -/* MM elements */ +/*! \brief TLV parser definitions for TS 04.08 MM */ const struct tlv_definition gsm48_mm_att_tlvdef = { .def = { [GSM48_IE_MOBILE_ID] = { TLV_TYPE_TLV }, @@ -164,6 +170,7 @@ { 0, NULL }, }; +/*! \brief return string representation of RR Cause value */ const char *rr_cause_name(uint8_t cause) { return get_value_string(rr_cause_names, cause); @@ -205,6 +212,7 @@ "illegal state 31", }; +/*! \brief return string representation of CC State */ const char *gsm48_cc_state_name(uint8_t state) { if (state < ARRAY_SIZE(cc_state_names)) @@ -252,6 +260,7 @@ { 0, NULL } }; +/*! \brief return string representation of CC Message Type */ const char *gsm48_cc_msg_name(uint8_t msgtype) { return get_value_string(cc_msg_names, msgtype); @@ -359,6 +368,7 @@ { 0, NULL } }; +/*! \brief return string representation of RR Message Type */ const char *gsm48_rr_msg_name(uint8_t msgtype) { return get_value_string(rr_msg_names, msgtype); @@ -398,6 +408,7 @@ { 0, NULL } }; +/*! \brief return string representation of Mobile Identity Type */ const char *gsm48_mi_type_name(uint8_t mi) { return get_value_string(mi_type_names, mi); @@ -437,7 +448,12 @@ } } -/* Convert given mcc and mnc to BCD and write to *bcd_dst, which must be an +/* \brief Convert MCC + MNC to BCD representation + * \param[out] bcd_dst caller-allocated memory for output + * \param[in] mcc Mobile Country Code + * \param[in] mnc Mobile Network Code + * + * Convert given mcc and mnc to BCD and write to *bcd_dst, which must be an * allocated buffer of (at least) 3 bytes length. */ void gsm48_mcc_mnc_to_bcd(uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc) { @@ -477,6 +493,11 @@ } } +/*! \brief Encode TS 04.08 Location Area Identifier + * \param[out] caller-provided memory for output + * \param[in] mcc Mobile Country Code + * \param[in] mnc Mobile Network Code + * \param[in] lac Location Area Code */ void gsm48_generate_lai(struct gsm48_loc_area_id *lai48, uint16_t mcc, uint16_t mnc, uint16_t lac) { @@ -484,7 +505,14 @@ lai48->lac = osmo_htons(lac); } -/* Attention: this function returns true integers, not hex! */ +/*! \brief Decode TS 04.08 Location Area Identifier + * \param[in] Location Area Identifier (encoded) + * \param[out] mcc Mobile Country Code + * \param[out] mnc Mobile Network Code + * \param[out] lac Location Area Code + * \returns 0 + * + * Attention: this function returns true integers, not hex! */ int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) { @@ -537,6 +565,10 @@ } } +/*! \brief Generate TS 04.08 Mobile ID from TMSI + * \param[out] buf Caller-provided output buffer (7 bytes) + * \param[in] tmsi TMSI to be encoded + * \returns number of byes encoded (always 7) */ int gsm48_generate_mid_from_tmsi(uint8_t *buf, uint32_t tmsi) { uint32_t tmsi_be = osmo_htonl(tmsi); @@ -549,6 +581,10 @@ return 7; } +/*! \brief Generate TS 04.08 Mobile ID from IMSI + * \param[out] buf Caller-provided output buffer + * \param[in] imsi IMSI to be encoded + * \returns number of bytes used in \a buf */ int gsm48_generate_mid_from_imsi(uint8_t *buf, const char *imsi) { unsigned int length = strlen(imsi), i, off = 0; @@ -578,7 +614,12 @@ return 2 + buf[1]; } -/* Convert Mobile Identity (10.5.1.4) to string */ +/*! \brief Convert TS 04.08 Mobile Identity (10.5.1.4) to string + * \param[out] string Caller-provided buffer for output + * \param[in] str_len Length of \a string in bytes + * \param[in] mi Mobile Identity to be stringified + * \param[in] mi_len Length of \a mi in bytes + * \returns length of string written to \a string */ int gsm48_mi_to_string(char *string, const int str_len, const uint8_t *mi, const int mi_len) { @@ -621,6 +662,9 @@ return str_cur - string; } +/*! \brief Parse TS 04.08 Routing Area Identifier + * \param[out] Caller-provided memory for decoded RA ID + * \param[in] buf Input buffer pointing to RAI IE value */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf) { raid->mcc = (buf[0] & 0xf) * 100; @@ -642,6 +686,10 @@ raid->rac = buf[5]; } +/*! \brief Encode a TS 04.08 Routing Area Identifier + * \param[out] buf Caller-provided output buffer of 6 bytes + * \param[in] raid Routing Area ID to be encoded + * \returns number of bytes used in \a buf */ int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) { uint16_t mcc = raid->mcc; @@ -669,7 +717,13 @@ return 6; } -/* From Table 10.5.33 of GSM 04.08 */ +/*! \brief Determine number of paging sub-channels + * \param[in] chan_desc Control Channel Description + * \returns number of paging sub-channels + * + * Uses From Table 10.5.33 of GSM 04.08 to determine the number of + * paging sub-channels in the given control channel configuration + */ int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc) { unsigned int n_pag_blocks = gsm0502_get_n_pag_blocks(chan_desc); @@ -680,6 +734,7 @@ return n_pag_blocks * (chan_desc->bs_pa_mfrms + 2); } +/*! \brief TS 04.08 Protocol Descriptor names */ const struct value_string gsm48_pdisc_names[] = { OSMO_VALUE_STRING(GSM48_PDISC_GROUP_CC), OSMO_VALUE_STRING(GSM48_PDISC_BCAST_CC), @@ -699,6 +754,7 @@ { 0, NULL } }; +/*! \brief TS 04.08 RR Message Type names */ const struct value_string gsm48_rr_msgtype_names[] = { OSMO_VALUE_STRING(GSM48_MT_RR_INIT_REQ), OSMO_VALUE_STRING(GSM48_MT_RR_ADD_ASS), @@ -791,6 +847,7 @@ { 0, NULL } }; +/*! \brief TS 04.08 MM Message Type names */ const struct value_string gsm48_mm_msgtype_names[] = { OSMO_VALUE_STRING(GSM48_MT_MM_IMSI_DETACH_IND), OSMO_VALUE_STRING(GSM48_MT_MM_LOC_UPD_ACCEPT), @@ -820,6 +877,7 @@ { 0, NULL } }; +/*! \brief TS 04.08 CC Message Type names */ const struct value_string gsm48_cc_msgtype_names[] = { OSMO_VALUE_STRING(GSM48_MT_CC_ALERTING), OSMO_VALUE_STRING(GSM48_MT_CC_CALL_CONF), @@ -862,12 +920,12 @@ { 0, NULL } }; -/*! /brief Compose a string naming the message type for given protocol. +/*! \brief Compose a string naming the message type for given protocol. * If the message type string is known, return the message type name, otherwise * return ":". - * /param pdisc[in] protocol discriminator like GSM48_PDISC_MM - * /param msg_type[in] message type like GSM48_MT_MM_LOC_UPD_REQUEST - * /returns statically allocated string or string constant. + * \param[in] pdisc protocol discriminator like GSM48_PDISC_MM + * \param[in] msg_type message type like GSM48_MT_MM_LOC_UPD_REQUEST + * \returns statically allocated string or string constant. */ const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type) { @@ -896,3 +954,5 @@ gsm48_pdisc_name(pdisc), msg_type); return namebuf; } + +/*! @} */ diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index 2cc0645..20d0075 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -34,12 +34,20 @@ #include #include +/*! \addtogroup gsm0408 + * @{ + */ + static const char bcd_num_digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '#', 'a', 'b', 'c', '\0' }; -/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */ +/*! \brief decode a 'called/calling/connect party BCD number' as in 10.5.4.7 + * \param[out] Caller-provided output buffer + * \param[in] bcd_lv Length-Value portion of to-be-decoded IE + * \param[in] h_len Length of an optional heder between L and V portion + * \returns - in case of success; negative on error */ int gsm48_decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv, int h_len) { @@ -65,7 +73,7 @@ return 0; } -/* convert a single ASCII character to call-control BCD */ +/*! \brief convert a single ASCII character to call-control BCD */ static int asc_to_bcd(const char asc) { int i; @@ -77,7 +85,12 @@ return -EINVAL; } -/* convert a ASCII phone number to 'called/calling/connect party BCD number' */ +/*! \brief convert a ASCII phone number to 'called/calling/connect party BCD number' + * \param[out] bcd_lv Caller-provided output buffer + * \param[in] max_len Maximum Length of \a bcd_lv + * \param[in] h_len Length of an optional heder between L and V portion + * \param[in] input phone number as 0-terminated ASCII + * \returns number of bytes used in \a bcd_lv */ int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len, int h_len, const char *input) { @@ -110,7 +123,10 @@ return (bcd_cur - bcd_lv); } -/* TS 04.08 10.5.4.5: decode 'bearer capability' */ +/*! \brief Decode TS 04.08 Bearer Capability IE (10.5.4.5) + * \param[out] Caller-provided memory for decoded output + * \[aram[in] LV portion of TS 04.08 Bearer Capability + * \returns 0 on success; negative on error */ int gsm48_decode_bearer_cap(struct gsm_mncc_bearer_cap *bcap, const uint8_t *lv) { @@ -219,7 +235,11 @@ return 0; } -/* TS 04.08 10.5.4.5: encode 'bearer capability' */ +/*! \brief Encode TS 04.08 Bearer Capability IE (10.5.4.5) + * \param[out] msg Message Buffer to which IE is to be appended + * \param[in] lv_only Write only LV portion (1) or TLV (0) + * \param[in] bcap Decoded Bearer Capability to be encoded + * \returns 0 on success; negative on error */ int gsm48_encode_bearer_cap(struct msgb *msg, int lv_only, const struct gsm_mncc_bearer_cap *bcap) { @@ -274,7 +294,10 @@ return 0; } -/* TS 04.08 10.5.4.5a: decode 'call control cap' */ +/*! \brief Decode TS 04.08 Call Control Capabilities IE (10.5.4.5a) + * \param[out] Caller-provided memory for decoded CC capabilities + * \param[in] lv Length-Value of IE + * \retursns 0 on success; negative on error */ int gsm48_decode_cccap(struct gsm_mncc_cccap *ccap, const uint8_t *lv) { uint8_t in_len = lv[0]; @@ -289,7 +312,10 @@ return 0; } -/* TS 04.08 10.5.4.5a: encode 'call control cap' */ +/*! \brief Encodoe TS 04.08 Call Control Capabilities (10.5.4.5a) + * \param[out] msg Message Buffer to which to append IE (as TLV) + * \param[in] ccap Decoded CC Capabilities to be encoded + * \returns 0 on success; negative on error */ int gsm48_encode_cccap(struct msgb *msg, const struct gsm_mncc_cccap *ccap) { @@ -307,7 +333,10 @@ return 0; } -/* TS 04.08 10.5.4.7: decode 'called party BCD number' */ +/*! \brief Decode TS 04.08 Called Party BCD Number IE (10.5.4.7) + * \param[out] called Caller-provided memory for decoded number + * \param[in] lv Length-Value portion of IE + * \returns 0 on success; negative on error */ int gsm48_decode_called(struct gsm_mncc_number *called, const uint8_t *lv) { @@ -326,7 +355,10 @@ return 0; } -/* TS 04.08 10.5.4.7: encode 'called party BCD number' */ +/*! \brief Encode TS 04.08 Called Party IE (10.5.4.7) + * \param[out] msg Mesage Buffer to which to append IE (as TLV) + * \param[in] called MNCC Number to encode/append + * \returns 0 on success; negative on error */ int gsm48_encode_called(struct msgb *msg, const struct gsm_mncc_number *called) { @@ -348,7 +380,10 @@ return 0; } -/* decode callerid of various IEs */ +/*! \brief Decode TS 04.08 Caller ID + * \param[out] called Caller-provided memory for decoded number + * \param[in] lv Length-Value portion of IE + * \returns 0 on success; negative on error */ int gsm48_decode_callerid(struct gsm_mncc_number *callerid, const uint8_t *lv) { @@ -375,7 +410,12 @@ return 0; } -/* encode callerid of various IEs */ +/*! \brief Encode TS 04.08 Caller ID IE + * \param[out] msg Mesage Buffer to which to append IE (as TLV) + * \param[in] ie IE Identifier (tag) + * \param[in] max_len maximum generated output in bytes + * \param[in] callerid MNCC Number to encode/append + * \returns 0 on success; negative on error */ int gsm48_encode_callerid(struct msgb *msg, int ie, int max_len, const struct gsm_mncc_number *callerid) { @@ -406,7 +446,10 @@ return 0; } -/* TS 04.08 10.5.4.11: decode 'cause' */ +/*! \brief Decode TS 04.08 Cause IE (10.5.4.11) + * \param[out] cause Caller-provided memory for output + * \param[in] lv LV portion of Cause IE + * \returns 0 on success; negative on error */ int gsm48_decode_cause(struct gsm_mncc_cause *cause, const uint8_t *lv) { @@ -449,7 +492,11 @@ return 0; } -/* TS 04.08 10.5.4.11: encode 'cause' */ +/*! \brief Encode TS 04.08 Cause IE (10.5.4.11) + * \param[out] msg Message Buffer to which to append IE + * \param[in] lv_only Encode as LV (1) or TLV (0) + * \param[in] cause Cause value to be encoded + * \returns 0 on success; negative on error */ int gsm48_encode_cause(struct msgb *msg, int lv_only, const struct gsm_mncc_cause *cause) { @@ -489,49 +536,49 @@ return 0; } -/* TS 04.08 10.5.4.9: decode 'calling number' */ +/*! \brief Decode TS 04.08 Calling Number IE (10.5.4.9) */ int gsm48_decode_calling(struct gsm_mncc_number *calling, const uint8_t *lv) { return gsm48_decode_callerid(calling, lv); } -/* TS 04.08 10.5.4.9: encode 'calling number' */ +/*! \brief Encode TS 04.08 Calling Number IE (10.5.4.9) */ int gsm48_encode_calling(struct msgb *msg, const struct gsm_mncc_number *calling) { return gsm48_encode_callerid(msg, GSM48_IE_CALLING_BCD, 14, calling); } -/* TS 04.08 10.5.4.13: decode 'connected number' */ +/*! \brief Decode TS 04.08 Connected Number IE (10.5.4.13) */ int gsm48_decode_connected(struct gsm_mncc_number *connected, const uint8_t *lv) { return gsm48_decode_callerid(connected, lv); } -/* TS 04.08 10.5.4.13: encode 'connected number' */ +/*! \brief Encode TS 04.08 Connected Number IE (10.5.4.13) */ int gsm48_encode_connected(struct msgb *msg, const struct gsm_mncc_number *connected) { return gsm48_encode_callerid(msg, GSM48_IE_CONN_BCD, 14, connected); } -/* TS 04.08 10.5.4.21b: decode 'redirecting number' */ +/*! \brief Decode TS 04.08 Redirecting Number IE (10.5.4.21b) */ int gsm48_decode_redirecting(struct gsm_mncc_number *redirecting, const uint8_t *lv) { return gsm48_decode_callerid(redirecting, lv); } -/* TS 04.08 10.5.4.21b: encode 'redirecting number' */ +/*! \brief Encode TS 04.08 Redirecting Number IE (10.5.4.21b) */ int gsm48_encode_redirecting(struct msgb *msg, const struct gsm_mncc_number *redirecting) { return gsm48_encode_callerid(msg, GSM48_IE_REDIR_BCD, 19, redirecting); } -/* TS 04.08 10.5.4.15: decode 'facility' */ +/*! \brief Decode TS 04.08 Facility IE (10.5.4.15) */ int gsm48_decode_facility(struct gsm_mncc_facility *facility, const uint8_t *lv) { @@ -549,7 +596,7 @@ return 0; } -/* TS 04.08 10.5.4.15: encode 'facility' */ +/*! \brief Encode TS 04.08 Facility IE (10.5.4.15) */ int gsm48_encode_facility(struct msgb *msg, int lv_only, const struct gsm_mncc_facility *facility) { @@ -568,7 +615,7 @@ return 0; } -/* TS 04.08 10.5.4.20: decode 'notify' */ +/*! \brief Decode TS 04.08 Notify IE (10.5.4.20) */ int gsm48_decode_notify(int *notify, const uint8_t *v) { *notify = v[0] & 0x7f; @@ -576,7 +623,7 @@ return 0; } -/* TS 04.08 10.5.4.20: encode 'notify' */ +/*! \brief Encode TS 04.08 Notify IE (10.5.4.20) */ int gsm48_encode_notify(struct msgb *msg, int notify) { msgb_v_put(msg, notify | 0x80); @@ -584,7 +631,7 @@ return 0; } -/* TS 04.08 10.5.4.23: decode 'signal' */ +/*! \brief Decode TS 04.08 Signal IE (10.5.4.23) */ int gsm48_decode_signal(int *signal, const uint8_t *v) { *signal = v[0]; @@ -592,7 +639,7 @@ return 0; } -/* TS 04.08 10.5.4.23: encode 'signal' */ +/*! \brief Encode TS 04.08 Signal IE (10.5.4.23) */ int gsm48_encode_signal(struct msgb *msg, int signal) { msgb_tv_put(msg, GSM48_IE_SIGNAL, signal); @@ -600,7 +647,7 @@ return 0; } -/* TS 04.08 10.5.4.17: decode 'keypad' */ +/*! \brief Decode TS 04.08 Keypad IE (10.5.4.17) */ int gsm48_decode_keypad(int *keypad, const uint8_t *lv) { uint8_t in_len = lv[0]; @@ -613,7 +660,7 @@ return 0; } -/* TS 04.08 10.5.4.17: encode 'keypad' */ +/*! \brief Encode TS 04.08 Keypad IE (10.5.4.17) */ int gsm48_encode_keypad(struct msgb *msg, int keypad) { msgb_tv_put(msg, GSM48_IE_KPD_FACILITY, keypad); @@ -621,7 +668,7 @@ return 0; } -/* TS 04.08 10.5.4.21: decode 'progress' */ +/*! \brief Decode TS 04.08 Progress IE (10.5.4.21) */ int gsm48_decode_progress(struct gsm_mncc_progress *progress, const uint8_t *lv) { @@ -637,7 +684,7 @@ return 0; } -/* TS 04.08 10.5.4.21: encode 'progress' */ +/*! \brief Encode TS 04.08 Progress IE (10.5.4.21) */ int gsm48_encode_progress(struct msgb *msg, int lv_only, const struct gsm_mncc_progress *p) { @@ -654,7 +701,7 @@ return 0; } -/* TS 04.08 10.5.4.25: decode 'user-user' */ +/*! \brief Decode TS 04.08 User-User IE (10.5.4.25) */ int gsm48_decode_useruser(struct gsm_mncc_useruser *uu, const uint8_t *lv) { @@ -680,7 +727,7 @@ return 0; } -/* TS 04.08 10.5.4.25: encode 'useruser' */ +/*! \brief Encode TS 04.08 User-User IE (10.5.4.25) */ int gsm48_encode_useruser(struct msgb *msg, int lv_only, const struct gsm_mncc_useruser *uu) { @@ -700,7 +747,7 @@ return 0; } -/* TS 04.08 10.5.4.24: decode 'ss version' */ +/*! \brief Decode TS 04.08 SS Version IE (10.5.4.24) */ int gsm48_decode_ssversion(struct gsm_mncc_ssversion *ssv, const uint8_t *lv) { @@ -715,7 +762,7 @@ return 0; } -/* TS 04.08 10.5.4.24: encode 'ss version' */ +/*! \brief Encode TS 04.08 SS Version IE (10.5.4.24) */ int gsm48_encode_ssversion(struct msgb *msg, const struct gsm_mncc_ssversion *ssv) { @@ -733,7 +780,7 @@ /* decode 'more data' does not require a function, because it has no value */ -/* TS 04.08 10.5.4.19: encode 'more data' */ +/*! \brief Encode TS 04.08 More Data IE (10.5.4.19) */ int gsm48_encode_more(struct msgb *msg) { uint8_t *ie; @@ -756,7 +803,11 @@ return res; } -/* decode "Cell Channel Description" (10.5.2.1b) and other frequency lists */ +/*! \brief Decode TS 04.08 Cell Channel Description IE (10.5.2.1b) and other frequency lists + * \param[out] f Caller-provided output memory + * \param[in] cd Cell Channel Description IE + * \param[in] len Length of \a cd in bytes + * \returns 0 on success; negative on error */ int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd, uint8_t len, uint8_t mask, uint8_t frqt) { @@ -1190,3 +1241,4 @@ return 0; } +/*! @} */ diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 5fef208..bd986d7 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -26,9 +26,11 @@ #include -/* Protocol related stuff, should go into libosmocore */ +/*! \addtogroup gsm0408 + * @{ + */ -/* 10.5.5.14 GPRS MM Cause / Table 10.5.147 */ +/*! \brief 10.5.5.14 GPRS MM Cause / Table 10.5.147 */ const struct value_string gsm48_gmm_cause_names_[] = { { GMM_CAUSE_IMSI_UNKNOWN, "IMSI unknown in HLR" }, { GMM_CAUSE_ILLEGAL_MS, "Illegal MS" }, @@ -73,7 +75,7 @@ const struct value_string *gsm48_gmm_cause_names = gsm48_gmm_cause_names_; -/* 10.5.6.6 SM Cause / Table 10.5.157 */ +/*! \brief 10.5.6.6 SM Cause / Table 10.5.157 */ const struct value_string gsm48_gsm_cause_names_[] = { { GSM_CAUSE_OPER_DET_BARR, "Operator Determined Barring" }, { GSM_CAUSE_MBMS_CAP_INSUF, "MBMS bearer capabilities insufficient for the service" }, @@ -140,6 +142,7 @@ } } +/*! \brief String names of GMM message types */ const struct value_string gprs_msgt_gmm_names[] = { { GSM48_MT_GMM_ATTACH_REQ, "ATTACH REQUEST" }, { GSM48_MT_GMM_ATTACH_ACK, "ATTACH ACK" }, @@ -164,7 +167,7 @@ { 0, NULL } }; -/* 10.5.5.2 */ +/*! \brief String names of GPRS Attach types according to 10.5.5.2 */ const struct value_string gprs_att_t_strs_[] = { { GPRS_ATT_T_ATTACH, "GPRS attach" }, { GPRS_ATT_T_ATT_WHILE_IMSI, "GPRS attach while IMSI attached" }, @@ -174,6 +177,7 @@ const struct value_string *gprs_att_t_strs = gprs_att_t_strs_; +/*! \brief String names of GPRS Location Update Types */ const struct value_string gprs_upd_t_strs_[] = { { GPRS_UPD_T_RA, "RA updating" }, { GPRS_UPD_T_RA_LA, "combined RA/LA updating" }, @@ -184,7 +188,7 @@ const struct value_string *gprs_upd_t_strs = gprs_upd_t_strs_; -/* 10.5.5.5 */ +/*! \brief String names of GMM MO Detach Types according to 10.5.5.5 */ const struct value_string gprs_det_t_mo_strs_[] = { { GPRS_DET_T_MO_GPRS, "GPRS detach" }, { GPRS_DET_T_MO_IMSI, "IMSI detach" }, @@ -194,6 +198,7 @@ const struct value_string *gprs_det_t_mo_strs = gprs_det_t_mo_strs_; +/*! \brief String names of GMM MT Detach Types according to 10.5.5.5 */ const struct value_string gprs_det_t_mt_strs_[] = { { GPRS_DET_T_MT_REATT_REQ, "re-attach required" }, { GPRS_DET_T_MT_REATT_NOTREQ, "re-attach not required" }, @@ -203,6 +208,7 @@ const struct value_string *gprs_det_t_mt_strs = gprs_det_t_mt_strs_; +/*! \brief String names of GMM Service Types */ const struct value_string gprs_service_t_strs_[] = { { GPRS_SERVICE_T_SIGNALLING, "signalling" }, { GPRS_SERVICE_T_DATA, "data" }, @@ -213,3 +219,5 @@ }; const struct value_string *gprs_service_t_strs = gprs_service_t_strs_; + +/*! @} */ diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index d16adf7..9cb5df6 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -134,7 +134,10 @@ return -1; } -/* Compute the number of octets from the number of septets, for instance: 47 septets needs 41,125 = 42 octets */ +/*! \brife Compute number of octets from number of septets, + * for instance: 47 septets needs 41,125 = 42 octets + * \param[in sept_len Number of Septets + * \returns Number of octets required */ uint8_t gsm_get_octet_len(const uint8_t sept_len){ int octet_len = (sept_len * 7) / 8; if ((sept_len * 7) % 8 != 0) @@ -143,7 +146,13 @@ return octet_len; } -/* GSM 03.38 6.2.1 Character unpacking */ +/*! \brief TS 03.38 7-bit Character unpacking (6.2.1) + * \param[out] text Caller-provided output text buffer + * \param[in] n Length of \a text + * \param[in] user_data Input Data (septets) + * \param[in] septet_l Number of septets in \a user_data + * \param[in] ud_hdr_ind User Data Header present in data + * \returns number of bytes written to \a text */ int gsm_7bit_decode_n_hdr(char *text, size_t n, const uint8_t *user_data, uint8_t septet_l, uint8_t ud_hdr_ind) { unsigned shift = 0; @@ -201,11 +210,13 @@ return text - text_buf_begin; } +/*! \brief Decode 7bit GSM Alphabet */ int gsm_7bit_decode_n(char *text, size_t n, const uint8_t *user_data, uint8_t septet_l) { return gsm_7bit_decode_n_hdr(text, n, user_data, septet_l, 0); } +/*! \brief Decode 7bit GSM Alphabet (USSD) */ int gsm_7bit_decode_n_ussd(char *text, size_t n, const uint8_t *user_data, uint8_t length) { int nchars; @@ -218,7 +229,15 @@ return nchars; } -/* GSM 03.38 6.2.1 Prepare character packing */ +/*! \brief Encode a ASCII characterrs as 7-bit GSM alphabet (TS 03.38) + * + * This function converts a zero-terminated input string \a data from + * ASCII into octet-aligned 7-bit GSM characters. No packing is + * performed. + * + * \param[out] result caller-allocated output buffer + * \param[in] data input data, ASCII + * \returns number of octets used in \a result */ int gsm_septet_encode(uint8_t *result, const char *data) { int i, y = 0; @@ -247,7 +266,12 @@ return y; } -/* 7bit to octet packing */ +/*! \brief GSM Default Alphabet 7bit to octet packing + * \param[out] result Caller-provided output buffer + * \param[in] rdata Input data septets + * \param[in] septet_len Length of \a rdata + * \param[in] padding padding bits at start + * \returns number of bytes used in \a result */ int gsm_septets2octets(uint8_t *result, const uint8_t *rdata, uint8_t septet_len, uint8_t padding) { int i = 0, z = 0; @@ -293,7 +317,12 @@ return z; } -/* GSM 03.38 6.2.1 Character packing */ +/*! \brief GSM 7-bit alphabet TS 03.38 6.2.1 Character packing + * \param[out] result Caller-provided output buffer + * \param[in] n Maximum length of \a result in bytes + * \param[in] data octet-aligned string + * \param[out] octets Number of octets encoded + * \returns number of septets encoded */ int gsm_7bit_encode_n(uint8_t *result, size_t n, const char *data, int *octets) { int y = 0; @@ -332,6 +361,12 @@ return y; } +/*! \brief Encode according to GSM 7-bit alphabet (TS 03.38 6.2.1) for USSD + * \param[out] result Caller-provided output buffer + * \param[in] n Maximum length of \a result in bytes + * \param[in] data octet-aligned string + * \param[out] octets Number of octets encoded + * \returns number of septets encoded */ int gsm_7bit_encode_n_ussd(uint8_t *result, size_t n, const char *data, int *octets) { int y; @@ -368,7 +403,10 @@ return 3; } -/* convert power class to dBm according to GSM TS 05.05 */ +/*! \brief Convert power class to dBm according to GSM TS 05.05 + * \param[in] band GSM frequency band + * \param[in] class GSM power class + * \returns maximum transmit power of power class in dBm */ unsigned int ms_class_gmsk_dbm(enum gsm_band band, int class) { switch (band) { @@ -409,8 +447,11 @@ return -EINVAL; } -/* determine power control level for given dBm value, as indicated - * by the tables in chapter 4.1.1 of GSM TS 05.05 */ +/*! \brief determine power control level for given dBm value, as indicated + * by the tables in chapter 4.1.1 of GSM TS 05.05 + * \param[in] GSM frequency band + * \param[in] dbm RF power value in dBm + * \returns TS 05.05 power control level */ int ms_pwr_ctl_lvl(enum gsm_band band, unsigned int dbm) { switch (band) { @@ -459,6 +500,10 @@ return -EINVAL; } +/*! \brief Convert TS 05.05 power level to absolute dBm value + * \param[in] band GSM frequency band + * \param[in] lvl TS 05.05 power control level + * \returns RF power level in dBm */ int ms_pwr_dbm(enum gsm_band band, uint8_t lvl) { lvl &= 0x1f; @@ -497,7 +542,9 @@ return -EINVAL; } -/* According to TS 05.08 Chapter 8.1.4 */ +/*! \brief Convert TS 05.08 RxLev to dBm (TS 05.08 Chapter 8.1.4) + * \param[in] rxlev TS 05.08 RxLev value + * \returns Received RF power in dBm */ int rxlev2dbm(uint8_t rxlev) { if (rxlev > 63) @@ -506,7 +553,9 @@ return -110 + rxlev; } -/* According to TS 05.08 Chapter 8.1.4 */ +/*! \brief Convert RF signal level in dBm to TS 05.08 RxLev (TS 05.08 Chapter 8.1.4) + * \param[in] dbm RF signal level in dBm + * \returns TS 05.08 RxLev value */ uint8_t dbm2rxlev(int dbm) { int rxlev = dbm + 110; @@ -519,6 +568,7 @@ return rxlev; } +/*! \brief Return string name of a given GSM Band */ const char *gsm_band_name(enum gsm_band band) { switch (band) { @@ -542,6 +592,7 @@ return "invalid"; } +/*! \brief Parse string name of a GSM band */ enum gsm_band gsm_band_parse(const char* mhz) { while (*mhz && !isdigit(*mhz)) @@ -572,6 +623,10 @@ } } +/*! \brief Resolve GSM band from ARFCN + * In Osmocom, we use the highest bit of the \a arfcn to indicate PCS + * \param[in] arfcn Osmocom ARFCN, highest bit determines PCS mode + * \returns GSM Band */ enum gsm_band gsm_arfcn2band(uint16_t arfcn) { int is_pcs = arfcn & ARFCN_PCS; @@ -621,7 +676,10 @@ { /* Guard */ } }; -/* Convert an ARFCN to the frequency in MHz * 10 */ +/*! \brief Convert an ARFCN to the frequency in MHz * 10 + * \param[in] arfcn GSM ARFCN to convert + * \param[in] uplink Uplink (1) or Downlink (0) frequency + * \returns Frequency in units of 1/10ths of MHz (100kHz) */ uint16_t gsm_arfcn2freq10(uint16_t arfcn, int uplink) { struct gsm_freq_range *r; @@ -645,7 +703,10 @@ return uplink ? freq10_ul : freq10_dl; } -/* Convert a Frequency in MHz * 10 to ARFCN */ +/*! \brief Convert a Frequency in MHz * 10 to ARFCN + * \param[in] freq10 Frequency in units of 1/10ths of MHz (100kHz) + * \param[in] uplink Frequency is Uplink (1) or Downlink (0) + * \returns ARFCN in case of success; 0xffff on error */ uint16_t gsm_freq102arfcn(uint16_t freq10, int uplink) { struct gsm_freq_range *r; @@ -675,6 +736,9 @@ return arfcn; } +/*! \brief Parse GSM Frame Number into struct \ref gsm_time + * \param[out] time Caller-provided memory for \ref gsm_time + * \param[in] fn GSM Frame Number */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn) { time->fn = fn; @@ -684,13 +748,18 @@ time->tc = (time->fn / 51) % 8; } +/*! \brief Encode decoded \ref gsm_time to Frame Number + * \param[in] time GSM Time in decoded structure + * \returns GSM Frame Number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time) { /* TS 05.02 Chapter 4.3.3 TDMA frame number */ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } -/*! \brief append range1024 encoded data to bit vector */ +/*! \brief append range1024 encoded data to bit vector + * \param[out] bv Caller-provided output bit-vector + * \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); @@ -724,7 +793,7 @@ bitvec_set_uint(bv, r->w16, 6); } -/* TS 23.003 Chapter 2.6 */ +/*! \brief Determine GPRS TLLI Type (TS 23.003 Chapter 2.6) */ int gprs_tlli_type(uint32_t tlli) { if ((tlli & 0xc0000000) == 0xc0000000) @@ -743,6 +812,10 @@ return TLLI_RESERVED; } +/*! \brief Determine TLLI from P-TMSI + * \param[in] p_tmsi P-TMSI + * \param[in] type TLLI Type we want to derive from \a p_tmsi + * \returns TLLI of given type */ uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type) { uint32_t tlli; diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index a813ed8..3cac201 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -31,6 +31,11 @@ #include +/*! \addtogroup gsup + * @{ + * \brief Osmocom Generic Subscriber Update Protocol + */ + const struct value_string osmo_gsup_message_type_names[] = { OSMO_VALUE_STRING(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST), OSMO_VALUE_STRING(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR), @@ -536,3 +541,5 @@ msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn); } } + +/*! @} */ diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index fa6a8b0..5c37d64 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -41,6 +41,11 @@ #include #include +/*! \addtogroup ipa + * @{ + * \brief IPA Multiplex utility routines + */ + #define IPA_ALLOC_SIZE 1200 /* @@ -581,3 +586,5 @@ return NULL; return nmsg; } + +/*! @} */ diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 310df65..b7a9539 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -23,6 +23,7 @@ /*! \addtogroup lapd * @{ + * \brief Osmocom LAPD core, used for Q.921, LAPDm and others */ /*! \file lapd_core.c */ diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 99099d1..8ec942f 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -23,6 +23,7 @@ /*! \addtogroup lapdm * @{ + * \brief GSM LAPDm (TS 04.06) implementation */ /*! \file lapdm.c */ diff --git a/src/gsm/oap.c b/src/gsm/oap.c index 1494a6a..5706e8f 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -28,6 +28,11 @@ #include +/*! \addtogroup oap + * @{ + * \brief Osmocom Authentication Protocol + */ + /*! \brief Decode OAP message data. * \param[out] oap_msg Parsed data is written to this instance. * \param[in] data Pointer to the data buffer containing the OAP message. @@ -182,3 +187,5 @@ msg->l2h = msg->data; } + +/*! @} */ diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 910e848..5bdb006 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -30,6 +30,7 @@ /*! \addtogroup rsl * @{ + * \brief GSM Radio Signalling Link (TS 08.58) */ /*! \file rsl.c */ @@ -39,7 +40,9 @@ /*! \brief Headroom size for RSL \ref msgb_alloc */ #define RSL_ALLOC_HEADROOM 56 -/*! \brief Initialize a RSL RLL header */ +/*! \brief Initialize a RSL RLL header + * \param[out] dh Caller-allocated RSL RLL header + * \param[in] msg_type Message Type */ void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type) { dh->c.msg_discr = ABIS_RSL_MDISC_RLL; @@ -48,7 +51,9 @@ dh->ie_link_id = RSL_IE_LINK_IDENT; } -/*! \brief Initialize a RSL Common Channel header */ +/*! \brief Initialize a RSL Common Channel header + * \param[out] ch Caller-allocated RSL Common Channel Header + * \param[in] msg_type Message Type */ void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type) { ch->c.msg_discr = ABIS_RSL_MDISC_COM_CHAN; @@ -137,7 +142,11 @@ }, }; -/*! \brief Encode channel number as per Section 9.3.1 */ +/*! \brief Encode channel number as per Section 9.3.1 + * \param[in] Channel Type (RSL_CHAN_...) + * \param[in] subch Sub-Channel within Channel + * \param[in] timeslot Air interface timeslot + * \returns RSL Channel Number (TS 08.58 9.3.1) */ uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot) { uint8_t ret; @@ -455,7 +464,12 @@ } } -/*! \brief Push a RSL RLL header onto an existing msgb */ +/*! \brief Push a RSL RLL header onto an existing msgb + * \param msg Message Buffer to which RLL header shall be pushed + * \param[in] msg_type RSL Message Type + * \param[in] chan_nr RSL Channel Number + * \param[in] link_id RSL Link Identifier + * \param[in] transparent Transparent to BTS (1) or not (0) */ void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent) { @@ -472,7 +486,12 @@ msg->l2h = (uint8_t *)rh; } -/*! \brief Push a RSL RLL header with L3_INFO IE */ +/*! \brief Wrap msgb in L3 Info IE and push a RSL RLL header + * \param[in] msg Message Buffer to which L3 Header shall be appended + * \param[in] msg_type RSL Message Type + * \param[in] chan_hr RSL Channel Number + * \param[in] link_id Link Identififer + * \param[in] transparent Transparent to BTS (1) or not (0) */ void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent) { @@ -488,7 +507,12 @@ rsl_rll_push_hdr(msg, msg_type, chan_nr, link_id, transparent); } -/*! \brief Create msgb with RSL RLL header */ +/*! \brief Create msgb with RSL RLL header + * \param[in] msg_type RSL Message Type + * \param[in] chan_nr RSL Channel Number + * \param[in] link_id RSL Link Identifier + * \param[in] transparent Transparent to BTS (1) or not (0) + * \returns callee-allocated msgb; NULL on error */ struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent) { @@ -515,6 +539,7 @@ return msg; } +/*! \brief TLV parser definitions for IPA embedded IEs */ const struct tlv_definition rsl_ipac_eie_tlvdef = { .def = { [RSL_IPAC_EIE_RXLEV] = { TLV_TYPE_TV }, @@ -541,6 +566,7 @@ }, }; +/*! \brief String names of RSL Channel Activation Types */ const struct value_string rsl_act_type_names[] = { { RSL_ACT_TYPE_INITIAL, "INITIAL" }, { RSL_ACT_TYPE_REACT, "REACT" }, diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index 4cc43f6..d7604c6 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -25,7 +25,22 @@ /*! \addtogroup tlv * @{ + * \brief Osmocom TLV Parser + * + * The Osmocom TLV parser is intended to operate as a low-level C + * implementation without dynamic memory allocations. Basically, it + * iterates over the IE (Information Elements) of the message and fills + * an array of pointers, indexed by the IEI (IE Identifier). The + * parser output is thus an array of pointers to the start of the + * respective IE inside the message. + * + * The TLV parser is configured by a TLV parser definition, which + * determines which if the IEIs for a given protocol are of which + * particular type. Types are e.g. TV (Tag + single byte value), Tag + + * fixed-length value, TLV with 8bit length, TLV with 16bit length, TLV + * with variable-length length field, etc. */ + /*! \file tlv_parser.c */ struct tlv_definition tvlv_att_def; @@ -262,7 +277,9 @@ return num_parsed; } -/*! \brief take a master (src) tlvdev and fill up all empty slots in 'dst' */ +/*! \brief take a master (src) tlvdev and fill up all empty slots in 'dst' + * \param dst TLV parser definition that is to be patched + * \param[in] src TLV parser definition whose content is patched into \a dst */ void tlv_def_patch(struct tlv_definition *dst, const struct tlv_definition *src) { int i; diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 74f3b48..64b54f3 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -43,6 +43,7 @@ /*! \addtogroup gsmtap * @{ + * \brief GSMTAP utility routines. Encapsulates GSM messages over UDP */ /*! \file gsmtap_util.c */ diff --git a/src/logging.c b/src/logging.c index 0d2b6da..3b3dd05 100644 --- a/src/logging.c +++ b/src/logging.c @@ -22,6 +22,7 @@ /* \addtogroup logging * @{ + * \brief libosmocore Logging sub-system */ /* \file logging.c */ diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index f37f8e7..7358bf6 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -23,7 +23,13 @@ * @{ */ -/*! \file logging_gsmtap.c */ +/*! \file logging_gsmtap.c + * \brief libosmocore log output encapsulated in GSMTAP + * + * Encapsulating the log output inside GSMTAP frames allows us to + * observer protocol traces (of Um, Abis, A or any other interface in + * the Osmocom world) with synchronous interspersed log messages. + */ #include "../config.h" diff --git a/src/logging_syslog.c b/src/logging_syslog.c index 5b0ae5f..6fe3c71 100644 --- a/src/logging_syslog.c +++ b/src/logging_syslog.c @@ -23,7 +23,9 @@ * @{ */ -/*! \file logging_syslog.c */ +/*! \file logging_syslog.c + * \brief libosmocore logging output via syslog + */ #include "../config.h" diff --git a/src/loggingrb.c b/src/loggingrb.c index bd093b7..3fb38ca 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -23,7 +23,9 @@ * @{ */ -/*! \file loggingrb.c */ +/*! \file loggingrb.c + * \brief libosmocore logging backend for a ring-buffer of last log messages + */ #include #include diff --git a/src/macaddr.c b/src/macaddr.c index ceb1e0a..e5db8cf 100644 --- a/src/macaddr.c +++ b/src/macaddr.c @@ -24,7 +24,9 @@ * @{ */ -/*! \file loggingrb.c */ +/*! \file macaddr.c + * \brief MAC address utility routines + */ #include "config.h" diff --git a/src/msgb.c b/src/msgb.c index a27100c..136ad88 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -20,10 +20,35 @@ /*! \addtogroup msgb * @{ + * \brief libosmocore message buffers, inspired by Linux kernel skbuff + * + * Inspired by the 'struct skbuff' of the Linux kernel, we implement a + * 'struct msgb' which we use for handling network + * packets aka messages aka PDUs. + * + * A msgb consists of + * * a header with some metadata, such as + * * a linked list header for message queues or the like + * * pointers to the headers of various protocol layers inside + * the packet + * * a data section consisting of + * * headroom, i.e. space in front of the message, to allow + * for additional headers being pushed in front of the current + * data + * * the curently occupied data for the message + * * tailroom, i.e. space at the end of the message, to + * allow more data to be added after the end of the current + * data + * + * We have plenty of utility functions around the \ref msgb: + * * allocation / release + * * enqueue / dequeue from/to message queues + * * prepending (pushing) and appending (putting) data + * * copying / resizing + * * hex-dumping to a string for debug purposes */ -/*! \file msgb.c - */ +/*! \file msgb.c */ #include #include diff --git a/src/plugin.c b/src/plugin.c index 52887ac..71df88b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -20,6 +20,10 @@ * */ +/*! \addtogroup utils + * @{ + */ + /*! \file plugin.c * \brief Routines for loading and managing shared library plug-ins. */ @@ -69,3 +73,5 @@ return 0; } #endif /* HAVE_DLFCN_H */ + +/*! @} */ diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 3ccd065..47067fb 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -22,6 +22,7 @@ /*! \addtogroup rate_ctr * @{ + * \brief conters about events and their event rates */ /*! \file rate_ctr.c */ diff --git a/src/select.c b/src/select.c index afc8198..bdd53b2 100644 --- a/src/select.c +++ b/src/select.c @@ -36,11 +36,10 @@ /*! \addtogroup select * @{ + * \brief select() loop abstraction */ -/*! \file select.c - * \brief select loop abstraction - */ +/*! \file select.c */ static int maxfd = 0; static LLIST_HEAD(osmo_fds); diff --git a/src/sercomm.c b/src/sercomm.c index 2f693ef..33d4853 100644 --- a/src/sercomm.c +++ b/src/sercomm.c @@ -22,6 +22,7 @@ /*! \addtogroup sercomm * @{ + * \brief Serial communications layer, based on HDLC */ /*! \file sercomm.c diff --git a/src/serial.c b/src/serial.c index 05bdc86..51a32bb 100644 --- a/src/serial.c +++ b/src/serial.c @@ -24,11 +24,10 @@ /*! \addtogroup serial * @{ + * \brief Osmocom serial port helpers */ -/*! \file serial.c - * Osmocom serial port helpers - */ +/*! \file serial.c */ #include #include diff --git a/src/signal.c b/src/signal.c index 8402591..1d11617 100644 --- a/src/signal.c +++ b/src/signal.c @@ -27,7 +27,9 @@ /*! \addtogroup signal * @{ + * \brief Generic signalling/notification infrastructure */ + /*! \file signal.c */ diff --git a/src/socket.c b/src/socket.c index 9d22d61..6fa05a8 100644 --- a/src/socket.c +++ b/src/socket.c @@ -23,12 +23,11 @@ /*! \addtogroup socket * @{ - */ - -/*! \file socket.c * \brief Osmocom socket convenience functions */ +/*! \file socket.c */ + #ifdef HAVE_SYS_SOCKET_H #include diff --git a/src/strrb.c b/src/strrb.c index 069a699..69c4dda 100644 --- a/src/strrb.c +++ b/src/strrb.c @@ -21,6 +21,10 @@ * */ +/*! \addtogroup utils + * @{ + */ + /*! \file strrb.c * \brief Lossy string ringbuffer for logging; keeps newest messages. */ @@ -170,3 +174,5 @@ } return ret; } + +/*! @} */ diff --git a/src/timer.c b/src/timer.c index a8cd42b..72176b8 100644 --- a/src/timer.c +++ b/src/timer.c @@ -26,10 +26,10 @@ /*! \addtogroup timer * @{ + * \brief Osmocom timer abstraction; modelled after linux kernel timers */ -/*! \file timer.c - */ +/*! \file timer.c */ #include #include diff --git a/src/utils.c b/src/utils.c index 1a4aab4..e7c6bcf 100644 --- a/src/utils.c +++ b/src/utils.c @@ -33,6 +33,7 @@ /*! \addtogroup utils * @{ + * \brief various utility routines */ /*! \file utils.c */ diff --git a/src/vty/command.c b/src/vty/command.c index 587bd62..e50706e 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -42,7 +42,8 @@ #include /*! \addtogroup command - * @{ + * @{ + * \brief VTY command handling */ /*! \file command.c */ diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index 422de9d..3824fe8 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -33,6 +33,16 @@ #include #include +/*! \addtogroup fsm + * @{ + * \brief VTY interface for Osmocom FSM + * + * This is code implementing generic VTY access to Osmocom FSMs from + * libosmocore. This means that any application can expose all state + * of all instances of all registered FSM classes by calling a single + * command during startup: \ref osmo_fsm_vty_add_cmds + */ + /* we don't want to add this to a public header file; this is simply * exported by libosmocore and used by libmsomvty but not for public * consumption. */ @@ -175,3 +185,5 @@ 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 7ec212e..8c8a323 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -39,6 +39,16 @@ #define LOG_STR "Configure logging sub-system\n" +/*! \addtogroup logging + * @{ + * \brief 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, ... + */ + extern const struct log_info *osmo_log_info; static void _vty_output(struct log_target *tgt, @@ -778,3 +788,5 @@ #endif install_element(CONFIG_NODE, &cfg_log_gsmtap_cmd); } + +/* @} */ diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index c03546b..af69289 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -41,6 +41,11 @@ #define SHOW_STATS_STR "Show statistical values\n" +/*! \addtogroup stats + * @{ + * \brief VTY interface for statsd / statistic items + */ + /* containing version info */ extern struct host host; @@ -571,6 +576,10 @@ return 1; } +/*! \brief Add stats related commands to the VTY + * Call this once during your application initialization if you would + * like to have stats VTY commands enabled. + */ void osmo_stats_vty_add_cmds() { install_element_ve(&show_stats_cmd); @@ -599,3 +608,5 @@ install_element_ve(&show_stats_asciidoc_table_cmd); } + +/*! @} */ diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index 218f9ab..d53881a 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -38,6 +38,12 @@ /*! \addtogroup telnet_interface * @{ + * \brief Telnet interface towards Osmocom VTY + * + * This module contains the code implementing a telnet server for VTY + * access. This telnet server gets linked into each libosmovty-using + * process in order to enable interactive command-line introspection, + * interaction and configuration. */ /*! \file telnet_interface.c */ diff --git a/src/vty/utils.c b/src/vty/utils.c index 27c1a85..6772593 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -82,6 +82,33 @@ rate_ctr_for_each_counter(ctrg, rate_ctr_handler, &vctx); } +static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *vctx_) +{ + struct vty_out_context *vctx = vctx_; + struct vty *vty = vctx->vty; + + if (ctrg->desc->class_id > vctx->max_level) + return 0; + + if (ctrg->idx) + vty_out(vty, "%s%s (%d):%s", vctx->prefix, + ctrg->desc->group_description, ctrg->idx, VTY_NEWLINE); + else + vty_out(vty, "%s%s:%s", vctx->prefix, + ctrg->desc->group_description, VTY_NEWLINE); + + rate_ctr_for_each_counter(ctrg, rate_ctr_handler, vctx); + + return 0; +} + +/*! @} */ + + +/*! \addtogroup stats + * @{ + */ + static int osmo_stat_item_handler( struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *vctx_) { @@ -135,25 +162,11 @@ return 0; } -static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *vctx_) -{ - struct vty_out_context *vctx = vctx_; - struct vty *vty = vctx->vty; +/*! @} */ - if (ctrg->desc->class_id > vctx->max_level) - return 0; - - if (ctrg->idx) - vty_out(vty, "%s%s (%d):%s", vctx->prefix, - ctrg->desc->group_description, ctrg->idx, VTY_NEWLINE); - else - vty_out(vty, "%s%s:%s", vctx->prefix, - ctrg->desc->group_description, VTY_NEWLINE); - - rate_ctr_for_each_counter(ctrg, rate_ctr_handler, vctx); - - return 0; -} +/*! \addtogroup vty + * @{ + */ static int handle_counter(struct osmo_counter *counter, void *vctx_) { @@ -238,6 +251,5 @@ str[size-1] = '\0'; return str; } - /*! @} */ diff --git a/src/vty/vector.c b/src/vty/vector.c index c5a99af..b95e15c 100644 --- a/src/vty/vector.c +++ b/src/vty/vector.c @@ -27,6 +27,11 @@ #include #include +/*! \addtogroup vector + * @{ + * \brief Generic vector routines, used by VTY internally + */ + void *tall_vty_vec_ctx; /* Initialize vector : allocate memory and return vector. */ @@ -190,3 +195,5 @@ return count; } + +/*! @} */ diff --git a/src/vty/vty.c b/src/vty/vty.c index 01d5ec0..2ec9538 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -14,7 +14,7 @@ * routines in libosmovty are not thread-safe. If you must use them in * a multi-threaded context, you have to add your own locking. * - * libosmocovty is developed as part of the Osmocom (Open Source Mobile + * libosmovty is developed as part of the Osmocom (Open Source Mobile * Communications) project, a community-based, collaborative development * project to create Free and Open Source implementations of mobile * communications systems. For more information about Osmocom, please diff --git a/src/write_queue.c b/src/write_queue.c index c7a4320..1e4cda5 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -27,6 +27,7 @@ /*! \addtogroup write_queue * @{ + * \brief write queue for writing \ref msgb to sockets/fd's */ /*! \file write_queue.c */ -- To view, visit https://gerrit.osmocom.org/2897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3 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 Mon Jun 12 21:56:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 21:56:17 +0000 Subject: osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jun 12 21:56:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 12 Jun 2017 21:56:21 +0000 Subject: [MERGED] osmo-pcu[master]: use tlvp_val16be() rather than manual pointer-cast + ntohs() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: use tlvp_val16be() rather than manual pointer-cast + ntohs() ...................................................................... use tlvp_val16be() rather than manual pointer-cast + ntohs() Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 2 insertions(+), 4 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_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index aeb0942..d3c8491 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -155,9 +155,8 @@ if (TLVP_PRESENT(tp, BSSGP_IE_PDU_LIFETIME)) { uint8_t lt_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME); - uint16_t *lt = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_PDU_LIFETIME); if (lt_len == 2) - delay_csec = ntohs(*lt); + delay_csec = tlvp_val16be(tp, BSSGP_IE_PDU_LIFETIME); else LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of " "PDU_LIFETIME IE\n"); @@ -169,9 +168,8 @@ if (TLVP_PRESENT(tp, BSSGP_IE_TLLI)) { uint8_t tlli_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME); - uint16_t *e_tlli_old = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_TLLI); if (tlli_len == 2) - tlli_old = ntohs(*e_tlli_old); + tlli_old = tlvp_val16be(tp, BSSGP_IE_TLLI); else LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of " "TLLI (old) IE\n"); -- To view, visit https://gerrit.osmocom.org/2875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib77cb703bb1710da396db3a939700515b5c20235 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jun 12 22:04:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 22:04:45 +0000 Subject: osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Patch Set 2: (9 comments) https://gerrit.osmocom.org/#/c/2886/2/selftest/log_test.py File selftest/log_test.py: Line 89: # some space to keep source line numbers identical to previous code > This can be dropped right? it may make sense for this review but doesn't lo it makes sense to justify why I added three blank lines. I want the regression test changes of this patch to stand alone, we can drop this line, change the whitespace and adjust line numbers in a subsequent patch. https://gerrit.osmocom.org/#/c/2886/2/selftest/suite_test.py File selftest/suite_test.py: Line 23: trial = log.Origin(None, 'trial') > worth it seeting this first param as kwargs which defaults to None? The only reason to have this None is to keep test output unchanged --> follow up patch https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 93: log_ctx = proc > Can we make this variable have a name which looks more special? otherwise a absolutely not double underscored, those are reserved for python internals. A single underscore says "please don't use directly", but we want this used. All-caps? IMHO we just have to know that log_ctx is logging context? I know it's non-pythonic in the sense of "explicit is better than implicit" ... but we can't use a set_log_ctx() function because that would not be tied to this code frame. Using 'self' is just as implicit. No underscore or different naming will change the implicit magic nature... do you have any idea how to make log_ctx more explicit and less magic? (this particular instance is straightforward, but I mean the general case of finding any 'log_ctx' in any parent scope of an exception raised) https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/ofono_client.py File src/osmo_gsm_tester/ofono_client.py: Line 123: raise RuntimeError('Modem interface is not available:', interface_name) > log.Error ? (also works with RuntimeError, but indeed for message composition, thx) Line 316: raise RuntimeError('No IMSI') > log.Error? (in this case it doesn't matter at all, but ok) https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/process.py File src/osmo_gsm_tester/process.py: Line 77: self._set_name(self.name_str, pid=self.process_obj.pid) > why have an underscore now? a single underscore says: not supposed to use it directly. The idea was that everyone should rather use the constructor to set the name. In this instance, we know the pid only later. Mostly I added the underscore to make sure I have no code left that uses the old set_name() instead of the constructor. I could change it back to no-underscore, but I thought it's good to give an incentive not to forget calling the constructor. https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 82: self.suite_run = suite_run > No need to move suite_run around in here, but not a big issue yea, I want the super()'s constructor to be called as early as possible, and self.basename is the only thing needed above it. I could remove the 'self' but want to semantically emphasize that it's the same as self.basename Line 128: def set_fail(self, fail_type, fail_message, tb_str=None, src=4): > Do we really need to pass this over here? Is it expected to be changed by c In case of reporting an exception, we want to pass the exception's src instead, in suite.py. https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/test.py File src/osmo_gsm_tester/test.py: Line 35: global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout > Missed removing them from this line too. yes, my intention was to only call print(). Of course we don't have a dbg log then. Strictly speaking this change is unrelated. -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 2 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 12 22:10:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 22:10:42 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify 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/2886 to look at the new patch set (#3). fix and refactor logging: drop 'with', simplify With the recent fix of the junit report related issues, another issue arose: the 'with log.Origin' was changed to disallow __enter__ing an object twice to fix problems, now still code would fail because it tries to do 'with' on the same object twice. The only reason is to ensure that logging is associated with a given object. Instead of complicating even more, implement differently. Refactor logging to simplify use: drop the 'with Origin' style completely, and instead use the python stack to determine which objects are created by which, and which object to associate a log statement with. The new way: we rely on the convention that each class instance has a local 'self' referencing the object instance. If we need to find an origin as a new object's parent, or to associate a log message with, we traverse each stack frame, fetching the first local 'self' object that is a log.Origin class instance. How to use: Simply call log.log() anywhere, and it finds an Origin object to log for, from the stack. Alternatively call self.log() for any Origin() object to skip the lookup. Create classes as child class of log.Origin and make sure to call super().__init__(category, name). This constructor will magically find a parent Origin on the stack. When an exception happens, we first escalate the exception up through call scopes to where ever it is handled by log.log_exn(). This then finds an Origin object in the traceback's stack frames, no need to nest in 'with' scopes. Hence the 'with log.Origin' now "happens implicitly", we can write pure natural python code, no more hassles with scope ordering. Furthermore, any frame can place additional string information in a local variable called log_ctx. This is automatically inserted in the ancestry associated with a log statement / exception. Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 --- M selftest/config_test.ok M selftest/log_test.ok M selftest/log_test.py M selftest/resource_test.ok M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test.py M selftest/template_test.ok M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/trial.py 27 files changed, 422 insertions(+), 459 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/2886/3 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 40a5dcb..80b5a06 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -54,42 +54,42 @@ --- -: ERR: ValueError: config item not known: 'a_dict[]' Validation: Error - unknown band: ---- (item='bts[].trx[].band'): ERR: ValueError: Unknown GSM band: 'what' +--- bts[].trx[].band: ERR: ValueError: Unknown GSM band: 'what' Validation: Error - invalid v4 addrs: ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '91.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '91.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: 'go away' +--- addr[]: ERR: ValueError: Invalid IPv4 address: 'go away' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: None +--- addr[]: ERR: ValueError: Invalid IPv4 address: None Validation: Error - invalid hw addrs: ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '1.2.3' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '1.2.3' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: 'go away' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: 'go away' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: None +--- hwaddr[]: ERR: ValueError: Invalid hardware address: None Validation: Error - invalid imsis: ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '99999999x9' +--- imsi[]: ERR: ValueError: Invalid IMSI: '99999999x9' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '123 456 789 123' +--- imsi[]: ERR: ValueError: Invalid IMSI: '123 456 789 123' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: 'go away' +--- imsi[]: ERR: ValueError: Invalid IMSI: 'go away' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '' +--- imsi[]: ERR: ValueError: Invalid IMSI: '' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: None +--- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error diff --git a/selftest/log_test.ok b/selftest/log_test.ok index 7ed94a0..17198b7 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -32,10 +32,9 @@ 01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110] 01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113] - Testing logging of Exceptions, tracing origins -Not throwing an exception in 'with:' works. nested print just prints -01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:145] -01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] -01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] -- Enter the same Origin context twice +01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:135] +01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:136] +01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:137: raise ValueError('bork')] +- Disallow origin loops disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 7670c8e..1b268f1 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -32,20 +32,20 @@ log.set_all_levels(None) print('- Testing global log functions') -log.log('', log.C_TST, 'from log.log()') -log.dbg('', log.C_TST, 'from log.dbg(), not seen') +log.log('from log.log()', _origin='', _category=log.C_TST) +log.dbg('from log.dbg(), not seen', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_DBG) -log.dbg('', log.C_TST, 'from log.dbg()') +log.dbg('from log.dbg()', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_LOG) -log.err('', log.C_TST, 'from log.err()') +log.err('from log.err()', _origin='', _category=log.C_TST) print('- Testing log.Origin functions') class LogTest(log.Origin): - pass + def __init__(self, *name_items, **detail_items): + super().__init__(log.C_TST, *name_items, **detail_items) -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('some', 'name', some="detail") +t = LogTest('some', 'name', some="detail") + t.log("hello log") t.err("hello err") @@ -86,27 +86,27 @@ log.style_change(origin=True) t.dbg("add origin") +# some space to keep source line numbers identical to previous code + print('- Testing origin_width') -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('shortname') +t = LogTest('shortname') log.style(origin_width=23, time_fmt=fake_time) t.log("origin str set to 23 chars") -t.set_name('very long name', some='details', and_some=(3, 'things', 'in a tuple')) +t._set_name('very long name', some='details', and_some=(3, 'things', 'in a tuple')) t.log("long origin str") t.dbg("long origin str dbg") t.err("long origin str err") + print('- Testing log.Origin with omitted info') t = LogTest() -t.set_log_category(log.C_TST) t.log("hello log, name implicit from class name") -t = LogTest() -t.set_name('explicit_name') +t = LogTest('explicit_name') +t._set_log_category(None) t.log("hello log, no category set") - t = LogTest() +t._set_log_category(None) t.log("hello log, no category nor name set") t.dbg("hello log, no category nor name set, not seen") log.set_level(log.C_DEFAULT, log.L_DBG) @@ -117,47 +117,37 @@ class Thing(log.Origin): def __init__(self, some_path): - self.set_log_category(log.C_TST) - self.set_name(some_path) + super().__init__(log.C_TST, some_path) def say(self, msg): print(msg) -#log.style_change(trace=True) + def l1(self): + level2 = Thing('level2') + level2.l2() -with Thing('print_redirected'): - print("Not throwing an exception in 'with:' works.") + def l2(self): + level3 = Thing('level3') + level3.l3(self) -def l1(): - level1 = Thing('level1') - with level1: - l2() - -def l2(): - level2 = Thing('level2') - with level2: - l3(level2) - -def l3(level2): - level3 = Thing('level3') - with level3: + def l3(self, level2): print('nested print just prints') - level3.log('nested log()') + self.log('nested log()') level2.log('nested l2 log() from within l3 scope') raise ValueError('bork') try: - l1() + level1 = Thing('level1') + level1.l1() except Exception: log.log_exn() -print('- Enter the same Origin context twice') +print('- Disallow origin loops') try: t = Thing('foo') - with t: - with t: - raise RuntimeError('this should not be reached') -except AssertionError: + t._set_parent(t) + raise RuntimeError('this should not be reached') +except log.OriginLoopError: print('disallowed successfully') pass diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index cdc3519..d366cf9 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -13,8 +13,8 @@ cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./test_work/state_dir is [PATH]/selftest/conf/test_work/state_dir cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./suite_test is [PATH]/selftest/conf/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf -cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir *** all resources: {'arfcn': [{'_hash': 'e620569450f8259b3f0212ec19c285dd07df063c', 'arfcn': '512', diff --git a/selftest/resource_test.py b/selftest/resource_test.py index c78485e..a0ec490 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -78,7 +78,7 @@ 'modem': [ { 'times': 2 } ], } -origin = log.Origin('testowner') +origin = log.Origin(None, 'testowner') resources = pool.reserve(origin, want) diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 54c950a..9d7bdad 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' +cnf [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -22,15 +22,15 @@ - times: '2' - run hello world test -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test -cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir --------------------------------------------------------------------- trial test_suite --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] +tst combining_scenarios='resources': DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?combining_scenarios='resources'] tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 @@ -83,7 +83,7 @@ trial test_suite test_error.py ---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]: assert False] tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -92,7 +92,7 @@ skip: hello_world.py (N.N sec) skip: mo_mt_sms.py skip: mo_sms.py - FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False skip: test_fail.py skip: test_fail_raise.py @@ -106,7 +106,7 @@ trial test_suite test_fail.py ---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -128,7 +128,7 @@ ---------------------------------------------- trial test_suite test_fail_raise.py ---------------------------------------------- -tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]: raise ExpectedFail('This failure is expected')] tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -139,6 +139,6 @@ skip: mo_sms.py skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) - FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected - graceful exit. diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 2a92f47..86c4c25 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,7 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -trial = log.Origin('trial') +trial = log.Origin(log.C_TST, 'trial') s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) diff --git a/selftest/template_test.ok b/selftest/template_test.ok index d031c96..1267dac 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -1,5 +1,5 @@ - Testing: fill a config file with values -cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl [osmo-nitb.cfg.tmpl?Templates] +cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl ! Configuration rendered by osmo-gsm-tester password foo ! diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 0083512..7d12c85 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -36,10 +36,9 @@ CONF_BTS_TRX = 'osmo-bts-trx.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX) self.suite_run = suite_run self.conf = conf - self.set_name(OsmoBtsTrx.BIN_BTS_TRX) - self.set_log_category(log.C_RUN) self.env = {} def remote_addr(self): diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 5f2b3cb..a771ec4 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -35,52 +35,50 @@ BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, self.BTS_SYSMO_BIN) self.suite_run = suite_run self.conf = conf - self.set_name('osmo-bts-sysmo') - self.set_log_category(log.C_RUN) self.remote_env = {} self.remote_user = 'root' def start(self): - with self: - if self.bsc is None: - raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') - self.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) - self.configure() + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') + log.log('Starting sysmoBTS to connect to', self.bsc) + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) - lib = self.inst.child('lib') - if not os.path.isdir(lib): - self.raise_exn('No lib/ in', self.inst) - if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): - self.raise_exn('No osmo-bts-sysmo binary in', self.inst) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) + lib = self.inst.child('lib') + if not os.path.isdir(lib): + raise log.Error('No lib/ in', self.inst) + if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): + raise log.Error('No osmo-bts-sysmo binary in', self.inst) - self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) - self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) + self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) + self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) - self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) - self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) - self.run_local('scp-inst-to-sysmobts', - ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) + self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) + self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) + self.run_local('scp-inst-to-sysmobts', + ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) - remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) - self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) + remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) + self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) - remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) - self.run_local('scp-cfg-to-sysmobts', - ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) + remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) + self.run_local('scp-cfg-to-sysmobts', + ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) - self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) + self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) - remote_lib = self.remote_inst.child('lib') - remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') - self.launch_remote('osmo-bts-sysmo', - ('LD_LIBRARY_PATH=%s' % remote_lib, - remote_binary, '-c', remote_config_file, '-r', '1', - '-i', self.bsc.addr()), - remote_cwd=remote_run_dir) + remote_lib = self.remote_inst.child('lib') + remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') + self.launch_remote('osmo-bts-sysmo', + ('LD_LIBRARY_PATH=%s' % remote_lib, + remote_binary, '-c', remote_config_file, '-r', '1', + '-i', self.bsc.addr()), + remote_cwd=remote_run_dir) def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) @@ -92,7 +90,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log_ctx = proc + raise log.Error('Exited in error') def launch_remote(self, name, popen_args, remote_cwd=None): proc = self._process_remote(name, popen_args, remote_cwd) @@ -105,7 +104,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log_ctx = proc + raise log.Error('Exited in error') def remote_addr(self): return self.conf.get('addr') diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 38d8e2f..1efd957 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -95,7 +95,7 @@ real_l = os.path.realpath(l) p = os.path.realpath(os.path.join(real_l, basename)) if os.path.isfile(p): - log.dbg(None, log.C_CNF, 'Found config file', basename, 'as', p, 'in', l, 'which is', real_l) + log.dbg('Found config file', basename, 'as', p, 'in', l, 'which is', real_l, _category=log.C_CNF) return (p, real_l) if not fail_if_missing: return None, None @@ -122,7 +122,7 @@ env_path = os.getenv(env_name) if env_path: real_env_path = os.path.realpath(env_path) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path) + log.dbg('Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path, _category=log.C_CNF) return real_env_path if PATHS is None: @@ -132,15 +132,15 @@ for key, path in sorted(PATHS.items()): if not path.startswith(os.pathsep): PATHS[key] = os.path.realpath(os.path.join(found_in, path)) - log.dbg(None, log.C_CNF, paths_file + ': relative path', path, 'is', PATHS[key]) + log.dbg(paths_file + ': relative path', path, 'is', PATHS[key], _category=log.C_CNF) p = PATHS.get(label) if p is None and not allow_unset: raise RuntimeError('missing configuration in %s: %r' % (PATHS_CONF, label)) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', p) + log.dbg('Found path', label, 'as', p, _category=log.C_CNF) if p.startswith(PATHS_TEMPDIR_STR): p = os.path.join(get_tempdir(), p[len(PATHS_TEMPDIR_STR):]) - log.dbg(None, log.C_CNF, 'Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p) + log.dbg('Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p, _category=log.C_CNF) return p def get_state_dir(): @@ -153,20 +153,20 @@ return Dir(get_configured_path(PATH_SCENARIOS_DIR)) def read(path, validation_schema=None, if_missing_return=False): - with log.Origin(path): - if not os.path.isfile(path) and if_missing_return is not False: - return if_missing_return - with open(path, 'r') as f: - config = yaml.safe_load(f) - config = _standardize(config) - if validation_schema: - schema.validate(config, validation_schema) - return config + log_ctx = path + if not os.path.isfile(path) and if_missing_return is not False: + return if_missing_return + with open(path, 'r') as f: + config = yaml.safe_load(f) + config = _standardize(config) + if validation_schema: + schema.validate(config, validation_schema) + return config def write(path, config): - with log.Origin(path): - with open(path, 'w') as f: - f.write(tostr(config)) + log_ctx = path + with open(path, 'w') as f: + f.write(tostr(config)) def tostr(config): return _tostr(_standardize(config)) @@ -191,8 +191,7 @@ class Scenario(log.Origin, dict): def __init__(self, name, path): - self.set_name(name) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, name) self.path = path def get_scenario(name, validation_schema=None): @@ -216,8 +215,8 @@ if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - add(dest_val, val) + log_ctx = 'key=%r' % key + add(dest_val, val) return if is_list(dest): if not is_list(src): @@ -235,19 +234,19 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log_ctx = 'key=%r' % key dest_val = dest.get(key) if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - combine(dest_val, val) + combine(dest_val, val) return 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)): - with log.Origin(idx=i): - combine(dest[i], src[i]) + log_ctx = 'idx=%r' % i + combine(dest[i], src[i]) return if dest == src: return @@ -260,16 +259,16 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log_ctx = 'key=%r' % key dest_val = dest.get(key) - with log.Origin(key=key): - dest[key] = overlay(dest_val, val) + dest[key] = overlay(dest_val, val) return dest 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)): - with log.Origin(idx=i): - dest[i] = overlay(dest[i], src[i]) + log_ctx = 'key=%r' % key + dest[i] = overlay(dest[i], src[i]) return dest return src diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index c3c679b..fbf4bad 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -21,6 +21,8 @@ # A test script can thus establish its context by doing: # from osmo_gsm_tester.test import * import time +from . import log + poll_funcs = [] def register_poll_func(func): @@ -38,7 +40,8 @@ def wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): if not timeout or timeout < 0: - log_obj.raise_exn('wait() *must* time out at some point. timeout=%r' % timeout) + self = log_obj + raise log.Error('wait() *must* time out at some point.', timeout=timeout) if timestep < 0.1: timestep = 0.1 @@ -54,7 +57,8 @@ def wait(log_obj, condition, *condition_args, timeout=300, timestep=1, **condition_kwargs): if not wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): - log_obj.raise_exn('Wait timeout') + log_ctx = log_obj + raise log.Error('Wait timeout') def sleep(log_obj, seconds): assert seconds > 0. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index f098f2b..f630df9 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -45,6 +45,39 @@ C_BUS = 'bus' C_DEFAULT = '---' +def dbg(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on debug level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_DBG, src=_src) + +def log(*messages, _origin=None, _category=None, _level=L_LOG, _src=None, **named_items): + '''Log a message. The origin, an Origin class instance, is normally + determined by stack magic, only pass _origin to override. The category is + taken from the origin. _src is normally an integer indicating how many + levels up the stack sits the interesting source file to log about, can also + be a string. The log message is composed of all *messages and + **named_items, for example: + log('frobnicate:', thing, key=current_key, prop=erty) + ''' + _log(messages, named_items, origin=_origin, category=_category, level=_level, src=_src) + +def err(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on error level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_ERR, src=_src) + +def _log(messages=[], named_items={}, origin=None, category=None, level=L_LOG, src=None): + if origin is None: + origin = Origin.find_on_stack() + if category is None and isinstance(origin, Origin): + category = origin._log_category + if src is None: + # two levels up + src = 2 + if isinstance(src, int): + src = get_src_from_caller(src + 1) + for target in LogTarget.all_targets: + target.log(origin, category, level, src, messages, named_items) + + LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' DATEFMT = '%H:%M:%S' @@ -52,7 +85,8 @@ get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) class Error(Exception): - pass + def __init__(self, *messages, **named_items): + super().__init__(compose_message(messages, named_items)) class LogTarget: all_targets = [] @@ -153,7 +187,7 @@ def log(self, origin, category, level, src, messages, named_items): if category and len(category) != 3: - self.log_write_func('WARNING: INVALID LOG SUBSYSTEM %r\n' % category) + self.log_write_func('WARNING: INVALID LOGGING CATEGORY %r\n' % category) self.log_write_func('origin=%r category=%r level=%r\n' % (origin, category, level)); if not category: @@ -172,14 +206,13 @@ if self.do_log_origin: if origin is None: name = '-' - elif isinstance(origin, Origins): - name = origin[-1] - if len(origin) > 1: - deeper_origins = str(origin) + elif isinstance(origin, Origin): + name = origin.name() + # only log ancestry when there is more than one + if origin._parent is not None: + deeper_origins = origin.ancestry_str() elif isinstance(origin, str): name = origin or None - elif hasattr(origin, 'name'): - name = origin.name() if not name: name = str(origin.__class__.__name__) log_pre.append(self.origin_fmt.format(name)) @@ -228,7 +261,7 @@ def _log_all_targets(origin, category, level, src, messages, named_items=None): if origin is None: - origin = Origin._global_current_origin + origin = Origin.find_on_stack() if isinstance(src, int): src = get_src_from_caller(src + 1) for target in LogTarget.all_targets: @@ -242,13 +275,17 @@ caller = getframeinfo(stack()[levels_up][0]) return '%s:%d' % (os.path.basename(caller.filename), caller.lineno) -def get_src_from_tb(tb, levels_up=1): - ftb = traceback.extract_tb(tb) +def get_src_from_exc_info(exc_info=None, levels_up=1): + if exc_info is None: + exc_info = sys.exc_info() + ftb = traceback.extract_tb(exc_info[2]) f,l,m,c = ftb[-levels_up] f = os.path.basename(f) return '%s:%s: %s' % (f, l, c) def get_line_for_src(src_path): + '''find a given source file on the stack and return the line number for + that file. (Used to indicate the position in a test script.)''' etype, exception, tb = sys.exc_info() if tb: ftb = traceback.extract_tb(tb) @@ -262,31 +299,89 @@ return caller.lineno return None +class OriginLoopError(Error): + pass class Origin: ''' - Base class for all classes that want to log, - and to add an origin string to a code path: - with log.Origin('my name'): - raise Problem() - This will log 'my name' as an origin for the Problem. + Base class for all classes that want to appear in the log. + It is a simple named marker to find in the stack frames. + This depends on the object instance named 'self' in each member class. + + In addition, it provides a logging category and a globally unique ID for + each instance. ''' - _global_current_origin = None _global_id = None - _log_category = None - _src = None _name = None _origin_id = None + _log_category = None + _parent = None - _parent_origin = None + @staticmethod + def find_on_stack(except_obj=None, f=None): + if f is None: + f = sys._getframe(1) + log_ctx_obj = None + origin = None + while f is not None: + l = f.f_locals - def __init__(self, *name_items, category=None, **detail_items): - self.set_log_category(category) - self.set_name(*name_items, **detail_items) + # if there is a log_ctx in the scope, add it, pointing to the next + # actual Origin class in the stack + log_ctx = l.get('log_ctx') + if log_ctx: + if isinstance(log_ctx, Origin): + new_log_ctx_obj = log_ctx + else: + new_log_ctx_obj = Origin(None, log_ctx, find_parent=False) + if log_ctx_obj is None: + log_ctx_obj = new_log_ctx_obj + else: + log_ctx_obj.highest_ancestor()._set_parent(new_log_ctx_obj) - def set_name(self, *name_items, **detail_items): + obj = l.get('self') + if obj and isinstance(obj, Origin) and (except_obj is not obj): + origin = obj + break + f = f.f_back + + if (origin is not None) and (log_ctx_obj is not None): + log_ctx_obj.highest_ancestor()._set_parent(origin) + p = log_ctx_obj + while p: + p._set_log_category(origin._log_category) + p = p._parent + if log_ctx_obj is not None: + return log_ctx_obj + # may return None + return origin + + @staticmethod + def find_in_exc_info(exc_info): + tb = exc_info[2] + # get last tb ... I hope that's right + while tb.tb_next: + tb = tb.tb_next + return Origin.find_on_stack(f=tb.tb_frame) + + def __init__(self, category, *name_items, find_parent=True, **detail_items): + self._set_log_category(category) + self._set_name(*name_items, **detail_items) + if find_parent: + self._set_parent(Origin.find_on_stack(except_obj=self)) + + def _set_parent(self, parent): + # make sure to avoid loops + p = parent + while p: + if p is self: + raise OriginLoopError('Origin parent loop') + p = p._parent + self._parent = parent + + def _set_name(self, *name_items, **detail_items): if name_items: name = '-'.join([str(i) for i in name_items]) elif not detail_items: @@ -313,87 +408,43 @@ self._origin_id = '%s-%s' % (self.name(), Origin._global_id) return self._origin_id - def set_log_category(self, category): + def _set_log_category(self, category): self._log_category = category - - def _log(self, level, messages, named_items=None, src_levels_up=3, origins=None): - src = self._src or src_levels_up - origin = origins or self.gather_origins() - _log_all_targets(origin, self._log_category, level, src, messages, named_items) - - def dbg(self, *messages, **named_items): - self._log(L_DBG, messages, named_items) - - def log(self, *messages, **named_items): - self._log(L_LOG, messages, named_items) - - def err(self, *messages, **named_items): - self._log(L_ERR, messages, named_items) - - def trace(self, *messages, **named_items): - self._log(L_TRACEBACK, messages, named_items) - - def log_exn(self, exc_info=None): - log_exn(self, self._log_category, exc_info) - - def __enter__(self): - if not self.set_child_of(Origin._global_current_origin): - return self - Origin._global_current_origin = self - return self - - def __exit__(self, *exc_info): - rc = None - if exc_info[0] is not None: - rc = exn_add_info(exc_info, self) - Origin._global_current_origin, self._parent_origin = self._parent_origin, None - return rc - - def raise_exn(self, *messages, exn_class=Error, **named_items): - with self: - raise exn_class(compose_message(messages, named_items)) def redirect_stdout(self): return contextlib.redirect_stdout(SafeRedirectStdout(self)) - def gather_origins(self): - origins = Origins() - # this object shall always be seen as the immediate origin of the log message. - origins.add(self) - # now go through the parents of this object. - origin = self._parent_origin - # but if this object is "loose" and not set up with cascaded 'with' statements, - # take the last seen 'with' statement's object as next parent: - if origin is None and Origin._global_current_origin is not None: - origin = Origin._global_current_origin - # if this object is currently the _global_current_origin, we don't - # need to add it twice. - if origin is self: - origin = origin._parent_origin - # whichever we determined to be the parent above, go up through all its - # ancestors. - while origin is not None: - origins.add(origin) - origin = origin._parent_origin + def ancestry(self): + origins = [] + n = 10 + origin = self + while origin: + origins.insert(0, origin) + origin = origin._parent + n -= 1 + if n < 0: + break return origins - def set_child_of(self, parent_origin): - # avoid loops - assert self._parent_origin is None - assert parent_origin is not self - self._parent_origin = parent_origin - return True + def ancestry_str(self): + return '?'.join([o.name() for o in self.ancestry()]) -class LineInfo(Origin): - def __init__(self, src_file, *name_items, **detail_items): - self.src_file = src_file - self.set_name(*name_items, **detail_items) + def highest_ancestor(self): + if self._parent: + return self._parent.highest_ancestor() + return self - def name(self): - l = get_line_for_src(self.src_file) - if l is not None: - return '%s:%s' % (self._name, l) - return super().name() + def log(self, *messages, _src=3, **named_items): + '''same as log.log() but passes this object to skip looking up an origin''' + log(*messages, _origin=self, _src=_src, **named_items) + + def dbg(self, *messages, _src=3, **named_items): + '''same as log.dbg() but passes this object to skip looking up an origin''' + dbg(*messages, _origin=self, _src=_src, **named_items) + + def err(self, *messages, _src=3, **named_items): + '''same as log.err() but passes this object to skip looking up an origin''' + err(*messages, _origin=self, _src=_src, **named_items) class SafeRedirectStdout: ''' @@ -407,7 +458,7 @@ _log_line_buf = None def __init__(self, origin): - self._origin = origin + self.origin = origin def write(self, message): lines = message.splitlines() @@ -419,93 +470,34 @@ if not message.endswith('\n'): self._log_line_buf = lines[-1] lines = lines[:-1] - origins = self._origin.gather_origins() for line in lines: - self._origin._log(L_LOG, (line,), origins=origins) + _log(messages=(line,), + origin=self.origin, level=L_LOG, src=2) def __getattr__(self, name): return sys.__stdout__.__getattribute__(name) - -def dbg(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_DBG, 2, messages, named_items) - -def log(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_LOG, 2, messages, named_items) - -def err(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_ERR, 2, messages, named_items) - -def trace(origin, category, exc_info): - _log_all_targets(origin, category, L_TRACEBACK, None, - traceback.format_exception(*exc_info)) - -def resolve_category(origin, category): - if category is not None: - return category - if not hasattr(origin, '_log_category'): - return None - return origin._log_category - -def exn_add_info(exc_info, origin, category=None): - etype, exception, tb = exc_info - if not hasattr(exception, 'origins'): - exception.origins = Origins() - if not hasattr(exception, 'category'): - # only remember the deepest category - exception.category = resolve_category(origin, category) - if not hasattr(exception, 'src'): - exception.src = get_src_from_tb(tb) - exception.origins.add(origin) - return False - -def log_exn(origin=None, category=None, exc_info=None): - if not (exc_info is not None and len(exc_info) == 3): +def trace(exc_info=None, origin=None): + if exc_info is None: exc_info = sys.exc_info() - if not (exc_info is not None and len(exc_info) == 3): - raise RuntimeError('invalid call to log_exn() -- no valid exception info') + if origin is None: + origin = Origin.find_in_exc_info(exc_info) + _log(messages=traceback.format_exception(*exc_info), + origin=origin, level=L_TRACEBACK) + +def log_exn(): + exc_info = sys.exc_info() + origin = Origin.find_in_exc_info(exc_info) etype, exception, tb = exc_info - - # if there are origins recorded with the Exception, prefer that - if hasattr(exception, 'origins'): - origin = exception.origins - - # if there is a category recorded with the Exception, prefer that - if hasattr(exception, 'category'): - category = exception.category - if hasattr(exception, 'msg'): msg = exception.msg else: msg = str(exception) - if hasattr(exception, 'src'): - src = exception.src - else: - src = 2 - - trace(origin, category, exc_info) - _log_all_targets(origin, category, L_ERR, src, - ('%s:' % str(etype.__name__), msg)) - - -class Origins(list): - def __init__(self, origin=None): - if origin is not None: - self.add(origin) - - def add(self, origin): - if hasattr(origin, 'name'): - origin_str = origin.name() - else: - origin_str = repr(origin) - if origin_str is None: - raise RuntimeError('origin_str is None for %r' % origin) - self.insert(0, origin_str) - - def __str__(self): - return '?'.join(self) + trace(exc_info, origin=origin) + _log(messages=('%s:' % str(etype.__name__), msg), + origin=origin, level=L_ERR, src=get_src_from_exc_info(exc_info)) def set_all_levels(level): diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index fc9bba4..67659e1 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -139,12 +139,14 @@ Related: https://github.com/LEW21/pydbus/issues/56 ''' + modem_path = None + watch_props_subscription = None + _dbus_obj = None + interfaces = None + def __init__(self, modem_path): self.modem_path = modem_path - self.set_name(self.modem_path) - self.set_log_category(log.C_BUS) - self.watch_props_subscription = None - self._dbus_obj = None + super().__init__(log.C_BUS, self.modem_path) self.interfaces = set() # A dict listing signal handlers to connect, e.g. @@ -175,7 +177,7 @@ try: return self.dbus_obj()[interface_name] except KeyError: - self.raise_exn('Modem interface is not available:', interface_name) + raise log.Error('Modem interface is not available:', interface_name) def signal(self, interface_name, signal): return getattr(self.interface(interface_name), signal) @@ -310,8 +312,7 @@ def __init__(self, conf): self.conf = conf self.path = conf.get('path') - self.set_name(self.path) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, self.path) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 @@ -371,8 +372,7 @@ def imsi(self): imsi = self.conf.get('imsi') if not imsi: - with self: - raise RuntimeError('No IMSI') + raise log.Error('No IMSI') return imsi def ki(self): diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 7753395..5447118 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -31,10 +31,9 @@ bts = None def __init__(self, suite_run, msc, ip_address): + super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-bsc_%s' % ip_address.get('addr')) self.bts = [] self.msc = msc diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 0b717fa..b5a947f 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -29,8 +29,7 @@ class OsmoCtrl(log.Origin): def __init__(self, host, port): - self.set_name('Ctrl', host=host, port=port) - self.set_log_category(log.C_BUS) + super().__init__(log.C_BUS, 'Ctrl', host=host, port=port) self.host = host self.port = port self.sck = None @@ -79,12 +78,10 @@ self._send(getmsg) def __enter__(self): - super().__enter__() self.connect() return self def __exit__(self, *exc_info): self.disconnect() - super().__exit__(*exc_info) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 3492f06..14505db 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -32,10 +32,9 @@ next_subscriber_id = 1 def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-hlr_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -47,16 +46,16 @@ binary = inst.child('bin', 'osmo-hlr') if not os.path.isfile(binary): - self.raise_exn('Binary missing:', binary) + raise log.Error('Binary missing:', binary) lib = inst.child('lib') if not os.path.isdir(lib): - self.raise_exn('No lib/ in', inst) + raise log.Error('No lib/ in', inst) # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') if not os.path.isfile(sql_input): - self.raise_exn('hlr.sql missing:', sql_input) + raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) iface = util.ip_to_iface(self.addr()) @@ -96,13 +95,13 @@ return not self.process.terminated() def run_local(self, name, popen_args): - with self: - run_dir = self.run_dir.new_dir(name) - proc = process.Process(name, run_dir, popen_args) - proc.launch() - proc.wait() - if proc.result != 0: - proc.raise_exn('Exited in error') + run_dir = self.run_dir.new_dir(name) + proc = process.Process(name, run_dir, popen_args) + proc.launch() + proc.wait() + if proc.result != 0: + log_ctx = proc + raise log.Error('Exited in error') def run_sql_file(self, name, sql_file): self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 3e722fb..b385274 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -30,10 +30,9 @@ process = None def __init__(self, suite_run, ip_address, bts_ip): + super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-mgcpgw_%s' % ip_address.get('addr')) # hack: so far mgcpgw needs one specific BTS IP. self.bts_ip = bts_ip diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 3a822f1..443b254 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -32,10 +32,9 @@ config = None def __init__(self, suite_run, hlr, mgcpgw, 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.set_log_category(log.C_RUN) - self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw @@ -100,12 +99,11 @@ def imsi_attached(self, *imsis): attached = self.imsi_list_attached() - self.dbg('attached:', attached) + log.dbg('attached:', attached) return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoMscCtrl(self).subscriber_list_active() + return OsmoMscCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -117,8 +115,7 @@ def __init__(self, msc): self.msc = msc - self.set_name('CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) - self.set_child_of(msc) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.msc.addr(), self.PORT) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b4bf247..3104842 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -32,10 +32,9 @@ bts = None def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -106,8 +105,7 @@ msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - with self: - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -118,8 +116,7 @@ return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoNitbCtrl(self).subscriber_list_active() + return OsmoNitbCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -133,8 +130,7 @@ def __init__(self, nitb): self.nitb = nitb - self.set_name('CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) - self.set_child_of(nitb) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.nitb.addr(), OsmoNitbCtrl.PORT) diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index f3b1e6a..398ec6c 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -27,14 +27,13 @@ class PcapRecorder(log.Origin): def __init__(self, suite_run, run_dir, iface=None, filters=''): - self.suite_run = suite_run - self.run_dir = run_dir self.iface = iface if not self.iface: self.iface = "any" self.filters = filters - self.set_log_category(log.C_RUN) - self.set_name('pcap-recorder_%s' % self.iface) + super().__init__(log.C_RUN, 'pcap-recorder_%s' % self.iface, filters=self.filters) + self.suite_run = suite_run + self.run_dir = run_dir self.start() def start(self): diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e5d38f3..99e94ba 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -33,9 +33,8 @@ killed = None def __init__(self, name, run_dir, popen_args, **popen_kwargs): + super().__init__(log.C_RUN, name) self.name_str = name - self.set_name(name) - self.set_log_category(log.C_RUN) self.run_dir = run_dir self.popen_args = popen_args self.popen_kwargs = popen_kwargs @@ -62,23 +61,21 @@ return f def launch(self): - with self: + log.dbg('cd %r; %s %s' % ( + os.path.abspath(str(self.run_dir)), + ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), + ' '.join(self.popen_args))) - self.dbg('cd %r; %s %s' % ( - os.path.abspath(str(self.run_dir)), - ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), - ' '.join(self.popen_args))) - - self.process_obj = subprocess.Popen( - self.popen_args, - stdout=self.make_output_log('stdout'), - stderr=self.make_output_log('stderr'), - stdin=subprocess.PIPE, - shell=False, - cwd=self.run_dir.path, - **self.popen_kwargs) - self.set_name(self.name_str, pid=self.process_obj.pid) - self.log('Launched') + self.process_obj = subprocess.Popen( + self.popen_args, + stdout=self.make_output_log('stdout'), + stderr=self.make_output_log('stderr'), + stdin=subprocess.PIPE, + shell=False, + cwd=self.run_dir.path, + **self.popen_kwargs) + self._set_name(self.name_str, pid=self.process_obj.pid) + self.log('Launched') def _poll_termination(self, time_to_wait_for_term=5): wait_step = 0.001 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7cc32bb..a67ce0f 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -83,7 +83,7 @@ def __init__(self): self.config_path = config.get_config_file(RESOURCES_CONF) self.state_dir = config.get_state_dir() - self.set_name(conf=self.config_path, state=self.state_dir.path) + super().__init__(log.C_CNF, conf=self.config_path, state=self.state_dir.path) self.read_conf() def read_conf(self): @@ -158,6 +158,7 @@ return ReservedResources(self, origin, to_be_reserved) def free(self, origin, to_be_freed): + log_ctx = origin with self.state_dir.lock(origin.origin_id()): rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE) reserved = Resources(config.read(rrfile_path, if_missing_return={})) @@ -202,19 +203,19 @@ with self.state_dir.lock(origin_id): msisdn_path = self.state_dir.child(LAST_USED_MSISDN_FILE) - with log.Origin(msisdn_path): - last_msisdn = '1000' - if os.path.exists(msisdn_path): - if not os.path.isfile(msisdn_path): - raise RuntimeError('path should be a file but is not: %r' % msisdn_path) - with open(msisdn_path, 'r') as f: - last_msisdn = f.read().strip() - schema.msisdn(last_msisdn) + log_ctx = msisdn_path + last_msisdn = '1000' + if os.path.exists(msisdn_path): + if not os.path.isfile(msisdn_path): + raise RuntimeError('path should be a file but is not: %r' % msisdn_path) + with open(msisdn_path, 'r') as f: + last_msisdn = f.read().strip() + schema.msisdn(last_msisdn) - next_msisdn = util.msisdn_inc(last_msisdn) - with open(msisdn_path, 'w') as f: - f.write(next_msisdn) - return next_msisdn + next_msisdn = util.msisdn_inc(last_msisdn) + with open(msisdn_path, 'w') as f: + f.write(next_msisdn) + return next_msisdn class NoResourceExn(Exception): diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index fb27f32..00facc4 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -124,9 +124,9 @@ validate_item(path, list_v, schema) return - with log.Origin(item=path): - type_validator = SCHEMA_TYPES.get(want_type) - type_validator(value) + log_ctx = path + type_validator = SCHEMA_TYPES.get(want_type) + type_validator(value) def nest(parent_path, config, schema): if parent_path: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 55f81b1..fe1ac03 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -49,9 +49,8 @@ def __init__(self, suite_dir): - self.set_log_category(log.C_CNF) self.suite_dir = suite_dir - self.set_name(os.path.basename(self.suite_dir)) + super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) self.read_conf() def read_conf(self): @@ -78,12 +77,10 @@ FAIL = 'FAIL' def __init__(self, suite_run, test_basename): - self.suite_run = suite_run self.basename = test_basename + super().__init__(log.C_TST, self.basename) + self.suite_run = suite_run self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) - super().__init__(self.path) - self.set_name(self.basename) - self.set_log_category(log.C_TST) self.status = Test.UNKNOWN self.start_timestamp = 0 self.duration = 0 @@ -92,16 +89,15 @@ def run(self): try: - with self: - log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() except Exception as e: if hasattr(e, 'msg'): msg = e.msg @@ -110,14 +106,14 @@ if isinstance(e, AssertionError): # AssertionError lacks further information on what was # asserted. Find the line where the code asserted: - msg += log.get_src_from_tb(sys.exc_info()[2]) + msg += log.get_src_from_exc_info(sys.exc_info()) # add source file information to failure report if hasattr(e, 'origins'): msg += ' [%s]' % e.origins tb_str = traceback.format_exc() if isinstance(e, resource.NoResourceExn): tb_str += self.suite_run.resource_status_str() - self.set_fail(type(e).__name__, msg, tb_str) + self.set_fail(type(e).__name__, msg, tb_str, log.get_src_from_exc_info()) except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TEST RUN ABORTED: %s' % type(e).__name__) @@ -129,7 +125,7 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb_str=None): + def set_fail(self, fail_type, fail_message, tb_str=None, src=4): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type @@ -140,9 +136,9 @@ tb_str = ''.join(traceback.format_stack()[:-1]) self.fail_tb = tb_str - self.err('%s: %s' % (self.fail_type, self.fail_message)) + self.err('%s: %s' % (self.fail_type, self.fail_message), _src=src) if self.fail_tb: - self.trace(self.fail_tb) + self.log(self.fail_tb, _level=log.L_TRACEBACK) self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): @@ -171,11 +167,10 @@ _processes = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + super().__init__(log.C_TST, suite_scenario_str) self.trial = trial self.definition = suite_definition self.scenarios = scenarios - self.set_name(suite_scenario_str) - self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() @@ -201,18 +196,18 @@ self.status = SuiteRun.UNKNOWN def combined(self, conf_name): - self.dbg(combining=conf_name) - with log.Origin(combining_scenarios=conf_name): - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) - self.dbg(definition_conf=combination) - for scenario in self.scenarios: - with scenario: - c = scenario.get(conf_name) - self.dbg(scenario=scenario.name(), conf=c) - if c is None: - continue - config.combine(combination, c) - return combination + log.dbg(combining=conf_name) + log_ctx = 'combining_scenarios=%r' % conf_name + combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + log.dbg(definition_conf=combination) + for scenario in self.scenarios: + log_ctx = '{combining_scenarios=%r, %s}' % (conf_name, scenario.name()) + c = scenario.get(conf_name) + log.dbg(scenario=scenario.name(), conf=c) + if c is None: + continue + config.combine(combination, c) + return combination def resource_requirements(self): if self._resource_requirements is None: @@ -232,19 +227,18 @@ def run_tests(self, names=None): try: - with self: - log.large_separator(self.trial.name(), self.name(), sublevel=2) - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.tests: - if names and not test.name() in names: - test.set_skip() - continue - test.run() + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() except Exception: - self.log_exn() + log.log_exn() except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('SUITE RUN ABORTED: %s' % type(e).__name__) @@ -355,7 +349,8 @@ if process.terminated(): process.log_stdout_tail() process.log_stderr_tail() - process.raise_exn('Process ended prematurely') + log_ctx = process + raise log.Error('Process ended prematurely') def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index 33ce2f6..4d8ed2a 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -26,7 +26,7 @@ from .util import dict2obj _lookup = None -_logger = log.Origin('no templates dir set') +_logger = log.Origin(log.C_CNF, 'no templates dir set') def set_templates_dir(*templates_dirs): global _lookup @@ -39,7 +39,7 @@ raise RuntimeError('templates dir is not a dir: %r' % os.path.abspath(d)) _lookup = TemplateLookup(directories=templates_dirs) - _logger = log.Origin('Templates', category=log.C_CNF) + _logger = log.Origin(log.C_CNF, 'Templates') def render(name, values): '''feed values dict into template and return rendered result. @@ -48,11 +48,11 @@ if _lookup is None: set_templates_dir() tmpl_name = name + '.tmpl' - with log.Origin(tmpl_name): - template = _lookup.get_template(tmpl_name) - _logger.dbg('rendering', tmpl_name) + log_ctx = tmpl_name + template = _lookup.get_template(tmpl_name) + _logger.dbg('rendering', tmpl_name) - line_info_name = tmpl_name.replace('-', '_').replace('.', '_') - return template.render(**dict2obj(values)) + line_info_name = tmpl_name.replace('-', '_').replace('.', '_') + return template.render(**dict2obj(values)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 741f3a7..d54e96c 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -57,8 +57,7 @@ def __init__(self, trial_dir): self.path = os.path.abspath(trial_dir) - self.set_name(os.path.basename(self.path)) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, os.path.basename(self.path)) self.dir = util.Dir(self.path) self.inst_dir = util.Dir(self.dir.child('inst')) self.bin_tars = [] @@ -69,7 +68,8 @@ return self.name() def __enter__(self): - # add a log target to log to the run dir + '''add a log target to log to the run dir, write taken marker, log a + starting separator.''' run_dir = self.get_run_dir() detailed_log = run_dir.new_child(FILE_LOG) self.log_targets = [ @@ -82,11 +82,10 @@ log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() - super().__enter__() return self def __exit__(self, *exc_info): - super().__exit__(*exc_info) + '''log a report, then remove log file targets for this trial''' self.log_report() for lt in self.log_targets: lt.remove() @@ -195,6 +194,8 @@ except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + # log the traceback before the trial's logging is ended + log.log_exn() raise finally: if suite_run.status != suite.SuiteRun.PASS: -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 3 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 Mon Jun 12 22:10:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 12 Jun 2017 22:10:42 +0000 Subject: [PATCH] osmo-gsm-tester[master]: log_test.py: cosmetic follow-up Message-ID: Review at https://gerrit.osmocom.org/2899 log_test.py: cosmetic follow-up This is kept separate to not clutter up previous patch I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90. Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6 --- M selftest/log_test.ok M selftest/log_test.py 2 files changed, 15 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/99/2899/1 diff --git a/selftest/log_test.ok b/selftest/log_test.ok index 17198b7..c9d2dd2 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -12,29 +12,29 @@ tst: only category DBG: only level some-name(some='detail'): only origin -only src [log_test.py:70] +only src [log_test.py:69] - Testing log.style_change() no log format 01:02:03: add time but no time format 01:02:03: DBG: add level 01:02:03 tst: DBG: add category -01:02:03 tst: DBG: add src [log_test.py:85] -01:02:03 tst some-name(some='detail'): DBG: add origin [log_test.py:87] +01:02:03 tst: DBG: add src [log_test.py:84] +01:02:03 tst some-name(some='detail'): DBG: add origin [log_test.py:86] - Testing origin_width -01:02:03 tst shortname: origin str set to 23 chars [log_test.py:94] -01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): long origin str [log_test.py:96] -01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): DBG: long origin str dbg [log_test.py:97] -01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): ERR: long origin str err [log_test.py:98] +01:02:03 tst shortname: origin str set to 23 chars [log_test.py:91] +01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): long origin str [log_test.py:93] +01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): DBG: long origin str dbg [log_test.py:94] +01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): ERR: long origin str err [log_test.py:95] - Testing log.Origin with omitted info -01:02:03 tst LogTest: hello log, name implicit from class name [log_test.py:103] -01:02:03 --- explicit_name: hello log, no category set [log_test.py:107] -01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110] -01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113] +01:02:03 tst LogTest: hello log, name implicit from class name [log_test.py:99] +01:02:03 --- explicit_name: hello log, no category set [log_test.py:103] +01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:107] +01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:110] - Testing logging of Exceptions, tracing origins nested print just prints -01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:135] -01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:136] -01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:137: raise ValueError('bork')] +01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:132] +01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:133] +01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:134: raise ValueError('bork')] - Disallow origin loops disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 1b268f1..913b3d5 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -45,7 +45,6 @@ super().__init__(log.C_TST, *name_items, **detail_items) t = LogTest('some', 'name', some="detail") - t.log("hello log") t.err("hello err") @@ -86,8 +85,6 @@ log.style_change(origin=True) t.dbg("add origin") -# some space to keep source line numbers identical to previous code - print('- Testing origin_width') t = LogTest('shortname') log.style(origin_width=23, time_fmt=fake_time) @@ -97,7 +94,6 @@ t.dbg("long origin str dbg") t.err("long origin str err") - print('- Testing log.Origin with omitted info') t = LogTest() t.log("hello log, name implicit from class name") @@ -105,6 +101,7 @@ t = LogTest('explicit_name') t._set_log_category(None) t.log("hello log, no category set") + t = LogTest() t._set_log_category(None) t.log("hello log, no category nor name set") -- To view, visit https://gerrit.osmocom.org/2899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 12 22:32:20 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 12 Jun 2017 22:32:20 +0000 Subject: osmo-trx[master]: sigProcLib: Remove unused functions from public interface In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 08:14:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 08:14:06 +0000 Subject: osmo-gsm-tester[master]: log_test.py: cosmetic follow-up In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 08:14:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 08:14:57 +0000 Subject: osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) I'd like you to do the small changes related to underscores. Other than that it looks good. https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 93: log_ctx = proc > absolutely not double underscored, those are reserved for python internals. Well I was of course referring to the general case/mechanism of the log_ctx variable, not to this specific one. IMHO you can change the code which looks for that variable and use something more "outstanding". like _log_ctx_ or log_ctx__ should be enough. IMHO this already gives more hints to unaware reader that this variable may be "special" and worth looking for it in the code. All caps can be a good option too. I don't mind the exact way, but I'd like it to have something different from a regular local variable. https://gerrit.osmocom.org/#/c/2886/2/src/osmo_gsm_tester/process.py File src/osmo_gsm_tester/process.py: Line 77: self._set_name(self.name_str, pid=self.process_obj.pid) > a single underscore says: not supposed to use it directly. The idea was tha Then, if it's not supposed to be used directly don't use it, or change it so that it can be used (remove the underscore). If you think it's necessary you can add a comment saying why are you using it here too, but I don't think it's needed. -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 2 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 13 08:16:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 08:16:57 +0000 Subject: osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 See the two small comments I wrote in the previous commit version. -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 3 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 08:32:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 08:32:57 +0000 Subject: [PATCH] openbsc[master]: Fix BTS features length check Message-ID: Review at https://gerrit.osmocom.org/2900 Fix BTS features length check While fixing potentially incorrect memory access, the check for maximum number of supported BTS features was incorrectly adjusted instead of feature vectore length check next to it. Fix this by adjusting checks properly and adding comments to avoid future confusion. The error was introduced in a60bb3dd28ce9e3720f8ee1b262893f3e233e2e6. Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/2900/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 1715688..b0f3428 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -484,13 +484,13 @@ if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_ID, 2)) { m_id_len = TLVP_LEN(&tp, NM_ATT_MANUF_ID); - if (m_id_len > MAX_BTS_FEATURES/8 + 1) { + /* log potential BTS feature vector overflow */ + if (m_id_len > sizeof(bts->_features_data)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n", bts->nr, MAX_BTS_FEATURES/8); - m_id_len = MAX_BTS_FEATURES/8; - } - if (m_id_len > sizeof(bts->_features_data)) + /* check that max. expected BTS attribute is above given feature vector length */ + if (m_id_len > _NUM_BTS_FEAT/8 + 1) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " "feature vector - most likely it was compiled against newer BSC headers. " "Consider upgrading your BSC to later version.\n", -- To view, visit https://gerrit.osmocom.org/2900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 13 09:40:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 09:40:25 +0000 Subject: libosmocore[master]: ctrl_test.c: fix build with GCC 7.1.1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 09:41:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 09:41:35 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 3: A little follow-up: most likely values used in sysmobts would work here too. Ping me for re-test once ready. -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 09:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 13 Jun 2017 09:41:58 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2861 to look at the new patch set (#4). osmo-bts-litecell15: Fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. This commit changes process_meas_res() to properly include the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap) Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 15 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/4 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 5977aa9..a3e8d03 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -901,17 +901,30 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_PhDataInd_t *data_ind) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_INDICATION, NULL); + GsmL1_MeasParam_t *m = &data_ind->measParam; + l1sap.u.info.type = PRIM_INFO_MEAS; l1sap.u.info.u.meas_ind.chan_nr = chan_nr; l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + + /* The MEAS IND data structure expects a logical frame number. On the + * physical radio link, the uplink is delayed by 3 timeslots, we need + * to compensate for that delay. */ + l1sap.u.info.u.meas_ind.fn = fn + 3; + + /* Align frame number with measurement period ends */ + if (data_ind->sapi == GsmL1_Sapi_TchF) + l1sap.u.info.u.meas_ind.fn += 1; + else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == GsmL1_SubCh_0) + l1sap.u.info.u.meas_ind.fn += 1; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +954,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, data_ind); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 4 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 Tue Jun 13 10:06:25 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 13 Jun 2017 10:06:25 +0000 Subject: [MERGED] osmo-bts[master]: measurement: Improve log output In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: measurement: Improve log output ...................................................................... measurement: Improve log output The debug log does not print much information about the measured rxlev and rxqual values. This commit adds debug output to make measurement debugging simpler Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f --- M src/common/measurement.c M src/common/rsl.c 2 files changed, 36 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/measurement.c b/src/common/measurement.c index bd2af7e..6ddc05a 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -88,14 +88,14 @@ /* determine if a measurement period ends at the given frame number */ -static int is_meas_complete(enum gsm_phys_chan_config pchan, unsigned int ts, - unsigned int subch, uint32_t fn) +static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) { unsigned int fn_mod = -1; const uint8_t *tbl; int rc = 0; + enum gsm_phys_chan_config pchan = ts_pchan(lchan->ts); - if (ts >= 8) + if (lchan->ts->nr >= 8) return -EINVAL; if (pchan >= _GSM_PCHAN_MAX) return -EINVAL; @@ -103,34 +103,39 @@ switch (pchan) { case GSM_PCHAN_TCH_F: fn_mod = fn % 104; - if (tchf_meas_rep_fn104[ts] == fn_mod) + if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: fn_mod = fn % 104; - if (subch == 0) + if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else tbl = tchh1_meas_rep_fn104; - if (tbl[ts] == fn_mod) + if (tbl[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_SDCCH8_SACCH8C: case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: fn_mod = fn % 102; - if (sdcch8_meas_rep_fn102[subch] == fn_mod) + if (sdcch8_meas_rep_fn102[lchan->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_CCCH_SDCCH4: case GSM_PCHAN_CCCH_SDCCH4_CBCH: fn_mod = fn % 102; - if (sdcch4_meas_rep_fn102[subch] == fn_mod) + if (sdcch4_meas_rep_fn102[lchan->nr] == fn_mod) rc = 1; break; default: rc = 0; break; } + + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + return rc; } @@ -247,8 +252,7 @@ int i; /* if measurement period is not complete, abort */ - if (!is_meas_complete(ts_pchan(lchan->ts), lchan->ts->nr, - lchan->nr, fn)) + if (!is_meas_complete(lchan, fn)) return 0; /* if there are no measurements, skip computation */ @@ -301,6 +305,14 @@ mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum); mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum); + DEBUGP(DMEAS, "%s UL MEAS RXLEV_FULL(%u), RXLEV_SUB(%u)," + "RXQUAL_FULL(%u), RXQUAL_SUB(%u), num_meas_sub(%u), num_ul_meas(%u) \n", + gsm_lchan_name(lchan), + mru->full.rx_lev, + mru->sub.rx_lev, + mru->full.rx_qual, + mru->sub.rx_qual, num_meas_sub, lchan->meas.num_ul_meas); + lchan->meas.flags |= LC_UL_M_F_RES_VALID; lchan->meas.num_ul_meas = 0; diff --git a/src/common/rsl.c b/src/common/rsl.c index 101d13f..eab9379 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2245,8 +2245,9 @@ uint8_t chan_nr = gsm_lchan2chan_nr(lchan); int res_valid = lchan->meas.flags & LC_UL_M_F_RES_VALID; - LOGP(DRSL, LOGL_DEBUG, "%s Tx MEAS RES valid(%d)\n", - gsm_lchan_name(lchan), res_valid); + LOGP(DRSL, LOGL_DEBUG, + "%s chan_num:%u Tx MEAS RES valid(%d), flags(%02x)\n", + gsm_lchan_name(lchan), chan_nr, res_valid, lchan->meas.flags); if (!res_valid) return -EINPROGRESS; @@ -2255,6 +2256,17 @@ if (!msg) return -ENOMEM; + LOGP(DRSL, LOGL_DEBUG, + "%s Send Meas RES: NUM:%u, RXLEV_FULL:%u, RXLEV_SUB:%u, RXQUAL_FULL:%u, RXQUAL_SUB:%u, MS_PWR:%u, UL_TA:%u, L3_LEN:%d, TimingOff:%u\n", + gsm_lchan_name(lchan), + lchan->meas.res_nr, + lchan->meas.ul_res.full.rx_lev, + lchan->meas.ul_res.sub.rx_lev, + lchan->meas.ul_res.full.rx_qual, + lchan->meas.ul_res.sub.rx_qual, + lchan->meas.l1_info[0], + lchan->meas.l1_info[1], l3_len, ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE); + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++); size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, lchan->tch.dtx.dl_active, -- To view, visit https://gerrit.osmocom.org/2389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f Gerrit-PatchSet: 11 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jun 13 11:32:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 11:32:54 +0000 Subject: [PATCH] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify 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/2886 to look at the new patch set (#4). fix and refactor logging: drop 'with', simplify With the recent fix of the junit report related issues, another issue arose: the 'with log.Origin' was changed to disallow __enter__ing an object twice to fix problems, now still code would fail because it tries to do 'with' on the same object twice. The only reason is to ensure that logging is associated with a given object. Instead of complicating even more, implement differently. Refactor logging to simplify use: drop the 'with Origin' style completely, and instead use the python stack to determine which objects are created by which, and which object to associate a log statement with. The new way: we rely on the convention that each class instance has a local 'self' referencing the object instance. If we need to find an origin as a new object's parent, or to associate a log message with, we traverse each stack frame, fetching the first local 'self' object that is a log.Origin class instance. How to use: Simply call log.log() anywhere, and it finds an Origin object to log for, from the stack. Alternatively call self.log() for any Origin() object to skip the lookup. Create classes as child class of log.Origin and make sure to call super().__init__(category, name). This constructor will magically find a parent Origin on the stack. When an exception happens, we first escalate the exception up through call scopes to where ever it is handled by log.log_exn(). This then finds an Origin object in the traceback's stack frames, no need to nest in 'with' scopes. Hence the 'with log.Origin' now "happens implicitly", we can write pure natural python code, no more hassles with scope ordering. Furthermore, any frame can place additional logging information in a frame by calling log.ctx(). This is automatically inserted in the ancestry associated with a log statement / exception. Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 --- M selftest/config_test.ok M selftest/log_test.ok M selftest/log_test.py M selftest/resource_test.ok M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test.py M selftest/template_test.ok M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/trial.py 27 files changed, 444 insertions(+), 456 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/2886/4 diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 40a5dcb..80b5a06 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -54,42 +54,42 @@ --- -: ERR: ValueError: config item not known: 'a_dict[]' Validation: Error - unknown band: ---- (item='bts[].trx[].band'): ERR: ValueError: Unknown GSM band: 'what' +--- bts[].trx[].band: ERR: ValueError: Unknown GSM band: 'what' Validation: Error - invalid v4 addrs: ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '91.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '91.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: 'go away' +--- addr[]: ERR: ValueError: Invalid IPv4 address: 'go away' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: None +--- addr[]: ERR: ValueError: Invalid IPv4 address: None Validation: Error - invalid hw addrs: ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '1.2.3' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '1.2.3' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: 'go away' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: 'go away' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: None +--- hwaddr[]: ERR: ValueError: Invalid hardware address: None Validation: Error - invalid imsis: ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '99999999x9' +--- imsi[]: ERR: ValueError: Invalid IMSI: '99999999x9' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '123 456 789 123' +--- imsi[]: ERR: ValueError: Invalid IMSI: '123 456 789 123' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: 'go away' +--- imsi[]: ERR: ValueError: Invalid IMSI: 'go away' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '' +--- imsi[]: ERR: ValueError: Invalid IMSI: '' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: None +--- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error diff --git a/selftest/log_test.ok b/selftest/log_test.ok index 7ed94a0..17198b7 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -32,10 +32,9 @@ 01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110] 01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113] - Testing logging of Exceptions, tracing origins -Not throwing an exception in 'with:' works. nested print just prints -01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:145] -01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] -01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] -- Enter the same Origin context twice +01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:135] +01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:136] +01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:137: raise ValueError('bork')] +- Disallow origin loops disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 7670c8e..9136906 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -32,20 +32,20 @@ log.set_all_levels(None) print('- Testing global log functions') -log.log('', log.C_TST, 'from log.log()') -log.dbg('', log.C_TST, 'from log.dbg(), not seen') +log.log('from log.log()', _origin='', _category=log.C_TST) +log.dbg('from log.dbg(), not seen', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_DBG) -log.dbg('', log.C_TST, 'from log.dbg()') +log.dbg('from log.dbg()', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_LOG) -log.err('', log.C_TST, 'from log.err()') +log.err('from log.err()', _origin='', _category=log.C_TST) print('- Testing log.Origin functions') class LogTest(log.Origin): - pass + def __init__(self, *name_items, **detail_items): + super().__init__(log.C_TST, *name_items, **detail_items) -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('some', 'name', some="detail") +t = LogTest('some', 'name', some="detail") + t.log("hello log") t.err("hello err") @@ -86,10 +86,10 @@ log.style_change(origin=True) t.dbg("add origin") +# some space to keep source line numbers identical to previous code + print('- Testing origin_width') -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('shortname') +t = LogTest('shortname') log.style(origin_width=23, time_fmt=fake_time) t.log("origin str set to 23 chars") t.set_name('very long name', some='details', and_some=(3, 'things', 'in a tuple')) @@ -97,16 +97,16 @@ t.dbg("long origin str dbg") t.err("long origin str err") + print('- Testing log.Origin with omitted info') t = LogTest() -t.set_log_category(log.C_TST) t.log("hello log, name implicit from class name") -t = LogTest() -t.set_name('explicit_name') +t = LogTest('explicit_name') +t._set_log_category(None) t.log("hello log, no category set") - t = LogTest() +t._set_log_category(None) t.log("hello log, no category nor name set") t.dbg("hello log, no category nor name set, not seen") log.set_level(log.C_DEFAULT, log.L_DBG) @@ -117,47 +117,37 @@ class Thing(log.Origin): def __init__(self, some_path): - self.set_log_category(log.C_TST) - self.set_name(some_path) + super().__init__(log.C_TST, some_path) def say(self, msg): print(msg) -#log.style_change(trace=True) + def l1(self): + level2 = Thing('level2') + level2.l2() -with Thing('print_redirected'): - print("Not throwing an exception in 'with:' works.") + def l2(self): + level3 = Thing('level3') + level3.l3(self) -def l1(): - level1 = Thing('level1') - with level1: - l2() - -def l2(): - level2 = Thing('level2') - with level2: - l3(level2) - -def l3(level2): - level3 = Thing('level3') - with level3: + def l3(self, level2): print('nested print just prints') - level3.log('nested log()') + self.log('nested log()') level2.log('nested l2 log() from within l3 scope') raise ValueError('bork') try: - l1() + level1 = Thing('level1') + level1.l1() except Exception: log.log_exn() -print('- Enter the same Origin context twice') +print('- Disallow origin loops') try: t = Thing('foo') - with t: - with t: - raise RuntimeError('this should not be reached') -except AssertionError: + t._set_parent(t) + raise RuntimeError('this should not be reached') +except log.OriginLoopError: print('disallowed successfully') pass diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index cdc3519..d366cf9 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -13,8 +13,8 @@ cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./test_work/state_dir is [PATH]/selftest/conf/test_work/state_dir cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./suite_test is [PATH]/selftest/conf/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf -cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir *** all resources: {'arfcn': [{'_hash': 'e620569450f8259b3f0212ec19c285dd07df063c', 'arfcn': '512', diff --git a/selftest/resource_test.py b/selftest/resource_test.py index c78485e..a0ec490 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -78,7 +78,7 @@ 'modem': [ { 'times': 2 } ], } -origin = log.Origin('testowner') +origin = log.Origin(None, 'testowner') resources = pool.reserve(origin, want) diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 54c950a..2808474 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' +cnf [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -22,15 +22,15 @@ - times: '2' - run hello world test -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test -cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir --------------------------------------------------------------------- trial test_suite --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 @@ -83,7 +83,7 @@ trial test_suite test_error.py ---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]: assert False] tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -92,7 +92,7 @@ skip: hello_world.py (N.N sec) skip: mo_mt_sms.py skip: mo_sms.py - FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False skip: test_fail.py skip: test_fail_raise.py @@ -106,7 +106,7 @@ trial test_suite test_fail.py ---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -128,7 +128,7 @@ ---------------------------------------------- trial test_suite test_fail_raise.py ---------------------------------------------- -tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]: raise ExpectedFail('This failure is expected')] tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -139,6 +139,6 @@ skip: mo_sms.py skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) - FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected - graceful exit. diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 2a92f47..86c4c25 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,7 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -trial = log.Origin('trial') +trial = log.Origin(log.C_TST, 'trial') s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) diff --git a/selftest/template_test.ok b/selftest/template_test.ok index d031c96..1267dac 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -1,5 +1,5 @@ - Testing: fill a config file with values -cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl [osmo-nitb.cfg.tmpl?Templates] +cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl ! Configuration rendered by osmo-gsm-tester password foo ! diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 0083512..7d12c85 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -36,10 +36,9 @@ CONF_BTS_TRX = 'osmo-bts-trx.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX) self.suite_run = suite_run self.conf = conf - self.set_name(OsmoBtsTrx.BIN_BTS_TRX) - self.set_log_category(log.C_RUN) self.env = {} def remote_addr(self): diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 5f2b3cb..30fff0e 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -35,52 +35,50 @@ BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, self.BTS_SYSMO_BIN) self.suite_run = suite_run self.conf = conf - self.set_name('osmo-bts-sysmo') - self.set_log_category(log.C_RUN) self.remote_env = {} self.remote_user = 'root' def start(self): - with self: - if self.bsc is None: - raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') - self.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) - self.configure() + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') + log.log('Starting sysmoBTS to connect to', self.bsc) + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) - lib = self.inst.child('lib') - if not os.path.isdir(lib): - self.raise_exn('No lib/ in', self.inst) - if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): - self.raise_exn('No osmo-bts-sysmo binary in', self.inst) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) + lib = self.inst.child('lib') + if not os.path.isdir(lib): + raise log.Error('No lib/ in', self.inst) + if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): + raise log.Error('No osmo-bts-sysmo binary in', self.inst) - self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) - self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) + self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) + self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) - self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) - self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) - self.run_local('scp-inst-to-sysmobts', - ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) + self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) + self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) + self.run_local('scp-inst-to-sysmobts', + ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) - remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) - self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) + remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) + self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) - remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) - self.run_local('scp-cfg-to-sysmobts', - ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) + remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) + self.run_local('scp-cfg-to-sysmobts', + ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) - self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) + self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) - remote_lib = self.remote_inst.child('lib') - remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') - self.launch_remote('osmo-bts-sysmo', - ('LD_LIBRARY_PATH=%s' % remote_lib, - remote_binary, '-c', remote_config_file, '-r', '1', - '-i', self.bsc.addr()), - remote_cwd=remote_run_dir) + remote_lib = self.remote_inst.child('lib') + remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') + self.launch_remote('osmo-bts-sysmo', + ('LD_LIBRARY_PATH=%s' % remote_lib, + remote_binary, '-c', remote_config_file, '-r', '1', + '-i', self.bsc.addr()), + remote_cwd=remote_run_dir) def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) @@ -92,7 +90,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log.ctx(proc) + raise log.Error('Exited in error') def launch_remote(self, name, popen_args, remote_cwd=None): proc = self._process_remote(name, popen_args, remote_cwd) @@ -105,7 +104,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log.ctx(proc) + raise log.Error('Exited in error') def remote_addr(self): return self.conf.get('addr') diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 38d8e2f..20ae83e 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -95,7 +95,7 @@ real_l = os.path.realpath(l) p = os.path.realpath(os.path.join(real_l, basename)) if os.path.isfile(p): - log.dbg(None, log.C_CNF, 'Found config file', basename, 'as', p, 'in', l, 'which is', real_l) + log.dbg('Found config file', basename, 'as', p, 'in', l, 'which is', real_l, _category=log.C_CNF) return (p, real_l) if not fail_if_missing: return None, None @@ -122,7 +122,7 @@ env_path = os.getenv(env_name) if env_path: real_env_path = os.path.realpath(env_path) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path) + log.dbg('Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path, _category=log.C_CNF) return real_env_path if PATHS is None: @@ -132,15 +132,15 @@ for key, path in sorted(PATHS.items()): if not path.startswith(os.pathsep): PATHS[key] = os.path.realpath(os.path.join(found_in, path)) - log.dbg(None, log.C_CNF, paths_file + ': relative path', path, 'is', PATHS[key]) + log.dbg(paths_file + ': relative path', path, 'is', PATHS[key], _category=log.C_CNF) p = PATHS.get(label) if p is None and not allow_unset: raise RuntimeError('missing configuration in %s: %r' % (PATHS_CONF, label)) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', p) + log.dbg('Found path', label, 'as', p, _category=log.C_CNF) if p.startswith(PATHS_TEMPDIR_STR): p = os.path.join(get_tempdir(), p[len(PATHS_TEMPDIR_STR):]) - log.dbg(None, log.C_CNF, 'Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p) + log.dbg('Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p, _category=log.C_CNF) return p def get_state_dir(): @@ -153,20 +153,20 @@ return Dir(get_configured_path(PATH_SCENARIOS_DIR)) def read(path, validation_schema=None, if_missing_return=False): - with log.Origin(path): - if not os.path.isfile(path) and if_missing_return is not False: - return if_missing_return - with open(path, 'r') as f: - config = yaml.safe_load(f) - config = _standardize(config) - if validation_schema: - schema.validate(config, validation_schema) - return config + log.ctx(path) + if not os.path.isfile(path) and if_missing_return is not False: + return if_missing_return + with open(path, 'r') as f: + config = yaml.safe_load(f) + config = _standardize(config) + if validation_schema: + schema.validate(config, validation_schema) + return config def write(path, config): - with log.Origin(path): - with open(path, 'w') as f: - f.write(tostr(config)) + log.ctx(path) + with open(path, 'w') as f: + f.write(tostr(config)) def tostr(config): return _tostr(_standardize(config)) @@ -191,8 +191,7 @@ class Scenario(log.Origin, dict): def __init__(self, name, path): - self.set_name(name) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, name) self.path = path def get_scenario(name, validation_schema=None): @@ -216,8 +215,8 @@ if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - add(dest_val, val) + log.ctx(key=key) + add(dest_val, val) return if is_list(dest): if not is_list(src): @@ -235,19 +234,19 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log.ctx(key=key) dest_val = dest.get(key) if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - combine(dest_val, val) + combine(dest_val, val) return 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)): - with log.Origin(idx=i): - combine(dest[i], src[i]) + log.ctx(idx=i) + combine(dest[i], src[i]) return if dest == src: return @@ -260,16 +259,16 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log.ctx(key=key) dest_val = dest.get(key) - with log.Origin(key=key): - dest[key] = overlay(dest_val, val) + dest[key] = overlay(dest_val, val) return dest 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)): - with log.Origin(idx=i): - dest[i] = overlay(dest[i], src[i]) + log.ctx(key=key) + dest[i] = overlay(dest[i], src[i]) return dest return src diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index c3c679b..6f64ef9 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -21,6 +21,8 @@ # A test script can thus establish its context by doing: # from osmo_gsm_tester.test import * import time +from . import log + poll_funcs = [] def register_poll_func(func): @@ -38,7 +40,8 @@ def wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): if not timeout or timeout < 0: - log_obj.raise_exn('wait() *must* time out at some point. timeout=%r' % timeout) + self = log_obj + raise log.Error('wait() *must* time out at some point.', timeout=timeout) if timestep < 0.1: timestep = 0.1 @@ -54,7 +57,8 @@ def wait(log_obj, condition, *condition_args, timeout=300, timestep=1, **condition_kwargs): if not wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): - log_obj.raise_exn('Wait timeout') + log.ctx(log_obj) + raise log.Error('Wait timeout') def sleep(log_obj, seconds): assert seconds > 0. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index f098f2b..c4a6629 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -45,6 +45,41 @@ C_BUS = 'bus' C_DEFAULT = '---' +LOG_CTX_VAR = '_log_ctx_' + +def dbg(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on debug level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_DBG, src=_src) + +def log(*messages, _origin=None, _category=None, _level=L_LOG, _src=None, **named_items): + '''Log a message. The origin, an Origin class instance, is normally + determined by stack magic, only pass _origin to override. The category is + taken from the origin. _src is normally an integer indicating how many + levels up the stack sits the interesting source file to log about, can also + be a string. The log message is composed of all *messages and + **named_items, for example: + log('frobnicate:', thing, key=current_key, prop=erty) + ''' + _log(messages, named_items, origin=_origin, category=_category, level=_level, src=_src) + +def err(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on error level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_ERR, src=_src) + +def _log(messages=[], named_items={}, origin=None, category=None, level=L_LOG, src=None): + if origin is None: + origin = Origin.find_on_stack() + if category is None and isinstance(origin, Origin): + category = origin._log_category + if src is None: + # two levels up + src = 2 + if isinstance(src, int): + src = get_src_from_caller(src + 1) + for target in LogTarget.all_targets: + target.log(origin, category, level, src, messages, named_items) + + LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' DATEFMT = '%H:%M:%S' @@ -52,7 +87,8 @@ get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) class Error(Exception): - pass + def __init__(self, *messages, **named_items): + super().__init__(compose_message(messages, named_items)) class LogTarget: all_targets = [] @@ -153,7 +189,7 @@ def log(self, origin, category, level, src, messages, named_items): if category and len(category) != 3: - self.log_write_func('WARNING: INVALID LOG SUBSYSTEM %r\n' % category) + self.log_write_func('WARNING: INVALID LOGGING CATEGORY %r\n' % category) self.log_write_func('origin=%r category=%r level=%r\n' % (origin, category, level)); if not category: @@ -172,14 +208,13 @@ if self.do_log_origin: if origin is None: name = '-' - elif isinstance(origin, Origins): - name = origin[-1] - if len(origin) > 1: - deeper_origins = str(origin) + elif isinstance(origin, Origin): + name = origin.name() + # only log ancestry when there is more than one + if origin._parent is not None: + deeper_origins = origin.ancestry_str() elif isinstance(origin, str): name = origin or None - elif hasattr(origin, 'name'): - name = origin.name() if not name: name = str(origin.__class__.__name__) log_pre.append(self.origin_fmt.format(name)) @@ -228,7 +263,7 @@ def _log_all_targets(origin, category, level, src, messages, named_items=None): if origin is None: - origin = Origin._global_current_origin + origin = Origin.find_on_stack() if isinstance(src, int): src = get_src_from_caller(src + 1) for target in LogTarget.all_targets: @@ -242,13 +277,17 @@ caller = getframeinfo(stack()[levels_up][0]) return '%s:%d' % (os.path.basename(caller.filename), caller.lineno) -def get_src_from_tb(tb, levels_up=1): - ftb = traceback.extract_tb(tb) +def get_src_from_exc_info(exc_info=None, levels_up=1): + if exc_info is None: + exc_info = sys.exc_info() + ftb = traceback.extract_tb(exc_info[2]) f,l,m,c = ftb[-levels_up] f = os.path.basename(f) return '%s:%s: %s' % (f, l, c) def get_line_for_src(src_path): + '''find a given source file on the stack and return the line number for + that file. (Used to indicate the position in a test script.)''' etype, exception, tb = sys.exc_info() if tb: ftb = traceback.extract_tb(tb) @@ -262,31 +301,112 @@ return caller.lineno return None +def ctx(*name_items, **detail_items): + '''Store log context in the current frame. This string will appear as + origin information for exceptions thrown within the calling scope.''' + if not name_items and not detail_items: + ctx_obj(None) + if not detail_items and len(name_items) == 1 and isinstance(name_items[0], Origin): + ctx_obj(name_items[0]) + else: + ctx_obj(compose_message(name_items, detail_items)) + +def ctx_obj(origin_or_str): + f = sys._getframe(2) + if origin_or_str is None: + f.f_locals.pop(LOG_CTX_VAR, None) + else: + f.f_locals[LOG_CTX_VAR] = origin_or_str + +class OriginLoopError(Error): + pass class Origin: ''' - Base class for all classes that want to log, - and to add an origin string to a code path: - with log.Origin('my name'): - raise Problem() - This will log 'my name' as an origin for the Problem. + Base class for all classes that want to appear in the log. + It is a simple named marker to find in the stack frames. + This depends on the object instance named 'self' in each member class. + + In addition, it provides a logging category and a globally unique ID for + each instance. + + Each child class *must* call super().__init__(category, name), to allow + noting its parent origins. ''' - _global_current_origin = None _global_id = None - _log_category = None - _src = None _name = None _origin_id = None + _log_category = None + _parent = None - _parent_origin = None + @staticmethod + def find_on_stack(except_obj=None, f=None): + if f is None: + f = sys._getframe(2) + log_ctx_obj = None + origin = None + while f is not None: + l = f.f_locals - def __init__(self, *name_items, category=None, **detail_items): - self.set_log_category(category) + # if there is a log_ctx in the scope, add it, pointing to the next + # actual Origin class in the stack + log_ctx = l.get(LOG_CTX_VAR) + if log_ctx: + if isinstance(log_ctx, Origin): + new_log_ctx_obj = log_ctx + else: + new_log_ctx_obj = Origin(None, log_ctx, find_parent=False) + if log_ctx_obj is None: + log_ctx_obj = new_log_ctx_obj + else: + log_ctx_obj.highest_ancestor()._set_parent(new_log_ctx_obj) + + obj = l.get('self') + if obj and isinstance(obj, Origin) and (except_obj is not obj): + origin = obj + break + f = f.f_back + + if (origin is not None) and (log_ctx_obj is not None): + log_ctx_obj.highest_ancestor()._set_parent(origin) + p = log_ctx_obj + while p: + p._set_log_category(origin._log_category) + p = p._parent + if log_ctx_obj is not None: + return log_ctx_obj + # may return None + return origin + + @staticmethod + def find_in_exc_info(exc_info): + tb = exc_info[2] + # get last tb ... I hope that's right + while tb.tb_next: + tb = tb.tb_next + return Origin.find_on_stack(f=tb.tb_frame) + + def __init__(self, category, *name_items, find_parent=True, **detail_items): + self._set_log_category(category) self.set_name(*name_items, **detail_items) + if find_parent: + self._set_parent(Origin.find_on_stack(except_obj=self)) + + def _set_parent(self, parent): + # make sure to avoid loops + p = parent + while p: + if p is self: + raise OriginLoopError('Origin parent loop') + p = p._parent + self._parent = parent def set_name(self, *name_items, **detail_items): + '''Change the origin's name for log output; rather use the constructor. + This function can be used to change the name in case naming info + becomes available only after class creation (like a pid)''' if name_items: name = '-'.join([str(i) for i in name_items]) elif not detail_items: @@ -313,87 +433,43 @@ self._origin_id = '%s-%s' % (self.name(), Origin._global_id) return self._origin_id - def set_log_category(self, category): + def _set_log_category(self, category): self._log_category = category - - def _log(self, level, messages, named_items=None, src_levels_up=3, origins=None): - src = self._src or src_levels_up - origin = origins or self.gather_origins() - _log_all_targets(origin, self._log_category, level, src, messages, named_items) - - def dbg(self, *messages, **named_items): - self._log(L_DBG, messages, named_items) - - def log(self, *messages, **named_items): - self._log(L_LOG, messages, named_items) - - def err(self, *messages, **named_items): - self._log(L_ERR, messages, named_items) - - def trace(self, *messages, **named_items): - self._log(L_TRACEBACK, messages, named_items) - - def log_exn(self, exc_info=None): - log_exn(self, self._log_category, exc_info) - - def __enter__(self): - if not self.set_child_of(Origin._global_current_origin): - return self - Origin._global_current_origin = self - return self - - def __exit__(self, *exc_info): - rc = None - if exc_info[0] is not None: - rc = exn_add_info(exc_info, self) - Origin._global_current_origin, self._parent_origin = self._parent_origin, None - return rc - - def raise_exn(self, *messages, exn_class=Error, **named_items): - with self: - raise exn_class(compose_message(messages, named_items)) def redirect_stdout(self): return contextlib.redirect_stdout(SafeRedirectStdout(self)) - def gather_origins(self): - origins = Origins() - # this object shall always be seen as the immediate origin of the log message. - origins.add(self) - # now go through the parents of this object. - origin = self._parent_origin - # but if this object is "loose" and not set up with cascaded 'with' statements, - # take the last seen 'with' statement's object as next parent: - if origin is None and Origin._global_current_origin is not None: - origin = Origin._global_current_origin - # if this object is currently the _global_current_origin, we don't - # need to add it twice. - if origin is self: - origin = origin._parent_origin - # whichever we determined to be the parent above, go up through all its - # ancestors. - while origin is not None: - origins.add(origin) - origin = origin._parent_origin + def ancestry(self): + origins = [] + n = 10 + origin = self + while origin: + origins.insert(0, origin) + origin = origin._parent + n -= 1 + if n < 0: + break return origins - def set_child_of(self, parent_origin): - # avoid loops - assert self._parent_origin is None - assert parent_origin is not self - self._parent_origin = parent_origin - return True + def ancestry_str(self): + return '?'.join([o.name() for o in self.ancestry()]) -class LineInfo(Origin): - def __init__(self, src_file, *name_items, **detail_items): - self.src_file = src_file - self.set_name(*name_items, **detail_items) + def highest_ancestor(self): + if self._parent: + return self._parent.highest_ancestor() + return self - def name(self): - l = get_line_for_src(self.src_file) - if l is not None: - return '%s:%s' % (self._name, l) - return super().name() + def log(self, *messages, _src=3, **named_items): + '''same as log.log() but passes this object to skip looking up an origin''' + log(*messages, _origin=self, _src=_src, **named_items) + + def dbg(self, *messages, _src=3, **named_items): + '''same as log.dbg() but passes this object to skip looking up an origin''' + dbg(*messages, _origin=self, _src=_src, **named_items) + + def err(self, *messages, _src=3, **named_items): + '''same as log.err() but passes this object to skip looking up an origin''' + err(*messages, _origin=self, _src=_src, **named_items) class SafeRedirectStdout: ''' @@ -407,7 +483,7 @@ _log_line_buf = None def __init__(self, origin): - self._origin = origin + self.origin = origin def write(self, message): lines = message.splitlines() @@ -419,93 +495,34 @@ if not message.endswith('\n'): self._log_line_buf = lines[-1] lines = lines[:-1] - origins = self._origin.gather_origins() for line in lines: - self._origin._log(L_LOG, (line,), origins=origins) + _log(messages=(line,), + origin=self.origin, level=L_LOG, src=2) def __getattr__(self, name): return sys.__stdout__.__getattribute__(name) - -def dbg(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_DBG, 2, messages, named_items) - -def log(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_LOG, 2, messages, named_items) - -def err(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_ERR, 2, messages, named_items) - -def trace(origin, category, exc_info): - _log_all_targets(origin, category, L_TRACEBACK, None, - traceback.format_exception(*exc_info)) - -def resolve_category(origin, category): - if category is not None: - return category - if not hasattr(origin, '_log_category'): - return None - return origin._log_category - -def exn_add_info(exc_info, origin, category=None): - etype, exception, tb = exc_info - if not hasattr(exception, 'origins'): - exception.origins = Origins() - if not hasattr(exception, 'category'): - # only remember the deepest category - exception.category = resolve_category(origin, category) - if not hasattr(exception, 'src'): - exception.src = get_src_from_tb(tb) - exception.origins.add(origin) - return False - -def log_exn(origin=None, category=None, exc_info=None): - if not (exc_info is not None and len(exc_info) == 3): +def trace(exc_info=None, origin=None): + if exc_info is None: exc_info = sys.exc_info() - if not (exc_info is not None and len(exc_info) == 3): - raise RuntimeError('invalid call to log_exn() -- no valid exception info') + if origin is None: + origin = Origin.find_in_exc_info(exc_info) + _log(messages=traceback.format_exception(*exc_info), + origin=origin, level=L_TRACEBACK) + +def log_exn(): + exc_info = sys.exc_info() + origin = Origin.find_in_exc_info(exc_info) etype, exception, tb = exc_info - - # if there are origins recorded with the Exception, prefer that - if hasattr(exception, 'origins'): - origin = exception.origins - - # if there is a category recorded with the Exception, prefer that - if hasattr(exception, 'category'): - category = exception.category - if hasattr(exception, 'msg'): msg = exception.msg else: msg = str(exception) - if hasattr(exception, 'src'): - src = exception.src - else: - src = 2 - - trace(origin, category, exc_info) - _log_all_targets(origin, category, L_ERR, src, - ('%s:' % str(etype.__name__), msg)) - - -class Origins(list): - def __init__(self, origin=None): - if origin is not None: - self.add(origin) - - def add(self, origin): - if hasattr(origin, 'name'): - origin_str = origin.name() - else: - origin_str = repr(origin) - if origin_str is None: - raise RuntimeError('origin_str is None for %r' % origin) - self.insert(0, origin_str) - - def __str__(self): - return '?'.join(self) + trace(exc_info, origin=origin) + _log(messages=('%s:' % str(etype.__name__), msg), + origin=origin, level=L_ERR, src=get_src_from_exc_info(exc_info)) def set_all_levels(level): diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index fc9bba4..67659e1 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -139,12 +139,14 @@ Related: https://github.com/LEW21/pydbus/issues/56 ''' + modem_path = None + watch_props_subscription = None + _dbus_obj = None + interfaces = None + def __init__(self, modem_path): self.modem_path = modem_path - self.set_name(self.modem_path) - self.set_log_category(log.C_BUS) - self.watch_props_subscription = None - self._dbus_obj = None + super().__init__(log.C_BUS, self.modem_path) self.interfaces = set() # A dict listing signal handlers to connect, e.g. @@ -175,7 +177,7 @@ try: return self.dbus_obj()[interface_name] except KeyError: - self.raise_exn('Modem interface is not available:', interface_name) + raise log.Error('Modem interface is not available:', interface_name) def signal(self, interface_name, signal): return getattr(self.interface(interface_name), signal) @@ -310,8 +312,7 @@ def __init__(self, conf): self.conf = conf self.path = conf.get('path') - self.set_name(self.path) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, self.path) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 @@ -371,8 +372,7 @@ def imsi(self): imsi = self.conf.get('imsi') if not imsi: - with self: - raise RuntimeError('No IMSI') + raise log.Error('No IMSI') return imsi def ki(self): diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 7753395..5447118 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -31,10 +31,9 @@ bts = None def __init__(self, suite_run, msc, ip_address): + super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-bsc_%s' % ip_address.get('addr')) self.bts = [] self.msc = msc diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 0b717fa..b5a947f 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -29,8 +29,7 @@ class OsmoCtrl(log.Origin): def __init__(self, host, port): - self.set_name('Ctrl', host=host, port=port) - self.set_log_category(log.C_BUS) + super().__init__(log.C_BUS, 'Ctrl', host=host, port=port) self.host = host self.port = port self.sck = None @@ -79,12 +78,10 @@ self._send(getmsg) def __enter__(self): - super().__enter__() self.connect() return self def __exit__(self, *exc_info): self.disconnect() - super().__exit__(*exc_info) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 3492f06..110faa5 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -32,10 +32,9 @@ next_subscriber_id = 1 def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-hlr_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -47,16 +46,16 @@ binary = inst.child('bin', 'osmo-hlr') if not os.path.isfile(binary): - self.raise_exn('Binary missing:', binary) + raise log.Error('Binary missing:', binary) lib = inst.child('lib') if not os.path.isdir(lib): - self.raise_exn('No lib/ in', inst) + raise log.Error('No lib/ in', inst) # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') if not os.path.isfile(sql_input): - self.raise_exn('hlr.sql missing:', sql_input) + raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) iface = util.ip_to_iface(self.addr()) @@ -96,13 +95,13 @@ return not self.process.terminated() def run_local(self, name, popen_args): - with self: - run_dir = self.run_dir.new_dir(name) - proc = process.Process(name, run_dir, popen_args) - proc.launch() - proc.wait() - if proc.result != 0: - proc.raise_exn('Exited in error') + run_dir = self.run_dir.new_dir(name) + proc = process.Process(name, run_dir, popen_args) + proc.launch() + proc.wait() + if proc.result != 0: + log.ctx(proc) + raise log.Error('Exited in error') def run_sql_file(self, name, sql_file): self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 3e722fb..b385274 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -30,10 +30,9 @@ process = None def __init__(self, suite_run, ip_address, bts_ip): + super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-mgcpgw_%s' % ip_address.get('addr')) # hack: so far mgcpgw needs one specific BTS IP. self.bts_ip = bts_ip diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 3a822f1..443b254 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -32,10 +32,9 @@ config = None def __init__(self, suite_run, hlr, mgcpgw, 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.set_log_category(log.C_RUN) - self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw @@ -100,12 +99,11 @@ def imsi_attached(self, *imsis): attached = self.imsi_list_attached() - self.dbg('attached:', attached) + log.dbg('attached:', attached) return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoMscCtrl(self).subscriber_list_active() + return OsmoMscCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -117,8 +115,7 @@ def __init__(self, msc): self.msc = msc - self.set_name('CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) - self.set_child_of(msc) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.msc.addr(), self.PORT) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b4bf247..3104842 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -32,10 +32,9 @@ bts = None def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -106,8 +105,7 @@ msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - with self: - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -118,8 +116,7 @@ return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoNitbCtrl(self).subscriber_list_active() + return OsmoNitbCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -133,8 +130,7 @@ def __init__(self, nitb): self.nitb = nitb - self.set_name('CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) - self.set_child_of(nitb) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.nitb.addr(), OsmoNitbCtrl.PORT) diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index f3b1e6a..398ec6c 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -27,14 +27,13 @@ class PcapRecorder(log.Origin): def __init__(self, suite_run, run_dir, iface=None, filters=''): - self.suite_run = suite_run - self.run_dir = run_dir self.iface = iface if not self.iface: self.iface = "any" self.filters = filters - self.set_log_category(log.C_RUN) - self.set_name('pcap-recorder_%s' % self.iface) + super().__init__(log.C_RUN, 'pcap-recorder_%s' % self.iface, filters=self.filters) + self.suite_run = suite_run + self.run_dir = run_dir self.start() def start(self): diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e5d38f3..d24bf3d 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -33,9 +33,8 @@ killed = None def __init__(self, name, run_dir, popen_args, **popen_kwargs): + super().__init__(log.C_RUN, name) self.name_str = name - self.set_name(name) - self.set_log_category(log.C_RUN) self.run_dir = run_dir self.popen_args = popen_args self.popen_kwargs = popen_kwargs @@ -62,23 +61,21 @@ return f def launch(self): - with self: + log.dbg('cd %r; %s %s' % ( + os.path.abspath(str(self.run_dir)), + ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), + ' '.join(self.popen_args))) - self.dbg('cd %r; %s %s' % ( - os.path.abspath(str(self.run_dir)), - ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), - ' '.join(self.popen_args))) - - self.process_obj = subprocess.Popen( - self.popen_args, - stdout=self.make_output_log('stdout'), - stderr=self.make_output_log('stderr'), - stdin=subprocess.PIPE, - shell=False, - cwd=self.run_dir.path, - **self.popen_kwargs) - self.set_name(self.name_str, pid=self.process_obj.pid) - self.log('Launched') + self.process_obj = subprocess.Popen( + self.popen_args, + stdout=self.make_output_log('stdout'), + stderr=self.make_output_log('stderr'), + stdin=subprocess.PIPE, + shell=False, + cwd=self.run_dir.path, + **self.popen_kwargs) + self.set_name(self.name_str, pid=self.process_obj.pid) + self.log('Launched') def _poll_termination(self, time_to_wait_for_term=5): wait_step = 0.001 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7cc32bb..dbfc4e0 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -83,7 +83,7 @@ def __init__(self): self.config_path = config.get_config_file(RESOURCES_CONF) self.state_dir = config.get_state_dir() - self.set_name(conf=self.config_path, state=self.state_dir.path) + super().__init__(log.C_CNF, conf=self.config_path, state=self.state_dir.path) self.read_conf() def read_conf(self): @@ -158,6 +158,7 @@ return ReservedResources(self, origin, to_be_reserved) def free(self, origin, to_be_freed): + log.ctx(origin) with self.state_dir.lock(origin.origin_id()): rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE) reserved = Resources(config.read(rrfile_path, if_missing_return={})) @@ -202,19 +203,19 @@ with self.state_dir.lock(origin_id): msisdn_path = self.state_dir.child(LAST_USED_MSISDN_FILE) - with log.Origin(msisdn_path): - last_msisdn = '1000' - if os.path.exists(msisdn_path): - if not os.path.isfile(msisdn_path): - raise RuntimeError('path should be a file but is not: %r' % msisdn_path) - with open(msisdn_path, 'r') as f: - last_msisdn = f.read().strip() - schema.msisdn(last_msisdn) + log.ctx(msisdn_path) + last_msisdn = '1000' + if os.path.exists(msisdn_path): + if not os.path.isfile(msisdn_path): + raise RuntimeError('path should be a file but is not: %r' % msisdn_path) + with open(msisdn_path, 'r') as f: + last_msisdn = f.read().strip() + schema.msisdn(last_msisdn) - next_msisdn = util.msisdn_inc(last_msisdn) - with open(msisdn_path, 'w') as f: - f.write(next_msisdn) - return next_msisdn + next_msisdn = util.msisdn_inc(last_msisdn) + with open(msisdn_path, 'w') as f: + f.write(next_msisdn) + return next_msisdn class NoResourceExn(Exception): diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index fb27f32..d652aa7 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -124,9 +124,9 @@ validate_item(path, list_v, schema) return - with log.Origin(item=path): - type_validator = SCHEMA_TYPES.get(want_type) - type_validator(value) + log.ctx(path) + type_validator = SCHEMA_TYPES.get(want_type) + type_validator(value) def nest(parent_path, config, schema): if parent_path: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 55f81b1..eeaf7df 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -49,9 +49,8 @@ def __init__(self, suite_dir): - self.set_log_category(log.C_CNF) self.suite_dir = suite_dir - self.set_name(os.path.basename(self.suite_dir)) + super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) self.read_conf() def read_conf(self): @@ -78,12 +77,10 @@ FAIL = 'FAIL' def __init__(self, suite_run, test_basename): - self.suite_run = suite_run self.basename = test_basename + super().__init__(log.C_TST, self.basename) + self.suite_run = suite_run self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) - super().__init__(self.path) - self.set_name(self.basename) - self.set_log_category(log.C_TST) self.status = Test.UNKNOWN self.start_timestamp = 0 self.duration = 0 @@ -92,16 +89,15 @@ def run(self): try: - with self: - log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() except Exception as e: if hasattr(e, 'msg'): msg = e.msg @@ -110,14 +106,14 @@ if isinstance(e, AssertionError): # AssertionError lacks further information on what was # asserted. Find the line where the code asserted: - msg += log.get_src_from_tb(sys.exc_info()[2]) + msg += log.get_src_from_exc_info(sys.exc_info()) # add source file information to failure report if hasattr(e, 'origins'): msg += ' [%s]' % e.origins tb_str = traceback.format_exc() if isinstance(e, resource.NoResourceExn): tb_str += self.suite_run.resource_status_str() - self.set_fail(type(e).__name__, msg, tb_str) + self.set_fail(type(e).__name__, msg, tb_str, log.get_src_from_exc_info()) except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TEST RUN ABORTED: %s' % type(e).__name__) @@ -129,7 +125,7 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb_str=None): + def set_fail(self, fail_type, fail_message, tb_str=None, src=4): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type @@ -140,9 +136,9 @@ tb_str = ''.join(traceback.format_stack()[:-1]) self.fail_tb = tb_str - self.err('%s: %s' % (self.fail_type, self.fail_message)) + self.err('%s: %s' % (self.fail_type, self.fail_message), _src=src) if self.fail_tb: - self.trace(self.fail_tb) + self.log(self.fail_tb, _level=log.L_TRACEBACK) self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): @@ -171,11 +167,10 @@ _processes = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + super().__init__(log.C_TST, suite_scenario_str) self.trial = trial self.definition = suite_definition self.scenarios = scenarios - self.set_name(suite_scenario_str) - self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() @@ -201,18 +196,18 @@ self.status = SuiteRun.UNKNOWN def combined(self, conf_name): - self.dbg(combining=conf_name) - with log.Origin(combining_scenarios=conf_name): - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) - self.dbg(definition_conf=combination) - for scenario in self.scenarios: - with scenario: - c = scenario.get(conf_name) - self.dbg(scenario=scenario.name(), conf=c) - if c is None: - continue - config.combine(combination, c) - return combination + log.dbg(combining=conf_name) + log.ctx(combining_scenarios=conf_name) + combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + log.dbg(definition_conf=combination) + for scenario in self.scenarios: + log.ctx(combining_scenarios=conf_name, scenario=scenario.name()) + c = scenario.get(conf_name) + log.dbg(scenario=scenario.name(), conf=c) + if c is None: + continue + config.combine(combination, c) + return combination def resource_requirements(self): if self._resource_requirements is None: @@ -232,19 +227,18 @@ def run_tests(self, names=None): try: - with self: - log.large_separator(self.trial.name(), self.name(), sublevel=2) - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.tests: - if names and not test.name() in names: - test.set_skip() - continue - test.run() + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() except Exception: - self.log_exn() + log.log_exn() except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('SUITE RUN ABORTED: %s' % type(e).__name__) @@ -355,7 +349,8 @@ if process.terminated(): process.log_stdout_tail() process.log_stderr_tail() - process.raise_exn('Process ended prematurely') + log.ctx(process) + raise log.Error('Process ended prematurely') def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index 33ce2f6..0ddfc84 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -26,7 +26,7 @@ from .util import dict2obj _lookup = None -_logger = log.Origin('no templates dir set') +_logger = log.Origin(log.C_CNF, 'no templates dir set') def set_templates_dir(*templates_dirs): global _lookup @@ -39,7 +39,7 @@ raise RuntimeError('templates dir is not a dir: %r' % os.path.abspath(d)) _lookup = TemplateLookup(directories=templates_dirs) - _logger = log.Origin('Templates', category=log.C_CNF) + _logger = log.Origin(log.C_CNF, 'Templates') def render(name, values): '''feed values dict into template and return rendered result. @@ -48,11 +48,11 @@ if _lookup is None: set_templates_dir() tmpl_name = name + '.tmpl' - with log.Origin(tmpl_name): - template = _lookup.get_template(tmpl_name) - _logger.dbg('rendering', tmpl_name) + log.ctx(tmpl_name) + template = _lookup.get_template(tmpl_name) + _logger.dbg('rendering', tmpl_name) - line_info_name = tmpl_name.replace('-', '_').replace('.', '_') - return template.render(**dict2obj(values)) + line_info_name = tmpl_name.replace('-', '_').replace('.', '_') + return template.render(**dict2obj(values)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 741f3a7..d54e96c 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -57,8 +57,7 @@ def __init__(self, trial_dir): self.path = os.path.abspath(trial_dir) - self.set_name(os.path.basename(self.path)) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, os.path.basename(self.path)) self.dir = util.Dir(self.path) self.inst_dir = util.Dir(self.dir.child('inst')) self.bin_tars = [] @@ -69,7 +68,8 @@ return self.name() def __enter__(self): - # add a log target to log to the run dir + '''add a log target to log to the run dir, write taken marker, log a + starting separator.''' run_dir = self.get_run_dir() detailed_log = run_dir.new_child(FILE_LOG) self.log_targets = [ @@ -82,11 +82,10 @@ log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() - super().__enter__() return self def __exit__(self, *exc_info): - super().__exit__(*exc_info) + '''log a report, then remove log file targets for this trial''' self.log_report() for lt in self.log_targets: lt.remove() @@ -195,6 +194,8 @@ except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + # log the traceback before the trial's logging is ended + log.log_exn() raise finally: if suite_run.status != suite.SuiteRun.PASS: -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 4 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 Tue Jun 13 11:33:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:33:26 +0000 Subject: libosmocore[master]: ctrl_test.c: fix build with GCC 7.1.1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 11:34:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:34:41 +0000 Subject: libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2876/1/src/viterbi.c File src/viterbi.c: Line 378: vdec_free(trellis->sums); I would rather change vdec_free() to accept NULL as a valid argument. Keeps the code cleaner. Line 381: free(trellis->vals); free() on NULL is perfectly legal -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Tue Jun 13 11:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:34:59 +0000 Subject: libosmocore[master]: sim/core.c: drop useless double assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 11:36:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:36:16 +0000 Subject: libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 11:37:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:37:01 +0000 Subject: libosmocore[master]: core/conv/conv.c: drop useless assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 11:39:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:39:04 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/2825/4/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py File tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py: Line 2 since the code seems to work with python2 as well as python3, why not go for python without specifying a version number here? -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 13 11:39:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:39:47 +0000 Subject: osmo-gsm-manuals[master]: all: show 'DRAFT' in page header, disable DRAFT watermark In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142 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 Tue Jun 13 11:39:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:39:57 +0000 Subject: osmo-gsm-manuals[master]: all: show 'DRAFT' watermark on the first page In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia71795481c2467aab11ab344517df74775b2a852 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 Tue Jun 13 11:40:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:40:00 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: all: show 'DRAFT' watermark on the first page In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: all: show 'DRAFT' watermark on the first page ...................................................................... all: show 'DRAFT' watermark on the first page Unconditionally show a 'DRAFT' watermark only on the first page of each document. I would have liked to make this conditional based on the BUILD_RELEASE=* variable, but could not figure out how to switch off a .sty code segment based on command line parameters. Since we only seem to render all manuals in DRAFT mode all the time, it seems reasonable to include the DRAFT watermark always, requiring manual .sty editing if anyone wanted to build a non-DRAFT version. In the makefile, add an echo to say so in case of non-draft builds. Change-Id: Ia71795481c2467aab11ab344517df74775b2a852 --- M build/Makefile.asciidoc.inc M build/custom-dblatex.sty 2 files changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 82721ff..56a6ed9 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -29,7 +29,14 @@ all: $(ASCIIDOCPDFS) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +.PHONY: hint_to_remove_draft_mode +hint_to_remove_draft_mode: + @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" \ + || true + +$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc hint_to_remove_draft_mode a2x $(A2X_OPTS) $< || asciidoc -v $(ASCIIDOC_OPTS) $< check: $(ASCIIDOC_CHECKS) diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty index a3822b5..41e7c70 100644 --- a/build/custom-dblatex.sty +++ b/build/custom-dblatex.sty @@ -19,6 +19,10 @@ \usepackage{alltt} \usepackage{upquote} +% "DRAFT" on first page +\definecolor{LtGrey}{rgb}{0.875,0.875,0.875} +\AddToShipoutPicture*{ \AtTextCenter{ \makebox(0,0)[c]{\resizebox{\textwidth}{!}{ \rotatebox{45}{\textsf{\textbf{\color{LtGrey}DRAFT}}}}} } } + \def\Company{sysmocom - s.f.m.c. GmbH} \def\DBKcover{ -- To view, visit https://gerrit.osmocom.org/2839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia71795481c2467aab11ab344517df74775b2a852 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 Jun 13 11:40:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 11:40:01 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: all: show 'DRAFT' in page header, disable DRAFT watermark In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: all: show 'DRAFT' in page header, disable DRAFT watermark ...................................................................... all: show 'DRAFT' in page header, disable DRAFT watermark The 'DRAFT' watermark in the page background is a hindrance when trying to copy-paste text from the rendered PDFs. It segments the texts so that many code lines cannot be marked in whole to copy. So drop the watermark and instead just show 'DRAFT' in the page header. Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142 --- M build/Makefile.asciidoc.inc 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index fad91fa..82721ff 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -16,15 +16,15 @@ cleanfiles += $(ASCIIDOCPDFS) ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes +DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0 ifeq (,$(BUILD_RELEASE)) - DBLATEX_OPTS += -P draft.watermark=1 + REVNUMBER := DRAFT $(GIT_VERSION) else - DBLATEX_OPTS += -P draft.watermark=0 + REVNUMBER := $(GIT_VERSION) endif -A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(GIT_VERSION)" -a revdate="$(GIT_DATE)" +A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)" all: $(ASCIIDOCPDFS) -- To view, visit https://gerrit.osmocom.org/2838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie22cdddf46bf7640e7f027940a6db904bf639142 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 Jun 13 11:56:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 11:56:38 +0000 Subject: openbsc[master]: Fix BTS features length check In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/2900/1/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 493: if (m_id_len > _NUM_BTS_FEAT/8 + 1) shouldn't this be if (m_id_len > _NUM_BTS_FEAT/8) ? This patch allows m_id_len to be one larger than _NUM_BTS_FEAT/8. Should the /8 also get a comment? "NUM" sounds like an actual amount; in contrast, division by 8 seems to be some buffer size with each feature taking 8 bytes? Just asking because I'm not familiar... -- To view, visit https://gerrit.osmocom.org/2900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Tue Jun 13 12:06:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 12:06:20 +0000 Subject: osmo-ci[master]: Add .gitreview In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:06:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 12:06:26 +0000 Subject: osmo-ci[master]: Add .gitreview In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/2892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:06:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 12:06:28 +0000 Subject: [MERGED] osmo-ci[master]: Add .gitreview In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add .gitreview ...................................................................... Add .gitreview Simplify gerrit usage via .gitreview file. Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..859c88c --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-ci -- To view, visit https://gerrit.osmocom.org/2892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5e18e675230540c79673eaaf4dc2b75f1353f6d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:17:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 12:17:30 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) There is a benefit in avoiding code dup, but there is also a benefit in having a plain self-contained script and less code complexity. I would be fine with the minimal amount of copy-paste we have, but ok. What users do you have in mind? osmo-bts.git or others as well? https://gerrit.osmocom.org/#/c/2893/2/scripts/osmo-layer1-headers.sh File scripts/osmo-layer1-headers.sh: Line 28: exit 0 unless we already have such model that does not require headers, IMHO this should rather exit 1 -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:25:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 12:25:11 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 2: osmo-pcu could use it too. Initially I though it'd be called from jenkins_bts_model.sh regardless of a model, but to keep it compatible with osmo-gsm-tester it'll be called from per-BTS scripts so I'll adjust error code. -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:27:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 12:27:55 +0000 Subject: [PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2893 to look at the new patch set (#3). Add script for fetching BTS-specific L1 headers Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682 --- A scripts/osmo-layer1-headers.sh 1 file changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/3 diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh new file mode 100755 index 0000000..720c7a7 --- /dev/null +++ b/scripts/osmo-layer1-headers.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# -e: fail if any of the subsequent commands fail +# -x: trace each executed command via debug log +set -e -x + +# Usage: +# ./osmo-layer1-headers.sh sysmo superfemto_v5.1 +# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset) +# 2nd parameter is optional and defaults to latest master branch + +case "$1" in + sysmo) + uri="git://git.sysmocom.de/sysmo-bts/layer1-api" + version="origin/master" + ;; + oct) + uri="git://git.osmocom.org/octphy-2g-headers" + version="origin/master" + ;; + lc15) + uri="https://gitlab.com/nrw_litecell15/litecell15-fw" + version="nrw/litecell15-next" + ;; + *) + echo "Unknown BTS model '$1'" + exit 1 + ;; +esac + +# if 2nd parameter was specified and it's not 'master' than use it instead of default +if [ -n "$2" ] + if [ $2 != "master" ]; + then + version=$2 + fi +fi + +if ! test -d layer1-headers; +then + git clone $uri layer1-headers +fi + +cd layer1-headers +git fetch origin +git reset --hard $version -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:52:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 12:52:15 +0000 Subject: osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 4 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:56:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 12:56:30 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper 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/2891 to look at the new patch set (#6). lc15: add jenkins helper Add jenkins build helper for lc15 and separate header with BTS-agnostic functions. Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_common_prefix.sh A contrib/jenkins_lc15.sh 3 files changed, 64 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/6 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..c44daa7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -18,6 +18,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_common_prefix.sh b/contrib/jenkins_common_prefix.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common_prefix.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..a9a1687 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +. $(dirname "$0")/jenkins_common_prefix.sh + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE $PARALLEL_MAKE +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 12:56:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 12:56:30 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper 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/2894 to look at the new patch set (#6). Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 8 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/6 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..f02dd28 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,33 +1,13 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +. $(dirname "$0")/jenkins_common_prefix.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..84c039e 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,8 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +. $(dirname "$0")/jenkins_common_prefix.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..375c12a 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,31 +1,13 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +. $(dirname "$0")/jenkins_common_prefix.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..8c31e1d 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,8 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +. $(dirname "$0")/jenkins_common_prefix.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 13 13:05:29 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 13 Jun 2017 13:05:29 +0000 Subject: libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference In-Reply-To: References: Message-ID: Patch Set 1: > (2 comments) Thanks! working on it... -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Tue Jun 13 13:08:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 13:08:52 +0000 Subject: [PATCH] libosmocore[master]: Move NUM_BYTES macro to core library Message-ID: Review at https://gerrit.osmocom.org/2901 Move NUM_BYTES macro to core library It's universally useful so it make sense to have it in the shared core: * move macro from libosmocoding to libosmocore * add OSMO_ prefix * add doxygen docs Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/core/utils.h M src/coding/gsm0503_coding.c 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/2901/1 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index 55375bb..2f0e631 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -13,7 +13,6 @@ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) -#define NUM_BYTES(N) ((N + 8 - 1) / 8) enum gsm0503_egprs_mcs { EGPRS_MCS0, diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..9042f4b 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -19,6 +19,8 @@ #define OSMO_STRINGIFY(x) #x /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Number of bytes necessary to store given number of bits */ +#define OSMO_NUM_BYTES(N) ((N + 8 - 1) / 8) #include #include diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 7039863..ea9578a 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -901,7 +901,7 @@ u, 0, data_len, 1); /* Return the number of bytes required for the bit message */ - return NUM_BYTES(code->hdr_len + code->data_len); + return OSMO_NUM_BYTES(code->hdr_len + code->data_len); } /*! \brief Decode EGPRS UL message -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 13 13:15:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 13:15:23 +0000 Subject: [MERGED] osmo-gsm-tester[master]: fix and refactor logging: drop 'with', simplify In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix and refactor logging: drop 'with', simplify ...................................................................... fix and refactor logging: drop 'with', simplify With the recent fix of the junit report related issues, another issue arose: the 'with log.Origin' was changed to disallow __enter__ing an object twice to fix problems, now still code would fail because it tries to do 'with' on the same object twice. The only reason is to ensure that logging is associated with a given object. Instead of complicating even more, implement differently. Refactor logging to simplify use: drop the 'with Origin' style completely, and instead use the python stack to determine which objects are created by which, and which object to associate a log statement with. The new way: we rely on the convention that each class instance has a local 'self' referencing the object instance. If we need to find an origin as a new object's parent, or to associate a log message with, we traverse each stack frame, fetching the first local 'self' object that is a log.Origin class instance. How to use: Simply call log.log() anywhere, and it finds an Origin object to log for, from the stack. Alternatively call self.log() for any Origin() object to skip the lookup. Create classes as child class of log.Origin and make sure to call super().__init__(category, name). This constructor will magically find a parent Origin on the stack. When an exception happens, we first escalate the exception up through call scopes to where ever it is handled by log.log_exn(). This then finds an Origin object in the traceback's stack frames, no need to nest in 'with' scopes. Hence the 'with log.Origin' now "happens implicitly", we can write pure natural python code, no more hassles with scope ordering. Furthermore, any frame can place additional logging information in a frame by calling log.ctx(). This is automatically inserted in the ancestry associated with a log statement / exception. Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 --- M selftest/config_test.ok M selftest/log_test.ok M selftest/log_test.py M selftest/resource_test.ok M selftest/resource_test.py M selftest/suite_test.ok M selftest/suite_test.py M selftest/template_test.ok M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/event_loop.py M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_ctrl.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/template.py M src/osmo_gsm_tester/trial.py 27 files changed, 444 insertions(+), 456 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/config_test.ok b/selftest/config_test.ok index 40a5dcb..80b5a06 100644 --- a/selftest/config_test.ok +++ b/selftest/config_test.ok @@ -54,42 +54,42 @@ --- -: ERR: ValueError: config item not known: 'a_dict[]' Validation: Error - unknown band: ---- (item='bts[].trx[].band'): ERR: ValueError: Unknown GSM band: 'what' +--- bts[].trx[].band: ERR: ValueError: Unknown GSM band: 'what' Validation: Error - invalid v4 addrs: ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '1.2.3 .4' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '91.2.3' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '91.2.3' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: 'go away' +--- addr[]: ERR: ValueError: Invalid IPv4 address: 'go away' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: '' +--- addr[]: ERR: ValueError: Invalid IPv4 address: '' Validation: Error ---- (item='addr[]'): ERR: ValueError: Invalid IPv4 address: None +--- addr[]: ERR: ValueError: Invalid IPv4 address: None Validation: Error - invalid hw addrs: ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '1.2.3' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '1.2.3' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e:0f:0g' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '0b:0c:0d:0e : 0f:0f' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: 'go away' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: 'go away' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: '' +--- hwaddr[]: ERR: ValueError: Invalid hardware address: '' Validation: Error ---- (item='hwaddr[]'): ERR: ValueError: Invalid hardware address: None +--- hwaddr[]: ERR: ValueError: Invalid hardware address: None Validation: Error - invalid imsis: ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '99999999x9' +--- imsi[]: ERR: ValueError: Invalid IMSI: '99999999x9' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '123 456 789 123' +--- imsi[]: ERR: ValueError: Invalid IMSI: '123 456 789 123' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: 'go away' +--- imsi[]: ERR: ValueError: Invalid IMSI: 'go away' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: '' +--- imsi[]: ERR: ValueError: Invalid IMSI: '' Validation: Error ---- (item='imsi[]'): ERR: ValueError: Invalid IMSI: None +--- imsi[]: ERR: ValueError: Invalid IMSI: None Validation: Error diff --git a/selftest/log_test.ok b/selftest/log_test.ok index 7ed94a0..17198b7 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -32,10 +32,9 @@ 01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110] 01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113] - Testing logging of Exceptions, tracing origins -Not throwing an exception in 'with:' works. nested print just prints -01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:145] -01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:146] -01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:147: raise ValueError('bork')] -- Enter the same Origin context twice +01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:135] +01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:136] +01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:137: raise ValueError('bork')] +- Disallow origin loops disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 7670c8e..9136906 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -32,20 +32,20 @@ log.set_all_levels(None) print('- Testing global log functions') -log.log('', log.C_TST, 'from log.log()') -log.dbg('', log.C_TST, 'from log.dbg(), not seen') +log.log('from log.log()', _origin='', _category=log.C_TST) +log.dbg('from log.dbg(), not seen', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_DBG) -log.dbg('', log.C_TST, 'from log.dbg()') +log.dbg('from log.dbg()', _origin='', _category=log.C_TST) log.set_level(log.C_TST, log.L_LOG) -log.err('', log.C_TST, 'from log.err()') +log.err('from log.err()', _origin='', _category=log.C_TST) print('- Testing log.Origin functions') class LogTest(log.Origin): - pass + def __init__(self, *name_items, **detail_items): + super().__init__(log.C_TST, *name_items, **detail_items) -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('some', 'name', some="detail") +t = LogTest('some', 'name', some="detail") + t.log("hello log") t.err("hello err") @@ -86,10 +86,10 @@ log.style_change(origin=True) t.dbg("add origin") +# some space to keep source line numbers identical to previous code + print('- Testing origin_width') -t = LogTest() -t.set_log_category(log.C_TST) -t.set_name('shortname') +t = LogTest('shortname') log.style(origin_width=23, time_fmt=fake_time) t.log("origin str set to 23 chars") t.set_name('very long name', some='details', and_some=(3, 'things', 'in a tuple')) @@ -97,16 +97,16 @@ t.dbg("long origin str dbg") t.err("long origin str err") + print('- Testing log.Origin with omitted info') t = LogTest() -t.set_log_category(log.C_TST) t.log("hello log, name implicit from class name") -t = LogTest() -t.set_name('explicit_name') +t = LogTest('explicit_name') +t._set_log_category(None) t.log("hello log, no category set") - t = LogTest() +t._set_log_category(None) t.log("hello log, no category nor name set") t.dbg("hello log, no category nor name set, not seen") log.set_level(log.C_DEFAULT, log.L_DBG) @@ -117,47 +117,37 @@ class Thing(log.Origin): def __init__(self, some_path): - self.set_log_category(log.C_TST) - self.set_name(some_path) + super().__init__(log.C_TST, some_path) def say(self, msg): print(msg) -#log.style_change(trace=True) + def l1(self): + level2 = Thing('level2') + level2.l2() -with Thing('print_redirected'): - print("Not throwing an exception in 'with:' works.") + def l2(self): + level3 = Thing('level3') + level3.l3(self) -def l1(): - level1 = Thing('level1') - with level1: - l2() - -def l2(): - level2 = Thing('level2') - with level2: - l3(level2) - -def l3(level2): - level3 = Thing('level3') - with level3: + def l3(self, level2): print('nested print just prints') - level3.log('nested log()') + self.log('nested log()') level2.log('nested l2 log() from within l3 scope') raise ValueError('bork') try: - l1() + level1 = Thing('level1') + level1.l1() except Exception: log.log_exn() -print('- Enter the same Origin context twice') +print('- Disallow origin loops') try: t = Thing('foo') - with t: - with t: - raise RuntimeError('this should not be reached') -except AssertionError: + t._set_parent(t) + raise RuntimeError('this should not be reached') +except log.OriginLoopError: print('disallowed successfully') pass diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index cdc3519..d366cf9 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -13,8 +13,8 @@ cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./test_work/state_dir is [PATH]/selftest/conf/test_work/state_dir cnf -: DBG: [PATH]/selftest/conf/paths.conf: relative path ./suite_test is [PATH]/selftest/conf/suite_test cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf -cnf -: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/conf/resources.conf in ./conf which is [PATH]/selftest/conf +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/conf/test_work/state_dir *** all resources: {'arfcn': [{'_hash': 'e620569450f8259b3f0212ec19c285dd07df063c', 'arfcn': '512', diff --git a/selftest/resource_test.py b/selftest/resource_test.py index c78485e..a0ec490 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -78,7 +78,7 @@ 'modem': [ { 'times': 2 } ], } -origin = log.Origin('testowner') +origin = log.Origin(None, 'testowner') resources = pool.reserve(origin, want) diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 54c950a..2808474 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -7,7 +7,7 @@ - no suite.conf cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf empty_dir: DBG: reading suite.conf ---- [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' +cnf [PATH]/selftest/suite_test/empty_dir/suite.conf: ERR: FileNotFoundError: [Errno 2] No such file or directory: '[PATH]/selftest/suite_test/empty_dir/suite.conf' [empty_dir?[PATH]/selftest/suite_test/empty_dir/suite.conf] - valid suite dir cnf -: DBG: Found path suites_dir as [PATH]/selftest/suite_test cnf test_suite: DBG: reading suite.conf @@ -22,15 +22,15 @@ - times: '2' - run hello world test -cnf -: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test -cnf -: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir +cnf ResourcesPool: DBG: Found config file resources.conf as [PATH]/selftest/suite_test/resources.conf in ./suite_test which is [PATH]/selftest/suite_test +cnf ResourcesPool: DBG: Found path state_dir as [PATH]/selftest/suite_test/test_work/state_dir --------------------------------------------------------------------- trial test_suite --------------------------------------------------------------------- tst test_suite: reserving resources in [PATH]/selftest/suite_test/test_work/state_dir ... tst test_suite: DBG: {combining='resources'} -tst test_suite: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?(combining_scenarios='resources')?test_suite] +tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 1 x bts (candidates: 3) tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 addr: 10.42.42.114 @@ -83,7 +83,7 @@ trial test_suite test_error.py ---------------------------------------------- tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] -tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] +tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]: assert False] tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -92,7 +92,7 @@ skip: hello_world.py (N.N sec) skip: mo_mt_sms.py skip: mo_sms.py - FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False [test_error.py:[LINENR]] + FAIL: test_error.py (N.N sec) AssertionError: test_error.py:[LINENR]: assert False skip: test_fail.py skip: test_fail_raise.py @@ -106,7 +106,7 @@ trial test_suite test_fail.py ---------------------------------------------- tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] -tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -128,7 +128,7 @@ ---------------------------------------------- trial test_suite test_fail_raise.py ---------------------------------------------- -tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] +tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]: raise ExpectedFail('This failure is expected')] tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [suite.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL @@ -139,6 +139,6 @@ skip: mo_sms.py skip: test_error.py (N.N sec) skip: test_fail.py (N.N sec) - FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected [test_fail_raise.py:[LINENR]] + FAIL: test_fail_raise.py (N.N sec) ExpectedFail: This failure is expected - graceful exit. diff --git a/selftest/suite_test.py b/selftest/suite_test.py index 2a92f47..86c4c25 100755 --- a/selftest/suite_test.py +++ b/selftest/suite_test.py @@ -20,7 +20,7 @@ print(config.tostr(s_def.conf)) print('- run hello world test') -trial = log.Origin('trial') +trial = log.Origin(log.C_TST, 'trial') s = suite.SuiteRun(trial, 'test_suite', s_def) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) diff --git a/selftest/template_test.ok b/selftest/template_test.ok index d031c96..1267dac 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -1,5 +1,5 @@ - Testing: fill a config file with values -cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl [osmo-nitb.cfg.tmpl?Templates] +cnf Templates: DBG: rendering osmo-nitb.cfg.tmpl ! Configuration rendered by osmo-gsm-tester password foo ! diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 0083512..7d12c85 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -36,10 +36,9 @@ CONF_BTS_TRX = 'osmo-bts-trx.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX) self.suite_run = suite_run self.conf = conf - self.set_name(OsmoBtsTrx.BIN_BTS_TRX) - self.set_log_category(log.C_RUN) self.env = {} def remote_addr(self): diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 5f2b3cb..30fff0e 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -35,52 +35,50 @@ BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg' def __init__(self, suite_run, conf): + super().__init__(log.C_RUN, self.BTS_SYSMO_BIN) self.suite_run = suite_run self.conf = conf - self.set_name('osmo-bts-sysmo') - self.set_log_category(log.C_RUN) self.remote_env = {} self.remote_user = 'root' def start(self): - with self: - if self.bsc is None: - raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') - self.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) - self.configure() + if self.bsc is None: + raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') + log.log('Starting sysmoBTS to connect to', self.bsc) + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) - lib = self.inst.child('lib') - if not os.path.isdir(lib): - self.raise_exn('No lib/ in', self.inst) - if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): - self.raise_exn('No osmo-bts-sysmo binary in', self.inst) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) + lib = self.inst.child('lib') + if not os.path.isdir(lib): + raise log.Error('No lib/ in', self.inst) + if not self.inst.isfile('bin', SysmoBts.BTS_SYSMO_BIN): + raise log.Error('No osmo-bts-sysmo binary in', self.inst) - self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) - self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) + self.remote_dir = util.Dir(SysmoBts.REMOTE_DIR) + self.remote_inst = util.Dir(self.remote_dir.child(os.path.basename(str(self.inst)))) - self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) - self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) - self.run_local('scp-inst-to-sysmobts', - ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) + self.run_remote('rm-remote-dir', ('test', '!', '-d', SysmoBts.REMOTE_DIR, '||', 'rm', '-rf', SysmoBts.REMOTE_DIR)) + self.run_remote('mk-remote-dir', ('mkdir', '-p', SysmoBts.REMOTE_DIR)) + self.run_local('scp-inst-to-sysmobts', + ('scp', '-r', str(self.inst), '%s@%s:%s' % (self.remote_user, self.remote_addr(), str(self.remote_inst)))) - remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) - self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) + remote_run_dir = self.remote_dir.child(SysmoBts.BTS_SYSMO_BIN) + self.run_remote('mk-remote-run-dir', ('mkdir', '-p', remote_run_dir)) - remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) - self.run_local('scp-cfg-to-sysmobts', - ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) + remote_config_file = self.remote_dir.child(SysmoBts.BTS_SYSMO_CFG) + self.run_local('scp-cfg-to-sysmobts', + ('scp', '-r', self.config_file, '%s@%s:%s' % (self.remote_user, self.remote_addr(), remote_config_file))) - self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) + self.run_remote('reload-dsp-firmware', ('/bin/sh', '-c', '"cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0"')) - remote_lib = self.remote_inst.child('lib') - remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') - self.launch_remote('osmo-bts-sysmo', - ('LD_LIBRARY_PATH=%s' % remote_lib, - remote_binary, '-c', remote_config_file, '-r', '1', - '-i', self.bsc.addr()), - remote_cwd=remote_run_dir) + remote_lib = self.remote_inst.child('lib') + remote_binary = self.remote_inst.child('bin', 'osmo-bts-sysmo') + self.launch_remote('osmo-bts-sysmo', + ('LD_LIBRARY_PATH=%s' % remote_lib, + remote_binary, '-c', remote_config_file, '-r', '1', + '-i', self.bsc.addr()), + remote_cwd=remote_run_dir) def _process_remote(self, name, popen_args, remote_cwd=None): run_dir = self.run_dir.new_dir(name) @@ -92,7 +90,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log.ctx(proc) + raise log.Error('Exited in error') def launch_remote(self, name, popen_args, remote_cwd=None): proc = self._process_remote(name, popen_args, remote_cwd) @@ -105,7 +104,8 @@ proc.launch() proc.wait() if proc.result != 0: - proc.raise_exn('Exited in error') + log.ctx(proc) + raise log.Error('Exited in error') def remote_addr(self): return self.conf.get('addr') diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 38d8e2f..20ae83e 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -95,7 +95,7 @@ real_l = os.path.realpath(l) p = os.path.realpath(os.path.join(real_l, basename)) if os.path.isfile(p): - log.dbg(None, log.C_CNF, 'Found config file', basename, 'as', p, 'in', l, 'which is', real_l) + log.dbg('Found config file', basename, 'as', p, 'in', l, 'which is', real_l, _category=log.C_CNF) return (p, real_l) if not fail_if_missing: return None, None @@ -122,7 +122,7 @@ env_path = os.getenv(env_name) if env_path: real_env_path = os.path.realpath(env_path) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path) + log.dbg('Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path, _category=log.C_CNF) return real_env_path if PATHS is None: @@ -132,15 +132,15 @@ for key, path in sorted(PATHS.items()): if not path.startswith(os.pathsep): PATHS[key] = os.path.realpath(os.path.join(found_in, path)) - log.dbg(None, log.C_CNF, paths_file + ': relative path', path, 'is', PATHS[key]) + log.dbg(paths_file + ': relative path', path, 'is', PATHS[key], _category=log.C_CNF) p = PATHS.get(label) if p is None and not allow_unset: raise RuntimeError('missing configuration in %s: %r' % (PATHS_CONF, label)) - log.dbg(None, log.C_CNF, 'Found path', label, 'as', p) + log.dbg('Found path', label, 'as', p, _category=log.C_CNF) if p.startswith(PATHS_TEMPDIR_STR): p = os.path.join(get_tempdir(), p[len(PATHS_TEMPDIR_STR):]) - log.dbg(None, log.C_CNF, 'Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p) + log.dbg('Path', label, 'contained', PATHS_TEMPDIR_STR, 'and becomes', p, _category=log.C_CNF) return p def get_state_dir(): @@ -153,20 +153,20 @@ return Dir(get_configured_path(PATH_SCENARIOS_DIR)) def read(path, validation_schema=None, if_missing_return=False): - with log.Origin(path): - if not os.path.isfile(path) and if_missing_return is not False: - return if_missing_return - with open(path, 'r') as f: - config = yaml.safe_load(f) - config = _standardize(config) - if validation_schema: - schema.validate(config, validation_schema) - return config + log.ctx(path) + if not os.path.isfile(path) and if_missing_return is not False: + return if_missing_return + with open(path, 'r') as f: + config = yaml.safe_load(f) + config = _standardize(config) + if validation_schema: + schema.validate(config, validation_schema) + return config def write(path, config): - with log.Origin(path): - with open(path, 'w') as f: - f.write(tostr(config)) + log.ctx(path) + with open(path, 'w') as f: + f.write(tostr(config)) def tostr(config): return _tostr(_standardize(config)) @@ -191,8 +191,7 @@ class Scenario(log.Origin, dict): def __init__(self, name, path): - self.set_name(name) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, name) self.path = path def get_scenario(name, validation_schema=None): @@ -216,8 +215,8 @@ if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - add(dest_val, val) + log.ctx(key=key) + add(dest_val, val) return if is_list(dest): if not is_list(src): @@ -235,19 +234,19 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log.ctx(key=key) dest_val = dest.get(key) if dest_val is None: dest[key] = val else: - with log.Origin(key=key): - combine(dest_val, val) + combine(dest_val, val) return 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)): - with log.Origin(idx=i): - combine(dest[i], src[i]) + log.ctx(idx=i) + combine(dest[i], src[i]) return if dest == src: return @@ -260,16 +259,16 @@ raise ValueError('cannot combine dict with a value of type: %r' % type(src)) for key, val in src.items(): + log.ctx(key=key) dest_val = dest.get(key) - with log.Origin(key=key): - dest[key] = overlay(dest_val, val) + dest[key] = overlay(dest_val, val) return dest 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)): - with log.Origin(idx=i): - dest[i] = overlay(dest[i], src[i]) + log.ctx(key=key) + dest[i] = overlay(dest[i], src[i]) return dest return src diff --git a/src/osmo_gsm_tester/event_loop.py b/src/osmo_gsm_tester/event_loop.py index c3c679b..6f64ef9 100644 --- a/src/osmo_gsm_tester/event_loop.py +++ b/src/osmo_gsm_tester/event_loop.py @@ -21,6 +21,8 @@ # A test script can thus establish its context by doing: # from osmo_gsm_tester.test import * import time +from . import log + poll_funcs = [] def register_poll_func(func): @@ -38,7 +40,8 @@ def wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): if not timeout or timeout < 0: - log_obj.raise_exn('wait() *must* time out at some point. timeout=%r' % timeout) + self = log_obj + raise log.Error('wait() *must* time out at some point.', timeout=timeout) if timestep < 0.1: timestep = 0.1 @@ -54,7 +57,8 @@ def wait(log_obj, condition, *condition_args, timeout=300, timestep=1, **condition_kwargs): if not wait_no_raise(log_obj, condition, condition_args, condition_kwargs, timeout, timestep): - log_obj.raise_exn('Wait timeout') + log.ctx(log_obj) + raise log.Error('Wait timeout') def sleep(log_obj, seconds): assert seconds > 0. diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index f098f2b..c4a6629 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -45,6 +45,41 @@ C_BUS = 'bus' C_DEFAULT = '---' +LOG_CTX_VAR = '_log_ctx_' + +def dbg(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on debug level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_DBG, src=_src) + +def log(*messages, _origin=None, _category=None, _level=L_LOG, _src=None, **named_items): + '''Log a message. The origin, an Origin class instance, is normally + determined by stack magic, only pass _origin to override. The category is + taken from the origin. _src is normally an integer indicating how many + levels up the stack sits the interesting source file to log about, can also + be a string. The log message is composed of all *messages and + **named_items, for example: + log('frobnicate:', thing, key=current_key, prop=erty) + ''' + _log(messages, named_items, origin=_origin, category=_category, level=_level, src=_src) + +def err(*messages, _origin=None, _category=None, _src=None, **named_items): + '''Log on error level. See also log()''' + _log(messages, named_items, origin=_origin, category=_category, level=L_ERR, src=_src) + +def _log(messages=[], named_items={}, origin=None, category=None, level=L_LOG, src=None): + if origin is None: + origin = Origin.find_on_stack() + if category is None and isinstance(origin, Origin): + category = origin._log_category + if src is None: + # two levels up + src = 2 + if isinstance(src, int): + src = get_src_from_caller(src + 1) + for target in LogTarget.all_targets: + target.log(origin, category, level, src, messages, named_items) + + LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' DATEFMT = '%H:%M:%S' @@ -52,7 +87,8 @@ get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) class Error(Exception): - pass + def __init__(self, *messages, **named_items): + super().__init__(compose_message(messages, named_items)) class LogTarget: all_targets = [] @@ -153,7 +189,7 @@ def log(self, origin, category, level, src, messages, named_items): if category and len(category) != 3: - self.log_write_func('WARNING: INVALID LOG SUBSYSTEM %r\n' % category) + self.log_write_func('WARNING: INVALID LOGGING CATEGORY %r\n' % category) self.log_write_func('origin=%r category=%r level=%r\n' % (origin, category, level)); if not category: @@ -172,14 +208,13 @@ if self.do_log_origin: if origin is None: name = '-' - elif isinstance(origin, Origins): - name = origin[-1] - if len(origin) > 1: - deeper_origins = str(origin) + elif isinstance(origin, Origin): + name = origin.name() + # only log ancestry when there is more than one + if origin._parent is not None: + deeper_origins = origin.ancestry_str() elif isinstance(origin, str): name = origin or None - elif hasattr(origin, 'name'): - name = origin.name() if not name: name = str(origin.__class__.__name__) log_pre.append(self.origin_fmt.format(name)) @@ -228,7 +263,7 @@ def _log_all_targets(origin, category, level, src, messages, named_items=None): if origin is None: - origin = Origin._global_current_origin + origin = Origin.find_on_stack() if isinstance(src, int): src = get_src_from_caller(src + 1) for target in LogTarget.all_targets: @@ -242,13 +277,17 @@ caller = getframeinfo(stack()[levels_up][0]) return '%s:%d' % (os.path.basename(caller.filename), caller.lineno) -def get_src_from_tb(tb, levels_up=1): - ftb = traceback.extract_tb(tb) +def get_src_from_exc_info(exc_info=None, levels_up=1): + if exc_info is None: + exc_info = sys.exc_info() + ftb = traceback.extract_tb(exc_info[2]) f,l,m,c = ftb[-levels_up] f = os.path.basename(f) return '%s:%s: %s' % (f, l, c) def get_line_for_src(src_path): + '''find a given source file on the stack and return the line number for + that file. (Used to indicate the position in a test script.)''' etype, exception, tb = sys.exc_info() if tb: ftb = traceback.extract_tb(tb) @@ -262,31 +301,112 @@ return caller.lineno return None +def ctx(*name_items, **detail_items): + '''Store log context in the current frame. This string will appear as + origin information for exceptions thrown within the calling scope.''' + if not name_items and not detail_items: + ctx_obj(None) + if not detail_items and len(name_items) == 1 and isinstance(name_items[0], Origin): + ctx_obj(name_items[0]) + else: + ctx_obj(compose_message(name_items, detail_items)) + +def ctx_obj(origin_or_str): + f = sys._getframe(2) + if origin_or_str is None: + f.f_locals.pop(LOG_CTX_VAR, None) + else: + f.f_locals[LOG_CTX_VAR] = origin_or_str + +class OriginLoopError(Error): + pass class Origin: ''' - Base class for all classes that want to log, - and to add an origin string to a code path: - with log.Origin('my name'): - raise Problem() - This will log 'my name' as an origin for the Problem. + Base class for all classes that want to appear in the log. + It is a simple named marker to find in the stack frames. + This depends on the object instance named 'self' in each member class. + + In addition, it provides a logging category and a globally unique ID for + each instance. + + Each child class *must* call super().__init__(category, name), to allow + noting its parent origins. ''' - _global_current_origin = None _global_id = None - _log_category = None - _src = None _name = None _origin_id = None + _log_category = None + _parent = None - _parent_origin = None + @staticmethod + def find_on_stack(except_obj=None, f=None): + if f is None: + f = sys._getframe(2) + log_ctx_obj = None + origin = None + while f is not None: + l = f.f_locals - def __init__(self, *name_items, category=None, **detail_items): - self.set_log_category(category) + # if there is a log_ctx in the scope, add it, pointing to the next + # actual Origin class in the stack + log_ctx = l.get(LOG_CTX_VAR) + if log_ctx: + if isinstance(log_ctx, Origin): + new_log_ctx_obj = log_ctx + else: + new_log_ctx_obj = Origin(None, log_ctx, find_parent=False) + if log_ctx_obj is None: + log_ctx_obj = new_log_ctx_obj + else: + log_ctx_obj.highest_ancestor()._set_parent(new_log_ctx_obj) + + obj = l.get('self') + if obj and isinstance(obj, Origin) and (except_obj is not obj): + origin = obj + break + f = f.f_back + + if (origin is not None) and (log_ctx_obj is not None): + log_ctx_obj.highest_ancestor()._set_parent(origin) + p = log_ctx_obj + while p: + p._set_log_category(origin._log_category) + p = p._parent + if log_ctx_obj is not None: + return log_ctx_obj + # may return None + return origin + + @staticmethod + def find_in_exc_info(exc_info): + tb = exc_info[2] + # get last tb ... I hope that's right + while tb.tb_next: + tb = tb.tb_next + return Origin.find_on_stack(f=tb.tb_frame) + + def __init__(self, category, *name_items, find_parent=True, **detail_items): + self._set_log_category(category) self.set_name(*name_items, **detail_items) + if find_parent: + self._set_parent(Origin.find_on_stack(except_obj=self)) + + def _set_parent(self, parent): + # make sure to avoid loops + p = parent + while p: + if p is self: + raise OriginLoopError('Origin parent loop') + p = p._parent + self._parent = parent def set_name(self, *name_items, **detail_items): + '''Change the origin's name for log output; rather use the constructor. + This function can be used to change the name in case naming info + becomes available only after class creation (like a pid)''' if name_items: name = '-'.join([str(i) for i in name_items]) elif not detail_items: @@ -313,87 +433,43 @@ self._origin_id = '%s-%s' % (self.name(), Origin._global_id) return self._origin_id - def set_log_category(self, category): + def _set_log_category(self, category): self._log_category = category - - def _log(self, level, messages, named_items=None, src_levels_up=3, origins=None): - src = self._src or src_levels_up - origin = origins or self.gather_origins() - _log_all_targets(origin, self._log_category, level, src, messages, named_items) - - def dbg(self, *messages, **named_items): - self._log(L_DBG, messages, named_items) - - def log(self, *messages, **named_items): - self._log(L_LOG, messages, named_items) - - def err(self, *messages, **named_items): - self._log(L_ERR, messages, named_items) - - def trace(self, *messages, **named_items): - self._log(L_TRACEBACK, messages, named_items) - - def log_exn(self, exc_info=None): - log_exn(self, self._log_category, exc_info) - - def __enter__(self): - if not self.set_child_of(Origin._global_current_origin): - return self - Origin._global_current_origin = self - return self - - def __exit__(self, *exc_info): - rc = None - if exc_info[0] is not None: - rc = exn_add_info(exc_info, self) - Origin._global_current_origin, self._parent_origin = self._parent_origin, None - return rc - - def raise_exn(self, *messages, exn_class=Error, **named_items): - with self: - raise exn_class(compose_message(messages, named_items)) def redirect_stdout(self): return contextlib.redirect_stdout(SafeRedirectStdout(self)) - def gather_origins(self): - origins = Origins() - # this object shall always be seen as the immediate origin of the log message. - origins.add(self) - # now go through the parents of this object. - origin = self._parent_origin - # but if this object is "loose" and not set up with cascaded 'with' statements, - # take the last seen 'with' statement's object as next parent: - if origin is None and Origin._global_current_origin is not None: - origin = Origin._global_current_origin - # if this object is currently the _global_current_origin, we don't - # need to add it twice. - if origin is self: - origin = origin._parent_origin - # whichever we determined to be the parent above, go up through all its - # ancestors. - while origin is not None: - origins.add(origin) - origin = origin._parent_origin + def ancestry(self): + origins = [] + n = 10 + origin = self + while origin: + origins.insert(0, origin) + origin = origin._parent + n -= 1 + if n < 0: + break return origins - def set_child_of(self, parent_origin): - # avoid loops - assert self._parent_origin is None - assert parent_origin is not self - self._parent_origin = parent_origin - return True + def ancestry_str(self): + return '?'.join([o.name() for o in self.ancestry()]) -class LineInfo(Origin): - def __init__(self, src_file, *name_items, **detail_items): - self.src_file = src_file - self.set_name(*name_items, **detail_items) + def highest_ancestor(self): + if self._parent: + return self._parent.highest_ancestor() + return self - def name(self): - l = get_line_for_src(self.src_file) - if l is not None: - return '%s:%s' % (self._name, l) - return super().name() + def log(self, *messages, _src=3, **named_items): + '''same as log.log() but passes this object to skip looking up an origin''' + log(*messages, _origin=self, _src=_src, **named_items) + + def dbg(self, *messages, _src=3, **named_items): + '''same as log.dbg() but passes this object to skip looking up an origin''' + dbg(*messages, _origin=self, _src=_src, **named_items) + + def err(self, *messages, _src=3, **named_items): + '''same as log.err() but passes this object to skip looking up an origin''' + err(*messages, _origin=self, _src=_src, **named_items) class SafeRedirectStdout: ''' @@ -407,7 +483,7 @@ _log_line_buf = None def __init__(self, origin): - self._origin = origin + self.origin = origin def write(self, message): lines = message.splitlines() @@ -419,93 +495,34 @@ if not message.endswith('\n'): self._log_line_buf = lines[-1] lines = lines[:-1] - origins = self._origin.gather_origins() for line in lines: - self._origin._log(L_LOG, (line,), origins=origins) + _log(messages=(line,), + origin=self.origin, level=L_LOG, src=2) def __getattr__(self, name): return sys.__stdout__.__getattribute__(name) - -def dbg(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_DBG, 2, messages, named_items) - -def log(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_LOG, 2, messages, named_items) - -def err(origin, category, *messages, **named_items): - _log_all_targets(origin, category, L_ERR, 2, messages, named_items) - -def trace(origin, category, exc_info): - _log_all_targets(origin, category, L_TRACEBACK, None, - traceback.format_exception(*exc_info)) - -def resolve_category(origin, category): - if category is not None: - return category - if not hasattr(origin, '_log_category'): - return None - return origin._log_category - -def exn_add_info(exc_info, origin, category=None): - etype, exception, tb = exc_info - if not hasattr(exception, 'origins'): - exception.origins = Origins() - if not hasattr(exception, 'category'): - # only remember the deepest category - exception.category = resolve_category(origin, category) - if not hasattr(exception, 'src'): - exception.src = get_src_from_tb(tb) - exception.origins.add(origin) - return False - -def log_exn(origin=None, category=None, exc_info=None): - if not (exc_info is not None and len(exc_info) == 3): +def trace(exc_info=None, origin=None): + if exc_info is None: exc_info = sys.exc_info() - if not (exc_info is not None and len(exc_info) == 3): - raise RuntimeError('invalid call to log_exn() -- no valid exception info') + if origin is None: + origin = Origin.find_in_exc_info(exc_info) + _log(messages=traceback.format_exception(*exc_info), + origin=origin, level=L_TRACEBACK) + +def log_exn(): + exc_info = sys.exc_info() + origin = Origin.find_in_exc_info(exc_info) etype, exception, tb = exc_info - - # if there are origins recorded with the Exception, prefer that - if hasattr(exception, 'origins'): - origin = exception.origins - - # if there is a category recorded with the Exception, prefer that - if hasattr(exception, 'category'): - category = exception.category - if hasattr(exception, 'msg'): msg = exception.msg else: msg = str(exception) - if hasattr(exception, 'src'): - src = exception.src - else: - src = 2 - - trace(origin, category, exc_info) - _log_all_targets(origin, category, L_ERR, src, - ('%s:' % str(etype.__name__), msg)) - - -class Origins(list): - def __init__(self, origin=None): - if origin is not None: - self.add(origin) - - def add(self, origin): - if hasattr(origin, 'name'): - origin_str = origin.name() - else: - origin_str = repr(origin) - if origin_str is None: - raise RuntimeError('origin_str is None for %r' % origin) - self.insert(0, origin_str) - - def __str__(self): - return '?'.join(self) + trace(exc_info, origin=origin) + _log(messages=('%s:' % str(etype.__name__), msg), + origin=origin, level=L_ERR, src=get_src_from_exc_info(exc_info)) def set_all_levels(level): diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index fc9bba4..67659e1 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -139,12 +139,14 @@ Related: https://github.com/LEW21/pydbus/issues/56 ''' + modem_path = None + watch_props_subscription = None + _dbus_obj = None + interfaces = None + def __init__(self, modem_path): self.modem_path = modem_path - self.set_name(self.modem_path) - self.set_log_category(log.C_BUS) - self.watch_props_subscription = None - self._dbus_obj = None + super().__init__(log.C_BUS, self.modem_path) self.interfaces = set() # A dict listing signal handlers to connect, e.g. @@ -175,7 +177,7 @@ try: return self.dbus_obj()[interface_name] except KeyError: - self.raise_exn('Modem interface is not available:', interface_name) + raise log.Error('Modem interface is not available:', interface_name) def signal(self, interface_name, signal): return getattr(self.interface(interface_name), signal) @@ -310,8 +312,7 @@ def __init__(self, conf): self.conf = conf self.path = conf.get('path') - self.set_name(self.path) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, self.path) self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 @@ -371,8 +372,7 @@ def imsi(self): imsi = self.conf.get('imsi') if not imsi: - with self: - raise RuntimeError('No IMSI') + raise log.Error('No IMSI') return imsi def ki(self): diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 7753395..5447118 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -31,10 +31,9 @@ bts = None def __init__(self, suite_run, msc, ip_address): + super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-bsc_%s' % ip_address.get('addr')) self.bts = [] self.msc = msc diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index 0b717fa..b5a947f 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -29,8 +29,7 @@ class OsmoCtrl(log.Origin): def __init__(self, host, port): - self.set_name('Ctrl', host=host, port=port) - self.set_log_category(log.C_BUS) + super().__init__(log.C_BUS, 'Ctrl', host=host, port=port) self.host = host self.port = port self.sck = None @@ -79,12 +78,10 @@ self._send(getmsg) def __enter__(self): - super().__enter__() self.connect() return self def __exit__(self, *exc_info): self.disconnect() - super().__exit__(*exc_info) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 3492f06..110faa5 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -32,10 +32,9 @@ next_subscriber_id = 1 def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-hlr_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -47,16 +46,16 @@ binary = inst.child('bin', 'osmo-hlr') if not os.path.isfile(binary): - self.raise_exn('Binary missing:', binary) + raise log.Error('Binary missing:', binary) lib = inst.child('lib') if not os.path.isdir(lib): - self.raise_exn('No lib/ in', inst) + raise log.Error('No lib/ in', inst) # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') if not os.path.isfile(sql_input): - self.raise_exn('hlr.sql missing:', sql_input) + raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) iface = util.ip_to_iface(self.addr()) @@ -96,13 +95,13 @@ return not self.process.terminated() def run_local(self, name, popen_args): - with self: - run_dir = self.run_dir.new_dir(name) - proc = process.Process(name, run_dir, popen_args) - proc.launch() - proc.wait() - if proc.result != 0: - proc.raise_exn('Exited in error') + run_dir = self.run_dir.new_dir(name) + proc = process.Process(name, run_dir, popen_args) + proc.launch() + proc.wait() + if proc.result != 0: + log.ctx(proc) + raise log.Error('Exited in error') def run_sql_file(self, name, sql_file): self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index 3e722fb..b385274 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -30,10 +30,9 @@ process = None def __init__(self, suite_run, ip_address, bts_ip): + super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-mgcpgw_%s' % ip_address.get('addr')) # hack: so far mgcpgw needs one specific BTS IP. self.bts_ip = bts_ip diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 3a822f1..443b254 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -32,10 +32,9 @@ config = None def __init__(self, suite_run, hlr, mgcpgw, 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.set_log_category(log.C_RUN) - self.set_name('osmo-msc_%s' % ip_address.get('addr')) self.hlr = hlr self.mgcpgw = mgcpgw @@ -100,12 +99,11 @@ def imsi_attached(self, *imsis): attached = self.imsi_list_attached() - self.dbg('attached:', attached) + log.dbg('attached:', attached) return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoMscCtrl(self).subscriber_list_active() + return OsmoMscCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -117,8 +115,7 @@ def __init__(self, msc): self.msc = msc - self.set_name('CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) - self.set_child_of(msc) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.msc.addr(), self.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.msc.addr(), self.PORT) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index b4bf247..3104842 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -32,10 +32,9 @@ bts = None def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address - self.set_log_category(log.C_RUN) - self.set_name('osmo-nitb_%s' % ip_address.get('addr')) self.bts = [] def start(self): @@ -106,8 +105,7 @@ msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - with self: - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -118,8 +116,7 @@ return all([(imsi in attached) for imsi in imsis]) def imsi_list_attached(self): - with self: - return OsmoNitbCtrl(self).subscriber_list_active() + return OsmoNitbCtrl(self).subscriber_list_active() def running(self): return not self.process.terminated() @@ -133,8 +130,7 @@ def __init__(self, nitb): self.nitb = nitb - self.set_name('CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) - self.set_child_of(nitb) + super().__init__(log.C_BUS, 'CTRL(%s:%d)' % (self.nitb.addr(), OsmoNitbCtrl.PORT)) def ctrl(self): return osmo_ctrl.OsmoCtrl(self.nitb.addr(), OsmoNitbCtrl.PORT) diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index f3b1e6a..398ec6c 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -27,14 +27,13 @@ class PcapRecorder(log.Origin): def __init__(self, suite_run, run_dir, iface=None, filters=''): - self.suite_run = suite_run - self.run_dir = run_dir self.iface = iface if not self.iface: self.iface = "any" self.filters = filters - self.set_log_category(log.C_RUN) - self.set_name('pcap-recorder_%s' % self.iface) + super().__init__(log.C_RUN, 'pcap-recorder_%s' % self.iface, filters=self.filters) + self.suite_run = suite_run + self.run_dir = run_dir self.start() def start(self): diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index e5d38f3..d24bf3d 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -33,9 +33,8 @@ killed = None def __init__(self, name, run_dir, popen_args, **popen_kwargs): + super().__init__(log.C_RUN, name) self.name_str = name - self.set_name(name) - self.set_log_category(log.C_RUN) self.run_dir = run_dir self.popen_args = popen_args self.popen_kwargs = popen_kwargs @@ -62,23 +61,21 @@ return f def launch(self): - with self: + log.dbg('cd %r; %s %s' % ( + os.path.abspath(str(self.run_dir)), + ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), + ' '.join(self.popen_args))) - self.dbg('cd %r; %s %s' % ( - os.path.abspath(str(self.run_dir)), - ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), - ' '.join(self.popen_args))) - - self.process_obj = subprocess.Popen( - self.popen_args, - stdout=self.make_output_log('stdout'), - stderr=self.make_output_log('stderr'), - stdin=subprocess.PIPE, - shell=False, - cwd=self.run_dir.path, - **self.popen_kwargs) - self.set_name(self.name_str, pid=self.process_obj.pid) - self.log('Launched') + self.process_obj = subprocess.Popen( + self.popen_args, + stdout=self.make_output_log('stdout'), + stderr=self.make_output_log('stderr'), + stdin=subprocess.PIPE, + shell=False, + cwd=self.run_dir.path, + **self.popen_kwargs) + self.set_name(self.name_str, pid=self.process_obj.pid) + self.log('Launched') def _poll_termination(self, time_to_wait_for_term=5): wait_step = 0.001 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 7cc32bb..dbfc4e0 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -83,7 +83,7 @@ def __init__(self): self.config_path = config.get_config_file(RESOURCES_CONF) self.state_dir = config.get_state_dir() - self.set_name(conf=self.config_path, state=self.state_dir.path) + super().__init__(log.C_CNF, conf=self.config_path, state=self.state_dir.path) self.read_conf() def read_conf(self): @@ -158,6 +158,7 @@ return ReservedResources(self, origin, to_be_reserved) def free(self, origin, to_be_freed): + log.ctx(origin) with self.state_dir.lock(origin.origin_id()): rrfile_path = self.state_dir.mk_parentdir(RESERVED_RESOURCES_FILE) reserved = Resources(config.read(rrfile_path, if_missing_return={})) @@ -202,19 +203,19 @@ with self.state_dir.lock(origin_id): msisdn_path = self.state_dir.child(LAST_USED_MSISDN_FILE) - with log.Origin(msisdn_path): - last_msisdn = '1000' - if os.path.exists(msisdn_path): - if not os.path.isfile(msisdn_path): - raise RuntimeError('path should be a file but is not: %r' % msisdn_path) - with open(msisdn_path, 'r') as f: - last_msisdn = f.read().strip() - schema.msisdn(last_msisdn) + log.ctx(msisdn_path) + last_msisdn = '1000' + if os.path.exists(msisdn_path): + if not os.path.isfile(msisdn_path): + raise RuntimeError('path should be a file but is not: %r' % msisdn_path) + with open(msisdn_path, 'r') as f: + last_msisdn = f.read().strip() + schema.msisdn(last_msisdn) - next_msisdn = util.msisdn_inc(last_msisdn) - with open(msisdn_path, 'w') as f: - f.write(next_msisdn) - return next_msisdn + next_msisdn = util.msisdn_inc(last_msisdn) + with open(msisdn_path, 'w') as f: + f.write(next_msisdn) + return next_msisdn class NoResourceExn(Exception): diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index fb27f32..d652aa7 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -124,9 +124,9 @@ validate_item(path, list_v, schema) return - with log.Origin(item=path): - type_validator = SCHEMA_TYPES.get(want_type) - type_validator(value) + log.ctx(path) + type_validator = SCHEMA_TYPES.get(want_type) + type_validator(value) def nest(parent_path, config, schema): if parent_path: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 55f81b1..eeaf7df 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -49,9 +49,8 @@ def __init__(self, suite_dir): - self.set_log_category(log.C_CNF) self.suite_dir = suite_dir - self.set_name(os.path.basename(self.suite_dir)) + super().__init__(log.C_CNF, os.path.basename(self.suite_dir)) self.read_conf() def read_conf(self): @@ -78,12 +77,10 @@ FAIL = 'FAIL' def __init__(self, suite_run, test_basename): - self.suite_run = suite_run self.basename = test_basename + super().__init__(log.C_TST, self.basename) + self.suite_run = suite_run self.path = os.path.join(self.suite_run.definition.suite_dir, self.basename) - super().__init__(self.path) - self.set_name(self.basename) - self.set_log_category(log.C_TST) self.status = Test.UNKNOWN self.start_timestamp = 0 self.duration = 0 @@ -92,16 +89,15 @@ def run(self): try: - with self: - log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) - self.status = Test.UNKNOWN - self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) - with self.redirect_stdout(): - util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), - self.path) - if self.status == Test.UNKNOWN: - self.set_pass() + log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) + self.status = Test.UNKNOWN + self.start_timestamp = time.time() + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + with self.redirect_stdout(): + util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), + self.path) + if self.status == Test.UNKNOWN: + self.set_pass() except Exception as e: if hasattr(e, 'msg'): msg = e.msg @@ -110,14 +106,14 @@ if isinstance(e, AssertionError): # AssertionError lacks further information on what was # asserted. Find the line where the code asserted: - msg += log.get_src_from_tb(sys.exc_info()[2]) + msg += log.get_src_from_exc_info(sys.exc_info()) # add source file information to failure report if hasattr(e, 'origins'): msg += ' [%s]' % e.origins tb_str = traceback.format_exc() if isinstance(e, resource.NoResourceExn): tb_str += self.suite_run.resource_status_str() - self.set_fail(type(e).__name__, msg, tb_str) + self.set_fail(type(e).__name__, msg, tb_str, log.get_src_from_exc_info()) except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TEST RUN ABORTED: %s' % type(e).__name__) @@ -129,7 +125,7 @@ return '%s:%s' % (self._name, l) return super().name() - def set_fail(self, fail_type, fail_message, tb_str=None): + def set_fail(self, fail_type, fail_message, tb_str=None, src=4): self.status = Test.FAIL self.duration = time.time() - self.start_timestamp self.fail_type = fail_type @@ -140,9 +136,9 @@ tb_str = ''.join(traceback.format_stack()[:-1]) self.fail_tb = tb_str - self.err('%s: %s' % (self.fail_type, self.fail_message)) + self.err('%s: %s' % (self.fail_type, self.fail_message), _src=src) if self.fail_tb: - self.trace(self.fail_tb) + self.log(self.fail_tb, _level=log.L_TRACEBACK) self.log('Test FAILED (%.1f sec)' % self.duration) def set_pass(self): @@ -171,11 +167,10 @@ _processes = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): + super().__init__(log.C_TST, suite_scenario_str) self.trial = trial self.definition = suite_definition self.scenarios = scenarios - self.set_name(suite_scenario_str) - self.set_log_category(log.C_TST) self.resources_pool = resource.ResourcesPool() self.status = SuiteRun.UNKNOWN self.load_tests() @@ -201,18 +196,18 @@ self.status = SuiteRun.UNKNOWN def combined(self, conf_name): - self.dbg(combining=conf_name) - with log.Origin(combining_scenarios=conf_name): - combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) - self.dbg(definition_conf=combination) - for scenario in self.scenarios: - with scenario: - c = scenario.get(conf_name) - self.dbg(scenario=scenario.name(), conf=c) - if c is None: - continue - config.combine(combination, c) - return combination + log.dbg(combining=conf_name) + log.ctx(combining_scenarios=conf_name) + combination = copy.deepcopy(self.definition.conf.get(conf_name) or {}) + log.dbg(definition_conf=combination) + for scenario in self.scenarios: + log.ctx(combining_scenarios=conf_name, scenario=scenario.name()) + c = scenario.get(conf_name) + log.dbg(scenario=scenario.name(), conf=c) + if c is None: + continue + config.combine(combination, c) + return combination def resource_requirements(self): if self._resource_requirements is None: @@ -232,19 +227,18 @@ def run_tests(self, names=None): try: - with self: - log.large_separator(self.trial.name(), self.name(), sublevel=2) - self.mark_start() - event_loop.register_poll_func(self.poll) - if not self.reserved_resources: - self.reserve_resources() - for test in self.tests: - if names and not test.name() in names: - test.set_skip() - continue - test.run() + log.large_separator(self.trial.name(), self.name(), sublevel=2) + self.mark_start() + event_loop.register_poll_func(self.poll) + if not self.reserved_resources: + self.reserve_resources() + for test in self.tests: + if names and not test.name() in names: + test.set_skip() + continue + test.run() except Exception: - self.log_exn() + log.log_exn() except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('SUITE RUN ABORTED: %s' % type(e).__name__) @@ -355,7 +349,8 @@ if process.terminated(): process.log_stdout_tail() process.log_stderr_tail() - process.raise_exn('Process ended prematurely') + log.ctx(process) + raise log.Error('Process ended prematurely') def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' diff --git a/src/osmo_gsm_tester/template.py b/src/osmo_gsm_tester/template.py index 33ce2f6..0ddfc84 100644 --- a/src/osmo_gsm_tester/template.py +++ b/src/osmo_gsm_tester/template.py @@ -26,7 +26,7 @@ from .util import dict2obj _lookup = None -_logger = log.Origin('no templates dir set') +_logger = log.Origin(log.C_CNF, 'no templates dir set') def set_templates_dir(*templates_dirs): global _lookup @@ -39,7 +39,7 @@ raise RuntimeError('templates dir is not a dir: %r' % os.path.abspath(d)) _lookup = TemplateLookup(directories=templates_dirs) - _logger = log.Origin('Templates', category=log.C_CNF) + _logger = log.Origin(log.C_CNF, 'Templates') def render(name, values): '''feed values dict into template and return rendered result. @@ -48,11 +48,11 @@ if _lookup is None: set_templates_dir() tmpl_name = name + '.tmpl' - with log.Origin(tmpl_name): - template = _lookup.get_template(tmpl_name) - _logger.dbg('rendering', tmpl_name) + log.ctx(tmpl_name) + template = _lookup.get_template(tmpl_name) + _logger.dbg('rendering', tmpl_name) - line_info_name = tmpl_name.replace('-', '_').replace('.', '_') - return template.render(**dict2obj(values)) + line_info_name = tmpl_name.replace('-', '_').replace('.', '_') + return template.render(**dict2obj(values)) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index 741f3a7..d54e96c 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -57,8 +57,7 @@ def __init__(self, trial_dir): self.path = os.path.abspath(trial_dir) - self.set_name(os.path.basename(self.path)) - self.set_log_category(log.C_TST) + super().__init__(log.C_TST, os.path.basename(self.path)) self.dir = util.Dir(self.path) self.inst_dir = util.Dir(self.dir.child('inst')) self.bin_tars = [] @@ -69,7 +68,8 @@ return self.name() def __enter__(self): - # add a log target to log to the run dir + '''add a log target to log to the run dir, write taken marker, log a + starting separator.''' run_dir = self.get_run_dir() detailed_log = run_dir.new_child(FILE_LOG) self.log_targets = [ @@ -82,11 +82,10 @@ log.large_separator(self.name(), sublevel=1) self.log('Detailed log at', detailed_log) self.take() - super().__enter__() return self def __exit__(self, *exc_info): - super().__exit__(*exc_info) + '''log a report, then remove log file targets for this trial''' self.log_report() for lt in self.log_targets: lt.remove() @@ -195,6 +194,8 @@ except BaseException as e: # when the program is aborted by a signal (like Ctrl-C), escalate to abort all. self.err('TRIAL RUN ABORTED: %s' % type(e).__name__) + # log the traceback before the trial's logging is ended + log.log_exn() raise finally: if suite_run.status != suite.SuiteRun.PASS: -- To view, visit https://gerrit.osmocom.org/2886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90 Gerrit-PatchSet: 4 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 Tue Jun 13 13:16:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 13:16:32 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 Verified+1 Verified for both TCH/F and /H. -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 13:22:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 13:22:53 +0000 Subject: openbsc[master]: Fix BTS features length check In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2900/1/openbsc/src/libbsc/abis_nm.c File openbsc/src/libbsc/abis_nm.c: Line 493: if (m_id_len > _NUM_BTS_FEAT/8 + 1) > shouldn't this be looking at enum gsm_bts_features that has _NUM_BTS_FEAT as last enum entry the /8 seems to be wrong entirely, and it seems that you need (m_id_len > _NUM_BTS_FEAT)? -- To view, visit https://gerrit.osmocom.org/2900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Tue Jun 13 13:23:03 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 13 Jun 2017 13:23:03 +0000 Subject: [PATCH] libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference 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/2876 to look at the new patch set (#2). core/conv/viterbi.c: fix possible NULL-pointer reference Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 --- M src/viterbi.c 1 file changed, 16 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/2876/2 diff --git a/src/viterbi.c b/src/viterbi.c index 854754c..308cfe0 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -394,12 +394,15 @@ int olen = (code->N == 2) ? 2 : 4; trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + if (!trellis) + goto fail; + trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs) + if (!trellis->sums || !trellis->outputs || !trellis->vals) goto fail; /* Populate the trellis state objects */ @@ -507,9 +510,13 @@ if (!dec) return; - vdec_free(dec->paths[0]); - free(dec->paths); free_trellis(dec->trellis); + + if (dec->paths != NULL) { + vdec_free(dec->paths[0]); + free(dec->paths); + } + free(dec); } @@ -572,7 +579,13 @@ goto fail; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + if (!dec->paths) + goto fail; + dec->paths[0] = vdec_malloc(ns * dec->len); + if (!dec->paths[0]) + goto fail; + for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Tue Jun 13 13:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 13:29:20 +0000 Subject: [MERGED] osmo-gsm-tester[master]: log_test.py: cosmetic follow-up In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: log_test.py: cosmetic follow-up ...................................................................... log_test.py: cosmetic follow-up This is kept separate to not clutter up previous patch I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90. Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6 --- M selftest/log_test.ok M selftest/log_test.py 2 files changed, 15 insertions(+), 18 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/log_test.ok b/selftest/log_test.ok index 17198b7..c9d2dd2 100644 --- a/selftest/log_test.ok +++ b/selftest/log_test.ok @@ -12,29 +12,29 @@ tst: only category DBG: only level some-name(some='detail'): only origin -only src [log_test.py:70] +only src [log_test.py:69] - Testing log.style_change() no log format 01:02:03: add time but no time format 01:02:03: DBG: add level 01:02:03 tst: DBG: add category -01:02:03 tst: DBG: add src [log_test.py:85] -01:02:03 tst some-name(some='detail'): DBG: add origin [log_test.py:87] +01:02:03 tst: DBG: add src [log_test.py:84] +01:02:03 tst some-name(some='detail'): DBG: add origin [log_test.py:86] - Testing origin_width -01:02:03 tst shortname: origin str set to 23 chars [log_test.py:94] -01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): long origin str [log_test.py:96] -01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): DBG: long origin str dbg [log_test.py:97] -01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): ERR: long origin str err [log_test.py:98] +01:02:03 tst shortname: origin str set to 23 chars [log_test.py:91] +01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): long origin str [log_test.py:93] +01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): DBG: long origin str dbg [log_test.py:94] +01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): ERR: long origin str err [log_test.py:95] - Testing log.Origin with omitted info -01:02:03 tst LogTest: hello log, name implicit from class name [log_test.py:103] -01:02:03 --- explicit_name: hello log, no category set [log_test.py:107] -01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110] -01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113] +01:02:03 tst LogTest: hello log, name implicit from class name [log_test.py:99] +01:02:03 --- explicit_name: hello log, no category set [log_test.py:103] +01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:107] +01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:110] - Testing logging of Exceptions, tracing origins nested print just prints -01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:135] -01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:136] -01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:137: raise ValueError('bork')] +01:02:03 tst level3: nested log() [level1?level2?level3] [log_test.py:132] +01:02:03 tst level2: nested l2 log() from within l3 scope [level1?level2] [log_test.py:133] +01:02:03 tst level3: ERR: ValueError: bork [level1?level2?level3] [log_test.py:134: raise ValueError('bork')] - Disallow origin loops disallowed successfully diff --git a/selftest/log_test.py b/selftest/log_test.py index 9136906..889a8a5 100755 --- a/selftest/log_test.py +++ b/selftest/log_test.py @@ -45,7 +45,6 @@ super().__init__(log.C_TST, *name_items, **detail_items) t = LogTest('some', 'name', some="detail") - t.log("hello log") t.err("hello err") @@ -86,8 +85,6 @@ log.style_change(origin=True) t.dbg("add origin") -# some space to keep source line numbers identical to previous code - print('- Testing origin_width') t = LogTest('shortname') log.style(origin_width=23, time_fmt=fake_time) @@ -97,7 +94,6 @@ t.dbg("long origin str dbg") t.err("long origin str err") - print('- Testing log.Origin with omitted info') t = LogTest() t.log("hello log, name implicit from class name") @@ -105,6 +101,7 @@ t = LogTest('explicit_name') t._set_log_category(None) t.log("hello log, no category set") + t = LogTest() t._set_log_category(None) t.log("hello log, no category nor name set") -- To view, visit https://gerrit.osmocom.org/2899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6 Gerrit-PatchSet: 2 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 Tue Jun 13 13:38:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 13:38:44 +0000 Subject: libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Tue Jun 13 13:39:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 13:39:05 +0000 Subject: libosmocore[master]: vty/command.c: drop useless assignment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Tue Jun 13 13:39:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 13 Jun 2017 13:39:16 +0000 Subject: libosmocore[master]: gsm/gsm48.c: drop useless assignment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 14:31:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 14:31:37 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Fix error failing due to Scan() failure Message-ID: Review at https://gerrit.osmocom.org/2902 ofono_client: Fix error failing due to Scan() failure It was detected that Scan() method can fail for some modems on some specific circumstances. For instance it fails with org.ofono.Error.Failed if the modem starts to register internally after we started Scan() and the registering succeeds while we are still waiting for Scan() to finsih. So far the easiest seems to check if we are now registered and otherwise schedule a scan again. Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/02/2902/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 67659e1..138f7df 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -385,6 +385,7 @@ netreg = self.dbus.interface(I_NETREG) prop = netreg.GetProperties() status = prop.get('Status') + self.dbg('status:', status) if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): return False if mcc_mnc is None: # Any network is fine and we are registered. @@ -406,10 +407,21 @@ # finished. register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) - error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) + error_handler = lambda obj, e, user_data: defer(self.scan_cb_error_handler, e, mcc_mnc) dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, error_handler=error_handler, user_data=mcc_mnc) + def scan_cb_error_handler(self, e, mcc_mnc): + # It was detected that Scan() method can fail for some modems on some + # specific circumstances. For instance it fails with org.ofono.Error.Failed + # if the modem starts to register internally after we started Scan() and + # the registering succeeds while we are still waiting for Scan() to finsih. + # So far the easiest seems to check if we are now registered and + # otherwise schedule a scan again. + self.err('Scan() failed:', e) + if not self.is_connected(mcc_mnc): + self.schedule_scan_register(mcc_mnc) + def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); for op_path, op_prop in scanned_operators: -- To view, visit https://gerrit.osmocom.org/2902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 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 Jun 13 14:38:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 14:38:14 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: gracefully handle Scan() failure In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2902 to look at the new patch set (#2). ofono_client: gracefully handle Scan() failure ofono's NetworkRegistration.Scan() method fails sporadically. On failure, check if we are now registered to the desired network, and schedule another scan otherwise. For instance it fails with org.ofono.Error.Failed if the modem starts to register internally after we started Scan() and the registering succeeds while we are still waiting for Scan() to finsih. Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/02/2902/2 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 67659e1..138f7df 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -385,6 +385,7 @@ netreg = self.dbus.interface(I_NETREG) prop = netreg.GetProperties() status = prop.get('Status') + self.dbg('status:', status) if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): return False if mcc_mnc is None: # Any network is fine and we are registered. @@ -406,10 +407,21 @@ # finished. register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) - error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) + error_handler = lambda obj, e, user_data: defer(self.scan_cb_error_handler, e, mcc_mnc) dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, error_handler=error_handler, user_data=mcc_mnc) + def scan_cb_error_handler(self, e, mcc_mnc): + # It was detected that Scan() method can fail for some modems on some + # specific circumstances. For instance it fails with org.ofono.Error.Failed + # if the modem starts to register internally after we started Scan() and + # the registering succeeds while we are still waiting for Scan() to finsih. + # So far the easiest seems to check if we are now registered and + # otherwise schedule a scan again. + self.err('Scan() failed:', e) + if not self.is_connected(mcc_mnc): + self.schedule_scan_register(mcc_mnc) + def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); for op_path, op_prop in scanned_operators: -- To view, visit https://gerrit.osmocom.org/2902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 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 Jun 13 14:38:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 14:38:26 +0000 Subject: osmo-gsm-tester[master]: ofono_client: gracefully handle Scan() failure In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Tue Jun 13 14:38:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 14:38:29 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: gracefully handle Scan() failure In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ofono_client: gracefully handle Scan() failure ...................................................................... ofono_client: gracefully handle Scan() failure ofono's NetworkRegistration.Scan() method fails sporadically. On failure, check if we are now registered to the desired network, and schedule another scan otherwise. For instance it fails with org.ofono.Error.Failed if the modem starts to register internally after we started Scan() and the registering succeeds while we are still waiting for Scan() to finsih. Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: 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 67659e1..138f7df 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -385,6 +385,7 @@ netreg = self.dbus.interface(I_NETREG) prop = netreg.GetProperties() status = prop.get('Status') + self.dbg('status:', status) if not (status == NETREG_ST_REGISTERED or status == NETREG_ST_ROAMING): return False if mcc_mnc is None: # Any network is fine and we are registered. @@ -406,10 +407,21 @@ # finished. register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) - error_handler = lambda obj, e, user_data: defer(self.raise_exn, 'Scan() failed:', e) + error_handler = lambda obj, e, user_data: defer(self.scan_cb_error_handler, e, mcc_mnc) dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, error_handler=error_handler, user_data=mcc_mnc) + def scan_cb_error_handler(self, e, mcc_mnc): + # It was detected that Scan() method can fail for some modems on some + # specific circumstances. For instance it fails with org.ofono.Error.Failed + # if the modem starts to register internally after we started Scan() and + # the registering succeeds while we are still waiting for Scan() to finsih. + # So far the easiest seems to check if we are now registered and + # otherwise schedule a scan again. + self.err('Scan() failed:', e) + if not self.is_connected(mcc_mnc): + self.schedule_scan_register(mcc_mnc) + def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); for op_path, op_prop in scanned_operators: -- To view, visit https://gerrit.osmocom.org/2902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a2265ee39a94daa00f525b1c7037a6775509425 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 15:10:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: fix use of raise_exn Message-ID: Review at https://gerrit.osmocom.org/2903 ofono_client: fix use of raise_exn method raise_exn was removed in 1a7a3f0e4318bccbd3ed177d5b07fa3618d06868, but due to merge process it remaine dbeing used in some places. Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/03/2903/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 138f7df..45a4294 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -398,7 +398,7 @@ def schedule_scan_register(self, mcc_mnc): if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: - self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + raise log.Error('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) self.register_attempts += 1 netreg = self.dbus.interface(I_NETREG) self.dbg('Scanning for operators...') @@ -473,7 +473,7 @@ def connect(self, mcc_mnc=None): 'Connect to MCC+MNC' if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): - self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + raise log.Error('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) self.power_cycle() self.register_attempts = 0 if self.is_connected(mcc_mnc): -- To view, visit https://gerrit.osmocom.org/2903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19 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 Jun 13 15:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 15:10:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Improve log around Scan() failure Message-ID: Review at https://gerrit.osmocom.org/2904 ofono_client: Improve log around Scan() failure Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/04/2904/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 45a4294..4deff9e 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -418,9 +418,11 @@ # the registering succeeds while we are still waiting for Scan() to finsih. # So far the easiest seems to check if we are now registered and # otherwise schedule a scan again. - self.err('Scan() failed:', e) + self.err('Scan() failed, retrying if needed:', e) if not self.is_connected(mcc_mnc): self.schedule_scan_register(mcc_mnc) + else: + self.log('Already registered with network', mcc_mnc) def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); -- To view, visit https://gerrit.osmocom.org/2904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef 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 Jun 13 15:15:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:15:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs Message-ID: Review at https://gerrit.osmocom.org/2905 aoip: add osmo-stp, now required for aoip runs Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506 --- A src/osmo_gsm_tester/osmo_stp.py M src/osmo_gsm_tester/suite.py A src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl M suites/aoip_debug/interactive.py M suites/aoip_debug/suite.conf M suites/aoip_sms/mo_mt_sms.py M suites/aoip_sms/suite.conf 7 files changed, 117 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/05/2905/1 diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py new file mode 100644 index 0000000..f1ad6fc --- /dev/null +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -0,0 +1,89 @@ +# osmo_gsm_tester: specifics for running an osmo-stp +# +# Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH +# +# 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 . + +import os +import pprint + +from . import log, util, config, template, process, pcap_recorder + +class OsmoStp(log.Origin): + suite_run = None + ip_address = None + run_dir = None + config_file = None + process = None + + def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-stp_%s' % ip_address.get('addr')) + self.suite_run = suite_run + self.ip_address = ip_address + + def start(self): + self.log('Starting osmo-stp') + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() + + # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of + # OsmoMSC. + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + + binary = inst.child('bin', 'osmo-stp') + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + lib = inst.child('lib') + if not os.path.isdir(lib): + raise RuntimeError('No lib/ in %r' % inst) + + # TODO: osmo-stp is not yet configurable to a specific IP address + #iface = util.ip_to_iface(self.addr()) + #pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + # 'host %s and port not 22' % self.addr()) + + env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } + + self.dbg(run_dir=self.run_dir, binary=binary, env=env) + self.process = process.Process(self.name(), self.run_dir, + (binary, '-c', + os.path.abspath(self.config_file)), + env=env) + self.suite_run.remember_to_stop(self.process) + self.process.launch() + + def configure(self): + self.config_file = self.run_dir.new_file('osmo-stp.cfg') + self.dbg(config_file=self.config_file) + + values = dict(stp=config.get_defaults('stp')) + config.overlay(values, self.suite_run.config()) + config.overlay(values, dict(stp=dict(ip_address=self.ip_address))) + + self.dbg('STP CONFIG:\n' + pprint.pformat(values)) + + with open(self.config_file, 'w') as f: + r = template.render('osmo-stp.cfg', values) + self.dbg(r) + f.write(r) + + def addr(self): + return self.ip_address.get('addr') + + def running(self): + return not self.process.terminated() + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index eeaf7df..be799d3 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 from . import osmo_nitb -from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc +from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp from . import test class Timeout(Exception): @@ -322,6 +322,11 @@ ip_address = self.ip_address() return osmo_bsc.OsmoBsc(self, msc, ip_address) + def stp(self, ip_address=None): + if ip_address is None: + ip_address = self.ip_address() + return osmo_stp.OsmoStp(self, ip_address) + def bts(self, specifics=None): return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl new file mode 100644 index 0000000..eb6ac1d --- /dev/null +++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl @@ -0,0 +1,16 @@ +! Configuration rendered by osmo-gsm-tester +log stderr + logging filter all 1 + logging color 1 + logging print category 1 + logging print extended-timestamp 1 + logging level all debug +line vty + no login + bind ${stp.ip_address.addr} +!ctrl +! bind ${stp.ip_address.addr} +cs7 instance 0 + xua rkm routing-key-allocation dynamic-permitted + listen m3ua 2905 + accept-asp-connections dynamic-permitted diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index cfedd3a..d596b68 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -5,9 +5,11 @@ mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) msc = suite.msc(hlr, mgcpgw) bsc = suite.bsc(msc) +stp = suite.stp() modems = suite.modems(int(prompt('How many modems?'))) hlr.start() +stp.start() msc.start() mgcpgw.start() diff --git a/suites/aoip_debug/suite.conf b/suites/aoip_debug/suite.conf index 48c76b6..bb343a5 100644 --- a/suites/aoip_debug/suite.conf +++ b/suites/aoip_debug/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 4 + - times: 5 bts: - times: 1 modem: diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index 8eba842..217d807 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -6,10 +6,12 @@ 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() diff --git a/suites/aoip_sms/suite.conf b/suites/aoip_sms/suite.conf index c6cbd88..216d3ea 100644 --- a/suites/aoip_sms/suite.conf +++ b/suites/aoip_sms/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 4 + - times: 5 # msc, bsc, hlr, stp, mgw bts: - times: 1 modem: -- To view, visit https://gerrit.osmocom.org/2905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:19:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:19:21 +0000 Subject: [PATCH] osmo-gsm-tester[master]: aoip: use libosmocore neels/aoip branch until patches are me... Message-ID: Review at https://gerrit.osmocom.org/2906 aoip: use libosmocore neels/aoip branch until patches are merged Change-Id: I22623135486e41bfc2d32de614124276f330dc36 --- M contrib/jenkins-build-osmo-msc.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/06/2906/1 diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 53a23fe..5241966 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -4,7 +4,7 @@ name="osmo-msc" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore neels/aoip # TEMPORARY BRANCH build_repo libosmo-abis build_repo libosmo-netif build_repo openggsn -- To view, visit https://gerrit.osmocom.org/2906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22623135486e41bfc2d32de614124276f330dc36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:26:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:26:03 +0000 Subject: osmo-gsm-tester[master]: ofono_client: fix use of raise_exn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:26:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:26:04 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: fix use of raise_exn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ofono_client: fix use of raise_exn ...................................................................... ofono_client: fix use of raise_exn method raise_exn was removed in 1a7a3f0e4318bccbd3ed177d5b07fa3618d06868, but due to merge process it remaine dbeing used in some places. Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: 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 138f7df..45a4294 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -398,7 +398,7 @@ def schedule_scan_register(self, mcc_mnc): if self.register_attempts > NETREG_MAX_REGISTER_ATTEMPTS: - self.raise_exn('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) + raise log.Error('Failed to find Network Operator', mcc_mnc=mcc_mnc, attempts=self.register_attempts) self.register_attempts += 1 netreg = self.dbus.interface(I_NETREG) self.dbg('Scanning for operators...') @@ -473,7 +473,7 @@ def connect(self, mcc_mnc=None): 'Connect to MCC+MNC' if (mcc_mnc is not None) and (len(mcc_mnc) != 2 or None in mcc_mnc): - self.raise_exn('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) + raise log.Error('mcc_mnc value is invalid. It should be None or contain both valid mcc and mnc values:', mcc_mnc=mcc_mnc) self.power_cycle() self.register_attempts = 0 if self.is_connected(mcc_mnc): -- To view, visit https://gerrit.osmocom.org/2903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89f4abe3d69aa4e7bc1fd6c6fd7e9fdea2cd8d19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:27:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:27:20 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Improve log around Scan() failure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 we could still improve, but whatever -- To view, visit https://gerrit.osmocom.org/2904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:27:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:27:23 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: Improve log around Scan() failure In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ofono_client: Improve log around Scan() failure ...................................................................... ofono_client: Improve log around Scan() failure Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: 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 45a4294..4deff9e 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -418,9 +418,11 @@ # the registering succeeds while we are still waiting for Scan() to finsih. # So far the easiest seems to check if we are now registered and # otherwise schedule a scan again. - self.err('Scan() failed:', e) + self.err('Scan() failed, retrying if needed:', e) if not self.is_connected(mcc_mnc): self.schedule_scan_register(mcc_mnc) + else: + self.log('Already registered with network', mcc_mnc) def scan_cb_register_automatic(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); -- To view, visit https://gerrit.osmocom.org/2904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8558d7fe41c155db2a9710e1eccf15b6499f24ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:28:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 13 Jun 2017 15:28:23 +0000 Subject: osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/2905/1/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl: Line 16: accept-asp-connections dynamic-permitted alignment issue? -- To view, visit https://gerrit.osmocom.org/2905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:28:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:28:31 +0000 Subject: [MERGED] osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: aoip: add osmo-stp, now required for aoip runs ...................................................................... aoip: add osmo-stp, now required for aoip runs Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506 --- A src/osmo_gsm_tester/osmo_stp.py M src/osmo_gsm_tester/suite.py A src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl M suites/aoip_debug/interactive.py M suites/aoip_debug/suite.conf M suites/aoip_sms/mo_mt_sms.py M suites/aoip_sms/suite.conf 7 files changed, 117 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py new file mode 100644 index 0000000..f1ad6fc --- /dev/null +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -0,0 +1,89 @@ +# osmo_gsm_tester: specifics for running an osmo-stp +# +# Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH +# +# 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 . + +import os +import pprint + +from . import log, util, config, template, process, pcap_recorder + +class OsmoStp(log.Origin): + suite_run = None + ip_address = None + run_dir = None + config_file = None + process = None + + def __init__(self, suite_run, ip_address): + super().__init__(log.C_RUN, 'osmo-stp_%s' % ip_address.get('addr')) + self.suite_run = suite_run + self.ip_address = ip_address + + def start(self): + self.log('Starting osmo-stp') + self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.configure() + + # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of + # OsmoMSC. + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + + binary = inst.child('bin', 'osmo-stp') + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + lib = inst.child('lib') + if not os.path.isdir(lib): + raise RuntimeError('No lib/ in %r' % inst) + + # TODO: osmo-stp is not yet configurable to a specific IP address + #iface = util.ip_to_iface(self.addr()) + #pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + # 'host %s and port not 22' % self.addr()) + + env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } + + self.dbg(run_dir=self.run_dir, binary=binary, env=env) + self.process = process.Process(self.name(), self.run_dir, + (binary, '-c', + os.path.abspath(self.config_file)), + env=env) + self.suite_run.remember_to_stop(self.process) + self.process.launch() + + def configure(self): + self.config_file = self.run_dir.new_file('osmo-stp.cfg') + self.dbg(config_file=self.config_file) + + values = dict(stp=config.get_defaults('stp')) + config.overlay(values, self.suite_run.config()) + config.overlay(values, dict(stp=dict(ip_address=self.ip_address))) + + self.dbg('STP CONFIG:\n' + pprint.pformat(values)) + + with open(self.config_file, 'w') as f: + r = template.render('osmo-stp.cfg', values) + self.dbg(r) + f.write(r) + + def addr(self): + return self.ip_address.get('addr') + + def running(self): + return not self.process.terminated() + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index eeaf7df..be799d3 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 from . import osmo_nitb -from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc +from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp from . import test class Timeout(Exception): @@ -322,6 +322,11 @@ ip_address = self.ip_address() return osmo_bsc.OsmoBsc(self, msc, ip_address) + def stp(self, ip_address=None): + if ip_address is None: + ip_address = self.ip_address() + return osmo_stp.OsmoStp(self, ip_address) + def bts(self, specifics=None): return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl new file mode 100644 index 0000000..eb6ac1d --- /dev/null +++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl @@ -0,0 +1,16 @@ +! Configuration rendered by osmo-gsm-tester +log stderr + logging filter all 1 + logging color 1 + logging print category 1 + logging print extended-timestamp 1 + logging level all debug +line vty + no login + bind ${stp.ip_address.addr} +!ctrl +! bind ${stp.ip_address.addr} +cs7 instance 0 + xua rkm routing-key-allocation dynamic-permitted + listen m3ua 2905 + accept-asp-connections dynamic-permitted diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index cfedd3a..d596b68 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -5,9 +5,11 @@ mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) msc = suite.msc(hlr, mgcpgw) bsc = suite.bsc(msc) +stp = suite.stp() modems = suite.modems(int(prompt('How many modems?'))) hlr.start() +stp.start() msc.start() mgcpgw.start() diff --git a/suites/aoip_debug/suite.conf b/suites/aoip_debug/suite.conf index 48c76b6..bb343a5 100644 --- a/suites/aoip_debug/suite.conf +++ b/suites/aoip_debug/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 4 + - times: 5 bts: - times: 1 modem: diff --git a/suites/aoip_sms/mo_mt_sms.py b/suites/aoip_sms/mo_mt_sms.py index 8eba842..217d807 100755 --- a/suites/aoip_sms/mo_mt_sms.py +++ b/suites/aoip_sms/mo_mt_sms.py @@ -6,10 +6,12 @@ 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() diff --git a/suites/aoip_sms/suite.conf b/suites/aoip_sms/suite.conf index c6cbd88..216d3ea 100644 --- a/suites/aoip_sms/suite.conf +++ b/suites/aoip_sms/suite.conf @@ -1,6 +1,6 @@ resources: ip_address: - - times: 4 + - times: 5 # msc, bsc, hlr, stp, mgw bts: - times: 1 modem: -- To view, visit https://gerrit.osmocom.org/2905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506 Gerrit-PatchSet: 2 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 Tue Jun 13 15:28:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:28:38 +0000 Subject: osmo-gsm-tester[master]: aoip: use libosmocore neels/aoip branch until patches are me... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22623135486e41bfc2d32de614124276f330dc36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Jun 13 15:28:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:28:40 +0000 Subject: [MERGED] osmo-gsm-tester[master]: aoip: use libosmocore neels/aoip branch until patches are me... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: aoip: use libosmocore neels/aoip branch until patches are merged ...................................................................... aoip: use libosmocore neels/aoip branch until patches are merged Change-Id: I22623135486e41bfc2d32de614124276f330dc36 --- M contrib/jenkins-build-osmo-msc.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 53a23fe..5241966 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -4,7 +4,7 @@ name="osmo-msc" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore +build_repo libosmocore neels/aoip # TEMPORARY BRANCH build_repo libosmo-abis build_repo libosmo-netif build_repo openggsn -- To view, visit https://gerrit.osmocom.org/2906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22623135486e41bfc2d32de614124276f330dc36 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:30:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:30:50 +0000 Subject: osmo-gsm-tester[master]: aoip: add osmo-stp, now required for aoip runs In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2905/1/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl: Line 16: accept-asp-connections dynamic-permitted > alignment issue? ah yes, took this from pmaier and oversaw. thx -- To view, visit https://gerrit.osmocom.org/2905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d4cb0d173eec240bccc1f3a5965a774b7b3506 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:31:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:31:42 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cosmetic: osmo-stp.cfg: fix indent Message-ID: Review at https://gerrit.osmocom.org/2907 cosmetic: osmo-stp.cfg: fix indent Change-Id: I239fe6da004b840fb805c51e46967c8ba3b0d3f5 --- M src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/2907/1 diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl index eb6ac1d..ab41de9 100644 --- a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl @@ -13,4 +13,4 @@ cs7 instance 0 xua rkm routing-key-allocation dynamic-permitted listen m3ua 2905 - accept-asp-connections dynamic-permitted + accept-asp-connections dynamic-permitted -- To view, visit https://gerrit.osmocom.org/2907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I239fe6da004b840fb805c51e46967c8ba3b0d3f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 15:32:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:32:11 +0000 Subject: osmo-gsm-tester[master]: cosmetic: osmo-stp.cfg: fix indent In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I239fe6da004b840fb805c51e46967c8ba3b0d3f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Jun 13 15:32:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 13 Jun 2017 15:32:13 +0000 Subject: [MERGED] osmo-gsm-tester[master]: cosmetic: osmo-stp.cfg: fix indent In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: osmo-stp.cfg: fix indent ...................................................................... cosmetic: osmo-stp.cfg: fix indent Change-Id: I239fe6da004b840fb805c51e46967c8ba3b0d3f5 --- M src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl index eb6ac1d..ab41de9 100644 --- a/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-stp.cfg.tmpl @@ -13,4 +13,4 @@ cs7 instance 0 xua rkm routing-key-allocation dynamic-permitted listen m3ua 2905 - accept-asp-connections dynamic-permitted + accept-asp-connections dynamic-permitted -- To view, visit https://gerrit.osmocom.org/2907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I239fe6da004b840fb805c51e46967c8ba3b0d3f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 16:51:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 16:51:47 +0000 Subject: [PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2893 to look at the new patch set (#4). Add script for fetching BTS-specific L1 headers Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682 --- A scripts/osmo-layer1-headers.sh 1 file changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/4 diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh new file mode 100755 index 0000000..7aeaf1c --- /dev/null +++ b/scripts/osmo-layer1-headers.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# -e: fail if any of the subsequent commands fail +# -x: trace each executed command via debug log +set -e -x + +# Usage: +# ./osmo-layer1-headers.sh sysmo superfemto_v5.1 +# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset) +# 2nd parameter is optional and defaults to latest master branch + +case "$1" in + sysmo) + uri="git://git.sysmocom.de/sysmo-bts/layer1-api" + version="origin/master" + ;; + oct) + uri="git://git.osmocom.org/octphy-2g-headers" + version="origin/master" + ;; + lc15) + uri="https://gitlab.com/nrw_litecell15/litecell15-fw" + version="nrw/litecell15-next" + ;; + *) + echo "Unknown BTS model '$1'" + exit 1 + ;; +esac + +# if 2nd parameter was specified and it's not 'master' than use it instead of default +if [ -n "$2" ] +then + if [ "$2" != "master" ] + then + version=$2 + fi +fi + +if ! test -d layer1-headers; +then + git clone "$uri" layer1-headers +fi + +cd layer1-headers +git fetch origin +git reset --hard "$version" -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 13 17:06:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 17:06:55 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper 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/2891 to look at the new patch set (#7). lc15: add jenkins helper Add jenkins build helper for lc15 and separate header with BTS-agnostic functions. Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_common_prefix.sh A contrib/jenkins_lc15.sh 3 files changed, 65 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/7 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..c44daa7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -18,6 +18,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_common_prefix.sh b/contrib/jenkins_common_prefix.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common_prefix.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..6e79899 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# shellcheck source=contrib/jenkins_common_prefix.sh +. $(dirname "$0")/jenkins_common_prefix.sh + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE "$PARALLEL_MAKE" +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 13 17:06:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 13 Jun 2017 17:06:55 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper 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/2894 to look at the new patch set (#7). Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 12 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/7 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..3524b41 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,33 +1,14 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common_prefix.sh +. $(dirname "$0")/jenkins_common_prefix.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..7606839 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common_prefix.sh +. $(dirname "$0")/jenkins_common_prefix.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..97c0049 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,31 +1,14 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common_prefix.sh +. $(dirname "$0")/jenkins_common_prefix.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..86c3e7f 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common_prefix.sh +. $(dirname "$0")/jenkins_common_prefix.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 13 22:44:26 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Tue, 13 Jun 2017 22:44:26 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 2: (4 comments) https://gerrit.osmocom.org/#/c/2691/2//COMMIT_MSG Commit Message: Line 12: has the advantage of letting the build fail if not all location listings > I find this really hard to read. "Installing dependent libraries in..."? Ra Done Line 18: building when dependencies are installed in distinct directories > what so forth? AFAIK those two are all that is needed? Does it also manage Correct, those two are all that is needed. Commit message corrected. AM_CFLAGS is handled via pkg-config. https://gerrit.osmocom.org/#/c/2691/2/scripts/osmo-build-dep.sh File scripts/osmo-build-dep.sh: Line 51: mkdir -p "$inst/stow" > $inst is already an empty folder intended as prefix target. Do you really n I added a comment in the script as justification. Line 56: STOW_DIR="$inst/stow" stow --restow $project > I'm curious what this does. Could it get a single line comment? Done -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 13 22:45:34 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Tue, 13 Jun 2017 22:45:34 +0000 Subject: [PATCH] osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2691 to look at the new patch set (#3). Use stow for dependency management This commit introduces the usage of GNU stow[1] for dependency management. Stow uses symlinks to make dependencies available in a single directory althoguh they were installed in distinct directories. Keeping installation directories seperate has the advantage of letting the build fail if AM_CFLAGS and LDADD do not contain all dependencies which are actually used. Installing multiple dependencies into a single directory causes x_CFLAGS and x_LIBS variables to magically point where other dependencies are found as well, therefore missing entries can be overlooked. Stow acts as a convenience layer here, making it unnecessary to supply a list of locations in LD_LIBRARY_PATH, PKG_CONFIG_PATH and so forth for building when dependencies are installed in distinct directories manually. Stow has to be present on the jenkins build nodes for successful executing of osmo-build-dep.sh. [1] https://www.gnu.org/software/stow/ Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a --- M scripts/osmo-build-dep.sh 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/91/2691/3 diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 2a107ed..9c55498 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -48,6 +48,14 @@ fi git rev-parse HEAD # log current HEAD +# Keep the installation targets of the dependencies in a seperate directory +# hierarchy before stowing them to avoid wrongly suggesting that they are part +# of the -I and -L search paths +mkdir -p "$inst/stow" + autoreconf --install --force -./configure --prefix="$inst" $cfg +./configure --prefix="$inst/stow/$project" $cfg $MAKE $PARALLEL_MAKE install + +# Make the dependencies available through symlinks in $deps ($PWD/..). +STOW_DIR="$inst/stow" stow --restow $project -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 14 01:03:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 01:03:27 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cosmetic: dbg log fix in suite.py Message-ID: Review at https://gerrit.osmocom.org/2908 cosmetic: dbg log fix in suite.py Change-Id: I0ff92bc1aa05bf5020bbb3b6965cbb22f1ca4d61 --- M src/osmo_gsm_tester/suite.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/08/2908/1 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index be799d3..5c567f8 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -422,7 +422,7 @@ def bts_obj(suite_run, conf): bts_type = conf.get('type') - log.dbg(None, None, 'create BTS object', type=bts_type) + log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) -- To view, visit https://gerrit.osmocom.org/2908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ff92bc1aa05bf5020bbb3b6965cbb22f1ca4d61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 01:03:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 01:03:27 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-bts-trx: set l1c logging level to notice Message-ID: Review at https://gerrit.osmocom.org/2909 osmo-bts-trx: set l1c logging level to notice We have sporadic osmo-bts-trx shutdowns with "No clock from osmo-trx" error messages. Around it are L1C logs on level 'notice', so let's log those as well. Related: OS#2325 Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/09/2909/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 628aefa..452b920 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -9,7 +9,7 @@ logging level rll debug logging level rr debug logging level rsl debug - logging level l1c error + logging level l1c notice logging level l1p error ! phy 0 -- To view, visit https://gerrit.osmocom.org/2909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 01:04:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 01:04:00 +0000 Subject: osmo-gsm-tester[master]: cosmetic: dbg log fix in suite.py In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ff92bc1aa05bf5020bbb3b6965cbb22f1ca4d61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Jun 14 01:04:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 01:04:11 +0000 Subject: osmo-gsm-tester[master]: osmo-bts-trx: set l1c logging level to notice In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Jun 14 01:04:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 01:04:13 +0000 Subject: [MERGED] osmo-gsm-tester[master]: osmo-bts-trx: set l1c logging level to notice In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-bts-trx: set l1c logging level to notice ...................................................................... osmo-bts-trx: set l1c logging level to notice We have sporadic osmo-bts-trx shutdowns with "No clock from osmo-trx" error messages. Around it are L1C logs on level 'notice', so let's log those as well. Related: OS#2325 Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 628aefa..452b920 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -9,7 +9,7 @@ logging level rll debug logging level rr debug logging level rsl debug - logging level l1c error + logging level l1c notice logging level l1p error ! phy 0 -- To view, visit https://gerrit.osmocom.org/2909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic306d2dd8670550d84e9c446098bccaba147e13b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 01:04:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 01:04:13 +0000 Subject: [MERGED] osmo-gsm-tester[master]: cosmetic: dbg log fix in suite.py In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: dbg log fix in suite.py ...................................................................... cosmetic: dbg log fix in suite.py Change-Id: I0ff92bc1aa05bf5020bbb3b6965cbb22f1ca4d61 --- M src/osmo_gsm_tester/suite.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index be799d3..5c567f8 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -422,7 +422,7 @@ def bts_obj(suite_run, conf): bts_type = conf.get('type') - log.dbg(None, None, 'create BTS object', type=bts_type) + log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) -- To view, visit https://gerrit.osmocom.org/2908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ff92bc1aa05bf5020bbb3b6965cbb22f1ca4d61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 10:30:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 10:30:57 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Cancel pending async dbus methods at cleanup time Message-ID: Review at https://gerrit.osmocom.org/2910 ofono_client: Cancel pending async dbus methods at cleanup time This commit should fix issue described #2326, in which a test started scanning and quickly afterwards failed, leaving the async Scan() method running and the response arriving when we were already in another suite/test. Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 24 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/10/2910/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 4deff9e..70fee25 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -24,6 +24,11 @@ import pprint import sys +# Required for Gio.Cancellable. +# See https://lazka.github.io/pgi-docs/Gio-2.0/classes/Cancellable.html#Gio.Cancellable +from gi.module import get_introspection_module +Gio = get_introspection_module('Gio') + from gi.repository import GLib glib_main_loop = GLib.MainLoop() glib_main_ctx = glib_main_loop.get_context() @@ -90,7 +95,10 @@ try: ret = obj.call_finish(result) except Exception as e: - # return exception as value + if isinstance(e, GLib.Error) and e.code == Gio.IOErrorEnum.CANCELLED: + log.dbg('DBus method cancelled') + return + if error_callback: error_callback(obj, e, real_user_data) else: @@ -108,7 +116,7 @@ def dbus_async_call(instance, proxymethod, *proxymethod_args, result_handler=None, error_handler=None, - user_data=None, timeout=30, + user_data=None, timeout=30, cancellable=None, **proxymethod_kwargs): '''pydbus doesn't support asynchronous methods. This method adds support for it until pydbus implements it''' @@ -122,12 +130,13 @@ timeout = timeout * 1000 user_data = (result_handler, error_handler, user_data) + # See https://lazka.github.io/pgi-docs/Gio-2.0/classes/DBusProxy.html#Gio.DBusProxy.call ret = instance._bus.con.call( instance._bus_name, instance._path, proxymethod._iface_name, proxymethod.__name__, GLib.Variant(proxymethod._sinargs, proxymethod_args), GLib.VariantType.new(proxymethod._soutargs), - 0, timeout, None, + 0, timeout, cancellable, _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): @@ -316,6 +325,8 @@ self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 + # 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), ), @@ -323,6 +334,13 @@ self.dbus.watch_interfaces() def cleanup(self): + self.dbg('cleanup') + if self.cancellable: + self.cancellable.cancel() + # 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() + self.cancellable = None self.dbus.cleanup() self.dbus = None @@ -408,8 +426,9 @@ register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) error_handler = lambda obj, e, user_data: defer(self.scan_cb_error_handler, e, mcc_mnc) - dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, - error_handler=error_handler, user_data=mcc_mnc) + dbus_async_call(netreg, netreg.Scan, timeout=30, cancellable=self.cancellable, + result_handler=result_handler, error_handler=error_handler, + user_data=mcc_mnc) def scan_cb_error_handler(self, e, mcc_mnc): # It was detected that Scan() method can fail for some modems on some -- To view, visit https://gerrit.osmocom.org/2910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 10:32:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 10:32:41 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Cancel pending async dbus methods at cleanup time In-Reply-To: References: Message-ID: Patch Set 1: I tested this patch by calling self.cancellable.cancel() just after calling the async Scan() method and checking that the method is indeed cancelled correctly at some point afterwards (when glib mainloop is polled). -- To view, visit https://gerrit.osmocom.org/2910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d 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 Wed Jun 14 11:36:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 14 Jun 2017 11:36:13 +0000 Subject: [PATCH] osmo-bts[master]: Use systemd template specifiers Message-ID: Review at https://gerrit.osmocom.org/2911 Use systemd template specifiers Use systemd template specifier for config name instead of hardcoding it. This will allow to specify different config file name depending on the name of the service file. By default sysmobts-mgr.cfg will be used preserving compatibilty with existing installations but if the unit is named lc15bts-mgr.service than lc15bts-mgr.cfg will be used. This gives us necessary flexibility to use BTS-specific configuration. Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d Related: SYS#3686 --- M contrib/sysmobts-mgr.service 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/2911/1 diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 4a15bd8..182e306 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -1,9 +1,9 @@ [Unit] -Description=sysmocom sysmoBTS manager +Description=sysmocom %p manager [Service] Type=simple -ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg +ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/%p.cfg Restart=always RestartSec=2 -- To view, visit https://gerrit.osmocom.org/2911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 14 11:54:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 14 Jun 2017 11:54:25 +0000 Subject: [PATCH] osmo-bts[master]: Place *-mgr config examples according to BTS model Message-ID: Review at https://gerrit.osmocom.org/2912 Place *-mgr config examples according to BTS model * copy sysmobts-mgr.cfg to sysmo/ directory * add lc15bts-mgr.cfg The configuration is BTS-specific so it should be located inside appropriate subdirs. Note: the old copy of sysmobts-mgr.cfg can be removed once the image build recipes are adjusted. Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116 Related: SYS#3686 --- A doc/examples/litecell15/lc15bts-mgr.cfg A doc/examples/sysmo/sysmobts-mgr.cfg 2 files changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/12/2912/1 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg new file mode 100644 index 0000000..27ed326 --- /dev/null +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -0,0 +1,24 @@ +! +! SysmoMgr (0.3.0.141-33e5) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging timestamp 0 + logging level all everything + logging level temp info + logging level fw info + logging level find info + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice +! +line vty + no login +! +lc15bts-mgr diff --git a/doc/examples/sysmo/sysmobts-mgr.cfg b/doc/examples/sysmo/sysmobts-mgr.cfg new file mode 100644 index 0000000..3b28d78 --- /dev/null +++ b/doc/examples/sysmo/sysmobts-mgr.cfg @@ -0,0 +1,24 @@ +! +! SysmoMgr (0.3.0.141-33e5) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging timestamp 0 + logging level all everything + logging level temp info + logging level fw info + logging level find info + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice +! +line vty + no login +! +sysmobts-mgr -- To view, visit https://gerrit.osmocom.org/2912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 14 11:59:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 14 Jun 2017 11:59:05 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add example systemd service file Message-ID: Review at https://gerrit.osmocom.org/2913 lc15: add example systemd service file Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473 Related: SYS#3686 --- A contrib/osmo-bts-lc15.service 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/13/2913/1 diff --git a/contrib/osmo-bts-lc15.service b/contrib/osmo-bts-lc15.service new file mode 100644 index 0000000..a30d50f --- /dev/null +++ b/contrib/osmo-bts-lc15.service @@ -0,0 +1,20 @@ +[Unit] +Description=osmo-bts for LC15 / sysmoBTS 2100 + +[Service] +Type=simple +ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' +ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' +ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts.cfg -M +ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' +ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +# The msg queues must be read fast enough +CPUSchedulingPolicy=rr +CPUSchedulingPriority=1 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/2913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 14 12:04:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 14 Jun 2017 12:04:08 +0000 Subject: osmo-bts[master]: Name systemd service after the software In-Reply-To: References: Message-ID: Patch Set 2: Maybe we could temporary copy service file instead of renaming and once meta-sysmocom-bsp adjustements are complete we can remove the old copy? -- To view, visit https://gerrit.osmocom.org/2225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie336292c275e7415a1deedab7c3b44966aacc3bf 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: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 14 12:43:53 2017 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 14 Jun 2017 12:43:53 +0000 Subject: [ABANDON] osmo-pcu[master]: PDCH allocation across two TRX In-Reply-To: References: Message-ID: arvind.sirsikar has abandoned this change. Change subject: PDCH allocation across two TRX ...................................................................... Abandoned This feature is bigger activity and started implementation at the end of EGPRS project. Since it?s the initial approach which needs to be discussed and finalized on the community, we had not planned to merge it to OSMO-PCU master. As we thought that it would be good to not keep any changes with us hence pushed our changes to Radisys branch(http://git.osmocom.org/radisys/osmo-pcu/commit/?h=radisys/egprs_features) and raised for Gerrit review process (https://gerrit.osmocom.org/#/c/1512/). Here we wanted to provide our approach to community to support PDCH on multiple TRX so that if anyone from community is interested can take it forward. Hence abandoning it -- To view, visit https://gerrit.osmocom.org/1512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I222c3340872ffa1dd6e8fabe5276d793e660f67d Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Jun 14 12:54:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 12:54:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2884 to look at the new patch set (#3). Add support for SMPP testing As defined in [1], the different related actors are implemented in this commit: ESME and SMSC. SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or the MSC. A new Smsc abstract class is created to shared code between the NITB and the MSC, and also makes it easier for later when the SMSC is splitted. ESMEs can be dynamically added to its configuration in a similar way to how the BTSs are added. ESME: A new class Esme is created which can be used by tests to control an ESME to interact with the SMSC. The ESME functionalities are implemented using python-smpplib. Required version of this library is at least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support for python 3 and some required features to poll the socket. This commit already contains a few tests which checks different features and tests the API. Extending tested features or scenarios can be later done quite easily. The tests are not enabled by default right now, because there are several of them in a suite and the ip_address resources are not freed after every tests which ends up in the suite failing due to missing reserved resources. All the tests run alone work though. When the issue is fixed they can then be added to the default list of tests to be run. [1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da --- M selftest/template_test.ok M selftest/template_test.py M selftest/template_test/osmo-nitb.cfg.tmpl A src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/sms.py A src/osmo_gsm_tester/smsc.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/test.py A suites/aoip_smpp/esme_connect_policy_acceptall.py A suites/aoip_smpp/esme_connect_policy_closed.py A suites/aoip_smpp/esme_ms_sms.py A suites/aoip_smpp/suite.conf A suites/smpp/esme_connect_policy_acceptall.py A suites/smpp/esme_connect_policy_closed.py A suites/smpp/esme_ms_sms.py A suites/smpp/suite.conf 20 files changed, 520 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/2884/3 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 1267dac..b16ea62 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -136,10 +136,13 @@ phys_chan_config val_phys_chan_config_3 smpp local-tcp-ip val_ip_address 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy val_smsc_policy + esme val_system_id_esme0 + password val_password_esme0 + default-route + esme val_system_id_esme1 + password val_password_esme1 default-route ctrl bind val_ip_address diff --git a/selftest/template_test.py b/selftest/template_test.py index 45347b6..76fb86b 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -35,6 +35,11 @@ ) } +mock_esme = { + 'system_id': 'val_system_id', + 'password': 'val_password' +} + def clone_mod(d, val_ext): c = dict(d) for name in c.keys(): @@ -47,7 +52,14 @@ mock_bts0 = clone_mod(mock_bts, '_bts0') mock_bts1 = clone_mod(mock_bts, '_bts1') +mock_esme0 = clone_mod(mock_esme, '_esme0') +mock_esme1 = clone_mod(mock_esme, '_esme1') + vals = dict(nitb=dict( + smsc=dict( + policy='val_smsc_policy', + esme_list=(mock_esme0, mock_esme1) + ), net=dict( mcc='val_mcc', mnc='val_mnc', diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 3404b7f..d02e3fe 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -47,12 +47,14 @@ timer t3119 0 timer t3141 0 smpp - local-tcp-ip ${smpp_bind_ip} 2775 - system-id test - policy closed - esme test - password test + local-tcp-ip ${nitb.ip_address.addr} 2775 + system-id test-nitb + policy ${nitb.smsc.policy} +%for esme in esme_list: + esme ${esme.system_id} + password ${esme.password} default-route +%endfor ctrl bind ${ctrl_bind_ip} %for bts in bts_list: diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py new file mode 100644 index 0000000..31649ed --- /dev/null +++ b/src/osmo_gsm_tester/esme.py @@ -0,0 +1,133 @@ +# osmo_gsm_tester: SMPP ESME to talk to SMSC +# +# Copyright (C) 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 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 . + +import smpplib.gsm +import smpplib.client +import smpplib.consts +import smpplib.exceptions + +from . import log, util, event_loop, sms + +# if you want to know what's happening inside python-smpplib +#import logging +#logging.basicConfig(level='DEBUG') + +class Esme(log.Origin): + msisdn = None + client = None + smsc = None + + def __init__(self): + self.system_id = 'esme-id' + self.password = 'esme-pwd' + super().__init__(log.C_TST, self.system_id) + self.connected = False + self.binded = False + self.listen_flag = False + + def __del__(self): + try: + self.disconnect() + except smpplib.exceptions.ConnectionError: + pass + + def set_smsc(self, smsc): + self.smsc = smsc + + def set_system_id(self, name=None): + self.system_id = name + + def set_password(self, password=None): + self.password = password + + def conf_for_smsc(self): + config = { 'system_id': self.system_id, 'password': self.password } + return config + + def poll_handler(self): + self.client.poll() + + def start_listening(self): + self.listen_flag = True + event_loop.register_poll_func(self.poll_handler) + + def stop_listening(self): + if self.listen_flag: + self.listen_flag = False + # Empty the queue before processing the unbind + disconnect PDUs + event_loop.unregister_poll_func(self.poll_handler) + self.poll_handler() + + def connect(self): + host, port = self.smsc.smpp_addr_port() + if self.client: + self.disconnect() + self.client = smpplib.client.Client(host, port, timeout=None) + self.client.set_message_sent_handler( + lambda pdu: self.dbg('message sent:', repr(pdu)) ) + self.client.set_message_received_handler( + lambda pdu: self.dbg('message received:', repr(pdu)) ) + self.client.connect() + self.connected = True + self.client.bind_transceiver(system_id=self.system_id, password=self.password) + self.binded = True + self.log('Connected and binded successfully. Start listening') + self.start_listening() + + def disconnect(self): + self.stop_listening() + if self.binded: + self.client.unbind() + self.binded = False + if self.connected: + self.client.disconnect() + self.connected = False + + def set_msisdn(self, msisdn): + self.msisdn = msisdn + self.set_name('esme-%s' % self.msisdn) + + def run_method_expect_failure(self, errcode, method, *args): + try: + method(*args) + #it should not succeed, raise an exception: + raise log.Error('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) + except smpplib.exceptions.PDUError as e: + if e.args[1] != errcode: + raise e + + def sms_send(self, sms_obj): + parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) + + self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + for part in parts: + pdu = self.client.send_message( + source_addr_ton=smpplib.consts.SMPP_TON_INTL, + source_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + source_addr=sms_obj.src_msisdn(), + dest_addr_ton=smpplib.consts.SMPP_TON_INTL, + dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + destination_addr=sms_obj.dst_msisdn(), + short_message=part, + data_coding=encoding_flag, + esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, + registered_delivery=False, + ) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 443b254..d265e36 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -20,9 +20,9 @@ import os import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc -class OsmoMsc(log.Origin): +class OsmoMsc(log.Origin, smsc.Smsc): suite_run = None ip_address = None run_dir = None @@ -32,7 +32,8 @@ config = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): - super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) + log.Origin.__init__(self, log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) + smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) self.suite_run = suite_run self.ip_address = ip_address self.hlr = hlr @@ -73,8 +74,8 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) + config.overlay(values, dict(msc=self.smsc_config())) self.config = values - self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3104842..d18fc1a 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -21,9 +21,9 @@ import re import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc -class OsmoNitb(log.Origin): +class OsmoNitb(log.Origin, smsc.Smsc): suite_run = None ip_address = None run_dir = None @@ -32,7 +32,8 @@ bts = None def __init__(self, suite_run, ip_address): - super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) + log.Origin.__init__(self, log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) + smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) self.suite_run = suite_run self.ip_address = ip_address self.bts = [] @@ -75,8 +76,8 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + config.overlay(values, dict(nitb=self.smsc_config())) self.config = values - self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 570ef96..e264b66 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -21,14 +21,16 @@ _last_sms_idx = 0 msg = None - def __init__(self, from_msisdn=None, to_msisdn=None, *tokens): + def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): Sms._last_sms_idx += 1 + self._src_msisdn = src_msisdn + self._dst_msisdn = dst_msisdn msgs = ['message nr. %d' % Sms._last_sms_idx] msgs.extend(tokens) - if from_msisdn: - msgs.append('from %s' % from_msisdn) - if to_msisdn: - msgs.append('to %s' % to_msisdn) + if src_msisdn: + msgs.append('from %s' % src_msisdn) + if dst_msisdn: + msgs.append('to %s' % dst_msisdn) self.msg = ', '.join(msgs) def __str__(self): @@ -42,6 +44,12 @@ return self.msg == other.msg return self.msg == other + def src_msisdn(self): + return self._src_msisdn + + def dst_msisdn(self): + return self._dst_msisdn + def matches(self, msg): return self.msg == msg diff --git a/src/osmo_gsm_tester/smsc.py b/src/osmo_gsm_tester/smsc.py new file mode 100644 index 0000000..e255be0 --- /dev/null +++ b/src/osmo_gsm_tester/smsc.py @@ -0,0 +1,51 @@ +# osmo_gsm_tester: smsc interface +# +# 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 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 . + +from . import log, config, util, template, process + +class Smsc: + esmes = None + + SMSC_POLICY_CLOSED = 'closed' + SMSC_POLICY_ACCEPT_ALL = 'accept-all' + + def __init__(self, smpp_addr_port): + self.addr_port = smpp_addr_port + self.policy = self.SMSC_POLICY_CLOSED + self.esmes = [] + + def smsc_config(self): + values = { 'smsc': { 'policy': self.policy } } + esme_list = [] + for esme in self.esmes: + esme_list.append(esme.conf_for_smsc()) + config.overlay(values, dict(smsc=dict(esme_list=esme_list))) + return values + + def esme_add(self, esme): + self.esmes.append(esme) + esme.set_smsc(self) + + def smpp_addr_port(self): + return self.addr_port + + def set_smsc_policy(self, smsc_policy): + self.policy = smsc_policy + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 5c567f8..f30333e 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import copy import traceback import pprint -from . import config, log, template, util, resource, schema, ofono_client, event_loop +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 test @@ -92,7 +92,7 @@ log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop, sms) with self.redirect_stdout(): util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) @@ -343,8 +343,13 @@ l.append(self.modem()) return l + def esme(self): + esme_obj = esme.Esme() + esme_obj.set_msisdn(self.msisdn()) + return esme_obj + def msisdn(self): - msisdn = self.resources_pool.next_msisdn(self.origin) + msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) return msisdn diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 247365e..1a00af7 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -21,12 +21,14 @@ assign-tmsi ctrl bind ${msc.ip_address.addr} -smpp - local-tcp-ip ${msc.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test - default-route + smpp + local-tcp-ip ${msc.ip_address.addr} 2775 + system-id test-nitb + policy ${msc.smsc.policy} + %for esme in msc.smsc.esme_list: + esme ${esme.system_id} + password ${esme.password} + default-route + %endfor hlr remote-ip ${hlr.ip_address.addr} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index a47ac02..a2bd249 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -76,10 +76,12 @@ %endfor smpp local-tcp-ip ${nitb.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy ${nitb.smsc.policy} +%for esme in nitb.smsc.esme_list: + esme ${esme.system_id} + password ${esme.password} default-route +%endfor ctrl bind ${nitb.ip_address.addr} diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..49911b3 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,9 +33,10 @@ poll = None prompt = None Timeout = None +Sms = None -def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout +def setup(suite_run, _test, ofono_client, suite_module, event_module, sms_module): + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms trial = suite_run.trial suite = suite_run test = _test @@ -49,5 +50,6 @@ poll = event_module.poll prompt = suite_run.prompt Timeout = suite_module.Timeout + Sms = sms_module.Sms # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..d3ec2f5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on the config file + +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) +bsc.bts_add(bts) + +esme = suite.esme() +msc.set_smsc_policy(msc.SMSC_POLICY_ACCEPT_ALL) + +# here we deliberately ommit calling msc.esme_add() to avoid having it included in the smsc config. +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +# Connect should work even if we didn't previously configure the esme in the smsc. +esme.set_smsc(msc) +esme.connect() +esme.disconnect() diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..0c989b5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_closed.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +bsc.bts_add(bts) + +esme = suite.esme() +msc.set_smsc_policy(msc.SMSC_POLICY_CLOSED) +msc.esme_add(esme) + +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +# Connect should work as we configured msc properly at esme_add() time. +log('Test with correct credentials...') +esme.connect() +esme.disconnect() + +# We now change the password, it should fail: +log('Test with bad password...') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +# We now change the system_id, it should fail: +log('Test with bad system id...') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms.py new file mode 100755 index 0000000..41cf9b5 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.esme_add(esme) +print('start msc and bts...') +hlr.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) +ms.connect(msc.mcc_mnc()) + +ms.log_info() +print('waiting for modem to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(msc.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf new file mode 100644 index 0000000..1a863a7 --- /dev/null +++ b/suites/aoip_smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 4 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s diff --git a/suites/smpp/esme_connect_policy_acceptall.py b/suites/smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..7efc759 --- /dev/null +++ b/suites/smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on the config file + +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +esme = suite.esme() + +nitb.set_smsc_policy(nitb.SMSC_POLICY_ACCEPT_ALL) +# here we deliberately ommit calling nitb.esme_add() to avoid having it included in the smsc config. +nitb.start() + +# Connect should work even if we didn't previously configure the esme in the smsc. +esme.set_smsc(nitb) +esme.connect() +esme.disconnect() diff --git a/suites/smpp/esme_connect_policy_closed.py b/suites/smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..916fade --- /dev/null +++ b/suites/smpp/esme_connect_policy_closed.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +nitb = suite.nitb() +esme = suite.esme() + +nitb.set_smsc_policy(nitb.SMSC_POLICY_CLOSED) +nitb.esme_add(esme) + +nitb.start() + +# Connect should work as we configured nitb properly at esme_add() time. +log('Test with correct credentials...') +esme.connect() +esme.disconnect() + +# We now change the password, it should fail: +log('Test with bad password...') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +# We now change the system_id, it should fail: +log('Test with bad system id...') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py new file mode 100755 index 0000000..9606e40 --- /dev/null +++ b/suites/smpp/esme_ms_sms.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) +ms.connect(nitb.mcc_mnc()) + +ms.log_info() +print('waiting for modem to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 3 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 Wed Jun 14 12:54:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 12:54:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Unuse resources after every test Message-ID: Review at https://gerrit.osmocom.org/2914 Unuse resources after every test There was a bug in put_all method. Nobody was using it until now and this test starts using it so it fixes it too. The process list is also cleaned after the processes are stopped, otherwise the suite eventually fails with a 'process terminated prematurely' error. Before it was not necessary because it was not reused (a new suite run was created). Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 2 files changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/14/2914/1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index dbfc4e0..5ad6ba6 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -508,9 +508,10 @@ my_item.pop(USED_KEY) def put_all(self): + if not self.reserved: + return for key, item_list in self.reserved.items(): - my_list = self.get(key) - for my_item in my_list: + for my_item in item_list: if my_item.get(USED_KEY): my_item.pop(USED_KEY) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index f30333e..979c30f 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -237,6 +237,9 @@ test.set_skip() continue test.run() + self.stop_processes() + self.objects_cleanup() + self.reserved_resources.put_all() except Exception: log.log_exn() except BaseException as e: @@ -288,6 +291,7 @@ return for process in self._processes: process.terminate() + self._processes = None def free_resources(self): if self.reserved_resources is None: -- To view, visit https://gerrit.osmocom.org/2914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 12:54:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 12:54:36 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use a subdir of run_dir for each test Message-ID: Review at https://gerrit.osmocom.org/2915 Use a subdir of run_dir for each test Processes created have the scope of the test, so we should store everything in a per-suite_run/per-test directory, otherwise everything is stored in the same trial run_dir directory and it's really messy. We pass a test object instead of a suite_run object to all the classes requiring to store something on disk. Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/osmo_stp.py M src/osmo_gsm_tester/pcap_recorder.py M src/osmo_gsm_tester/suite.py 10 files changed, 90 insertions(+), 76 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/2915/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7d12c85..7ebe6cc 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -22,7 +22,7 @@ from . import log, config, util, template, process, event_loop class OsmoBtsTrx(log.Origin): - suite_run = None + test = None bsc = None run_dir = None inst = None @@ -35,9 +35,9 @@ CONF_BTS_TRX = 'osmo-bts-trx.cfg' - def __init__(self, suite_run, conf): + def __init__(self, test, conf): super().__init__(log.C_RUN, OsmoBtsTrx.BIN_BTS_TRX) - self.suite_run = suite_run + self.test = test self.conf = conf self.env = {} @@ -48,13 +48,13 @@ 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.test.suite_run.poll() self.log('Starting to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) + self.inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') if not os.path.isdir(lib): raise RuntimeError('No lib/ in %r' % self.inst) @@ -68,7 +68,7 @@ '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) #self.launch_process(OsmoBtsTrx.BIN_PCU, '-r', '1') - self.suite_run.poll() + self.test.suite_run.poll() def trx_ready(self): if not self.proc_trx or not self.proc_trx.is_running: @@ -83,7 +83,7 @@ proc = process.Process(binary_name, run_dir, (binary,) + args, env=self.env) - self.suite_run.remember_to_stop(proc) + self.test.suite_run.remember_to_stop(proc) proc.launch() return proc @@ -94,7 +94,7 @@ self.dbg(config_file=self.config_file) values = dict(osmo_bts_trx=config.get_defaults('osmo_bts_trx')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, dict(osmo_bts_trx=dict(oml_remote_ip=self.bsc.addr()))) config.overlay(values, dict(osmo_bts_trx=self.conf)) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 30fff0e..b48fa09 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -22,7 +22,7 @@ from . import log, config, util, template, process class SysmoBts(log.Origin): - suite_run = None + test = None bsc = None run_dir = None inst = None @@ -34,9 +34,9 @@ BTS_SYSMO_BIN = 'osmo-bts-sysmo' BTS_SYSMO_CFG = 'osmo-bts-sysmo.cfg' - def __init__(self, suite_run, conf): + def __init__(self, test, conf): super().__init__(log.C_RUN, self.BTS_SYSMO_BIN) - self.suite_run = suite_run + self.test = test self.conf = conf self.remote_env = {} self.remote_user = 'root' @@ -45,10 +45,10 @@ if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') log.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() - self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) + self.inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst(SysmoBts.BTS_SYSMO_BIN))) lib = self.inst.child('lib') if not os.path.isdir(lib): raise log.Error('No lib/ in', self.inst) @@ -95,7 +95,7 @@ def launch_remote(self, name, popen_args, remote_cwd=None): proc = self._process_remote(name, popen_args, remote_cwd) - self.suite_run.remember_to_stop(proc) + self.test.suite_run.remember_to_stop(proc) proc.launch() def run_local(self, name, popen_args): @@ -118,7 +118,7 @@ self.dbg(config_file=self.config_file) values = { 'osmo_bts_sysmo': config.get_defaults('osmo_bts_sysmo') } - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr() } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 5447118..19a9988 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -23,29 +23,29 @@ from . import log, util, config, template, process, osmo_ctrl, pcap_recorder class OsmoBsc(log.Origin): - suite_run = None + test = None ip_address = None run_dir = None config_file = None process = None bts = None - def __init__(self, suite_run, msc, ip_address): + def __init__(self, test, msc, ip_address): super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) - self.suite_run = suite_run + self.test = test self.ip_address = ip_address self.bts = [] self.msc = msc def start(self): self.log('Starting osmo-bsc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() # NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the # osmo-msc build will also provide the OsmoBSC binary. As soon as the # repositories are separate, there shall be a separate artifact. - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst('osmo-msc'))) binary = inst.child('bin', 'osmo-bsc') if not os.path.isfile(binary): @@ -55,7 +55,7 @@ raise RuntimeError('No lib/ in %r' % inst) iface = util.ip_to_iface(self.addr()) - pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + pcap_recorder.PcapRecorder(self.test, self.run_dir.new_dir('pcap'), iface, 'host %s and port not 22' % self.addr()) env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } @@ -65,7 +65,7 @@ (binary, '-c', os.path.abspath(self.config_file)), env=env) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def configure(self): @@ -73,7 +73,7 @@ self.dbg(config_file=self.config_file) values = dict(bsc=config.get_defaults('bsc')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, dict(bsc=dict(ip_address=self.ip_address))) bts_list = [] diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 110faa5..817ca09 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -24,25 +24,25 @@ from . import log, util, config, template, process, osmo_ctrl, pcap_recorder class OsmoHlr(log.Origin): - suite_run = None + test = None ip_address = None run_dir = None config_file = None process = None next_subscriber_id = 1 - def __init__(self, suite_run, ip_address): + def __init__(self, test, ip_address): super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) - self.suite_run = suite_run + self.test = test self.ip_address = ip_address self.bts = [] def start(self): self.log('Starting osmo-hlr') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-hlr'))) + inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst('osmo-hlr'))) binary = inst.child('bin', 'osmo-hlr') if not os.path.isfile(binary): @@ -59,7 +59,7 @@ self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) iface = util.ip_to_iface(self.addr()) - pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + pcap_recorder.PcapRecorder(self.test, self.run_dir.new_dir('pcap'), iface, 'host %s' % self.addr()) env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } @@ -70,7 +70,7 @@ '-c', os.path.abspath(self.config_file), '--database', self.db_file), env=env) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def configure(self): @@ -78,7 +78,7 @@ self.dbg(config_file=self.config_file) values = dict(hlr=config.get_defaults('hlr')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, dict(hlr=dict(ip_address=self.ip_address))) self.dbg('HLR CONFIG:\n' + pprint.pformat(values)) @@ -115,7 +115,7 @@ def subscriber_add(self, modem, msisdn=None): if msisdn is None: - msisdn = self.suite_run.resources_pool.next_msisdn(modem) + msisdn = self.test.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) subscriber_id = self.next_subscriber_id self.next_subscriber_id += 1 diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index b385274..7939ef3 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -23,24 +23,24 @@ from . import log, util, config, template, process, osmo_ctrl, pcap_recorder class OsmoMgcpgw(log.Origin): - suite_run = None + test = None ip_address = None run_dir = None config_file = None process = None - def __init__(self, suite_run, ip_address, bts_ip): + def __init__(self, test, ip_address, bts_ip): super().__init__(log.C_RUN, 'osmo-mgcpgw_%s' % ip_address.get('addr')) - self.suite_run = suite_run + self.test = test self.ip_address = ip_address # hack: so far mgcpgw needs one specific BTS IP. self.bts_ip = bts_ip def start(self): self.log('Starting osmo-mgcpgw') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst('osmo-msc'))) binary = inst.child('bin', 'osmo-bsc_mgcp') if not os.path.isfile(binary): raise RuntimeError('Binary missing: %r' % binary) @@ -49,7 +49,7 @@ raise RuntimeError('No lib/ in %r' % inst) iface = util.ip_to_iface(self.addr()) - pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + pcap_recorder.PcapRecorder(self.test, self.run_dir.new_dir('pcap'), iface, 'host %s and port not 22' % self.addr()) env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } @@ -59,7 +59,7 @@ (binary, '-c', os.path.abspath(self.config_file)), env=env) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def configure(self): @@ -67,7 +67,7 @@ self.dbg(config_file=self.config_file) values = dict(mgcpgw=config.get_defaults('mgcpgw')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, dict(mgcpgw=dict(ip_address=self.ip_address, bts_ip=self.bts_ip))) self.dbg('MGCPGW CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index d265e36..7b89874 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -23,7 +23,7 @@ from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoMsc(log.Origin, smsc.Smsc): - suite_run = None + test = None ip_address = None run_dir = None config_file = None @@ -31,19 +31,19 @@ hlr = None config = None - def __init__(self, suite_run, hlr, mgcpgw, ip_address): + def __init__(self, test, hlr, mgcpgw, ip_address): log.Origin.__init__(self, log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) - self.suite_run = suite_run + self.test = test self.ip_address = ip_address self.hlr = hlr self.mgcpgw = mgcpgw def start(self): self.log('Starting osmo-msc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst('osmo-msc'))) binary = inst.child('bin', 'osmo-msc') if not os.path.isfile(binary): raise RuntimeError('Binary missing: %r' % binary) @@ -52,7 +52,7 @@ raise RuntimeError('No lib/ in %r' % inst) iface = util.ip_to_iface(self.addr()) - pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + pcap_recorder.PcapRecorder(self.test, self.run_dir.new_dir('pcap'), iface, 'host %s and port not 22' % self.addr()) env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } @@ -62,7 +62,7 @@ (binary, '-c', os.path.abspath(self.config_file)), env=env) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def configure(self): @@ -70,7 +70,7 @@ self.dbg(config_file=self.config_file) values = dict(msc=config.get_defaults('msc')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.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.hlr.conf_for_msc()) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index d18fc1a..d2c8fc5 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -24,25 +24,25 @@ from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoNitb(log.Origin, smsc.Smsc): - suite_run = None + test = None ip_address = None run_dir = None config_file = None process = None bts = None - def __init__(self, suite_run, ip_address): + def __init__(self, test, ip_address): log.Origin.__init__(self, log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) - self.suite_run = suite_run + self.test = test self.ip_address = ip_address self.bts = [] def start(self): self.log('Starting osmo-nitb') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-nitb'))) + inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst('osmo-nitb'))) binary = inst.child('bin', 'osmo-nitb') if not os.path.isfile(binary): raise RuntimeError('Binary missing: %r' % binary) @@ -51,7 +51,7 @@ raise RuntimeError('No lib/ in %r' % inst) iface = util.ip_to_iface(self.addr()) - pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + pcap_recorder.PcapRecorder(self.test, self.run_dir.new_dir('pcap'), iface, 'host %s and port not 22' % self.addr()) env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } @@ -61,7 +61,7 @@ (binary, '-c', os.path.abspath(self.config_file)), env=env) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def configure(self): @@ -69,7 +69,7 @@ self.dbg(config_file=self.config_file) values = dict(nitb=config.get_defaults('nitb')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, dict(nitb=dict(ip_address=self.ip_address))) bts_list = [] @@ -103,7 +103,7 @@ def subscriber_add(self, modem, msisdn=None): if msisdn is None: - msisdn = self.suite_run.resources_pool.next_msisdn(modem) + msisdn = self.test.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py index f1ad6fc..930d5cc 100644 --- a/src/osmo_gsm_tester/osmo_stp.py +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -23,25 +23,25 @@ from . import log, util, config, template, process, pcap_recorder class OsmoStp(log.Origin): - suite_run = None + test = None ip_address = None run_dir = None config_file = None process = None - def __init__(self, suite_run, ip_address): + def __init__(self, test, ip_address): super().__init__(log.C_RUN, 'osmo-stp_%s' % ip_address.get('addr')) - self.suite_run = suite_run + self.test = test self.ip_address = ip_address def start(self): self.log('Starting osmo-stp') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.test.get_run_dir().new_dir(self.name())) self.configure() # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of # OsmoMSC. - inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmo-msc'))) + inst = util.Dir(os.path.abspath(self.test.suite_run.trial.get_inst('osmo-msc'))) binary = inst.child('bin', 'osmo-stp') if not os.path.isfile(binary): @@ -52,7 +52,7 @@ # TODO: osmo-stp is not yet configurable to a specific IP address #iface = util.ip_to_iface(self.addr()) - #pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), iface, + #pcap_recorder.PcapRecorder(self.test, self.run_dir.new_dir('pcap'), iface, # 'host %s and port not 22' % self.addr()) env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } @@ -62,7 +62,7 @@ (binary, '-c', os.path.abspath(self.config_file)), env=env) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def configure(self): @@ -70,7 +70,7 @@ self.dbg(config_file=self.config_file) values = dict(stp=config.get_defaults('stp')) - config.overlay(values, self.suite_run.config()) + config.overlay(values, self.test.suite_run.config()) config.overlay(values, dict(stp=dict(ip_address=self.ip_address))) self.dbg('STP CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/pcap_recorder.py b/src/osmo_gsm_tester/pcap_recorder.py index 398ec6c..be08ccb 100644 --- a/src/osmo_gsm_tester/pcap_recorder.py +++ b/src/osmo_gsm_tester/pcap_recorder.py @@ -26,13 +26,13 @@ class PcapRecorder(log.Origin): - def __init__(self, suite_run, run_dir, iface=None, filters=''): + def __init__(self, test, run_dir, iface=None, filters=''): self.iface = iface if not self.iface: self.iface = "any" self.filters = filters super().__init__(log.C_RUN, 'pcap-recorder_%s' % self.iface, filters=self.filters) - self.suite_run = suite_run + self.test = test self.run_dir = run_dir self.start() @@ -44,7 +44,7 @@ '-i', self.iface, '-w', dumpfile, self.filters)) - self.suite_run.remember_to_stop(self.process) + self.test.suite_run.remember_to_stop(self.process) self.process.launch() def running(self): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 979c30f..33a1b35 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -76,6 +76,8 @@ PASS = 'pass' FAIL = 'FAIL' + _run_dir = None + def __init__(self, suite_run, test_basename): self.basename = test_basename super().__init__(log.C_TST, self.basename) @@ -86,6 +88,11 @@ self.duration = 0 self.fail_type = None self.fail_message = None + + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name)) + return self._run_dir def run(self): try: @@ -165,6 +172,7 @@ _resource_requirements = None _config = None _processes = None + _run_dir = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): super().__init__(log.C_TST, suite_scenario_str) @@ -209,6 +217,11 @@ config.combine(combination, c) return combination + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.trial.get_run_dir().new_dir(self.name())) + return self._run_dir + def resource_requirements(self): if self._resource_requirements is None: self._resource_requirements = self.combined('resources') @@ -236,6 +249,7 @@ if names and not test.name() in names: test.set_skip() continue + self.current_test = test test.run() self.stop_processes() self.objects_cleanup() @@ -304,35 +318,35 @@ def nitb(self, ip_address=None): if ip_address is None: ip_address = self.ip_address() - return osmo_nitb.OsmoNitb(self, ip_address) + return osmo_nitb.OsmoNitb(self.current_test, ip_address) def hlr(self, ip_address=None): if ip_address is None: ip_address = self.ip_address() - return osmo_hlr.OsmoHlr(self, ip_address) + return osmo_hlr.OsmoHlr(self.current_test, ip_address) def mgcpgw(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_mgcpgw.OsmoMgcpgw(self.current_test, ip_address, bts_ip) def msc(self, hlr, mgcpgw, 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.current_test, hlr, mgcpgw, ip_address) def bsc(self, msc, ip_address=None): if ip_address is None: ip_address = self.ip_address() - return osmo_bsc.OsmoBsc(self, msc, ip_address) + return osmo_bsc.OsmoBsc(self.current_test, msc, ip_address) def stp(self, ip_address=None): if ip_address is None: ip_address = self.ip_address() - return osmo_stp.OsmoStp(self, ip_address) + return osmo_stp.OsmoStp(self.current_test, ip_address) def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + return bts_obj(self.current_test, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 13:13:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:13:51 +0000 Subject: osmo-bts[master]: Use systemd template specifiers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d 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 Jun 14 13:14:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:14:06 +0000 Subject: osmo-bts[master]: Place *-mgr config examples according to BTS model In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116 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 Jun 14 13:15:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:15:34 +0000 Subject: osmo-bts[master]: lc15: add example systemd service file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Wed Jun 14 13:15:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:15:38 +0000 Subject: [MERGED] osmo-bts[master]: Use systemd template specifiers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use systemd template specifiers ...................................................................... Use systemd template specifiers Use systemd template specifier for config name instead of hardcoding it. This will allow to specify different config file name depending on the name of the service file. By default sysmobts-mgr.cfg will be used preserving compatibilty with existing installations but if the unit is named lc15bts-mgr.service than lc15bts-mgr.cfg will be used. This gives us necessary flexibility to use BTS-specific configuration. Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d Related: SYS#3686 --- M contrib/sysmobts-mgr.service 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/sysmobts-mgr.service b/contrib/sysmobts-mgr.service index 4a15bd8..182e306 100644 --- a/contrib/sysmobts-mgr.service +++ b/contrib/sysmobts-mgr.service @@ -1,9 +1,9 @@ [Unit] -Description=sysmocom sysmoBTS manager +Description=sysmocom %p manager [Service] Type=simple -ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg +ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/%p.cfg Restart=always RestartSec=2 -- To view, visit https://gerrit.osmocom.org/2911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 14 13:15:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:15:42 +0000 Subject: [MERGED] osmo-bts[master]: Place *-mgr config examples according to BTS model In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Place *-mgr config examples according to BTS model ...................................................................... Place *-mgr config examples according to BTS model * copy sysmobts-mgr.cfg to sysmo/ directory * add lc15bts-mgr.cfg The configuration is BTS-specific so it should be located inside appropriate subdirs. Note: the old copy of sysmobts-mgr.cfg can be removed once the image build recipes are adjusted. Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116 Related: SYS#3686 --- A doc/examples/litecell15/lc15bts-mgr.cfg A doc/examples/sysmo/sysmobts-mgr.cfg 2 files changed, 48 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg new file mode 100644 index 0000000..27ed326 --- /dev/null +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -0,0 +1,24 @@ +! +! SysmoMgr (0.3.0.141-33e5) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging timestamp 0 + logging level all everything + logging level temp info + logging level fw info + logging level find info + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice +! +line vty + no login +! +lc15bts-mgr diff --git a/doc/examples/sysmo/sysmobts-mgr.cfg b/doc/examples/sysmo/sysmobts-mgr.cfg new file mode 100644 index 0000000..3b28d78 --- /dev/null +++ b/doc/examples/sysmo/sysmobts-mgr.cfg @@ -0,0 +1,24 @@ +! +! SysmoMgr (0.3.0.141-33e5) configuration saved from vty +!! +! +log stderr + logging filter all 1 + logging color 1 + logging timestamp 0 + logging level all everything + logging level temp info + logging level fw info + logging level find info + logging level lglobal notice + logging level llapd notice + logging level linp notice + logging level lmux notice + logging level lmi notice + logging level lmib notice + logging level lsms notice +! +line vty + no login +! +sysmobts-mgr -- To view, visit https://gerrit.osmocom.org/2912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 14 13:15:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:15:45 +0000 Subject: [MERGED] osmo-bts[master]: lc15: add example systemd service file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: add example systemd service file ...................................................................... lc15: add example systemd service file Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473 Related: SYS#3686 --- A contrib/osmo-bts-lc15.service 1 file changed, 20 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/osmo-bts-lc15.service b/contrib/osmo-bts-lc15.service new file mode 100644 index 0000000..a30d50f --- /dev/null +++ b/contrib/osmo-bts-lc15.service @@ -0,0 +1,20 @@ +[Unit] +Description=osmo-bts for LC15 / sysmoBTS 2100 + +[Service] +Type=simple +ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' +ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' +ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts.cfg -M +ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr0/brightness' +ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness' +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +# The msg queues must be read fast enough +CPUSchedulingPolicy=rr +CPUSchedulingPriority=1 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/2913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 13:16:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:16:29 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 7 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 Wed Jun 14 13:16:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 14 Jun 2017 13:16:55 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 7 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 Wed Jun 14 13:23:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 13:23:31 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Cancel pending async dbus methods at cleanup time In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d 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 Wed Jun 14 13:23:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 13:23:34 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ofono_client: Cancel pending async dbus methods at cleanup time In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ofono_client: Cancel pending async dbus methods at cleanup time ...................................................................... ofono_client: Cancel pending async dbus methods at cleanup time This commit should fix issue described #2326, in which a test started scanning and quickly afterwards failed, leaving the async Scan() method running and the response arriving when we were already in another suite/test. Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 24 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: 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 4deff9e..70fee25 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -24,6 +24,11 @@ import pprint import sys +# Required for Gio.Cancellable. +# See https://lazka.github.io/pgi-docs/Gio-2.0/classes/Cancellable.html#Gio.Cancellable +from gi.module import get_introspection_module +Gio = get_introspection_module('Gio') + from gi.repository import GLib glib_main_loop = GLib.MainLoop() glib_main_ctx = glib_main_loop.get_context() @@ -90,7 +95,10 @@ try: ret = obj.call_finish(result) except Exception as e: - # return exception as value + if isinstance(e, GLib.Error) and e.code == Gio.IOErrorEnum.CANCELLED: + log.dbg('DBus method cancelled') + return + if error_callback: error_callback(obj, e, real_user_data) else: @@ -108,7 +116,7 @@ def dbus_async_call(instance, proxymethod, *proxymethod_args, result_handler=None, error_handler=None, - user_data=None, timeout=30, + user_data=None, timeout=30, cancellable=None, **proxymethod_kwargs): '''pydbus doesn't support asynchronous methods. This method adds support for it until pydbus implements it''' @@ -122,12 +130,13 @@ timeout = timeout * 1000 user_data = (result_handler, error_handler, user_data) + # See https://lazka.github.io/pgi-docs/Gio-2.0/classes/DBusProxy.html#Gio.DBusProxy.call ret = instance._bus.con.call( instance._bus_name, instance._path, proxymethod._iface_name, proxymethod.__name__, GLib.Variant(proxymethod._sinargs, proxymethod_args), GLib.VariantType.new(proxymethod._soutargs), - 0, timeout, None, + 0, timeout, cancellable, _async_result_handler, user_data) class ModemDbusInteraction(log.Origin): @@ -316,6 +325,8 @@ self.sms_received_list = [] self.dbus = ModemDbusInteraction(self.path) self.register_attempts = 0 + # 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), ), @@ -323,6 +334,13 @@ self.dbus.watch_interfaces() def cleanup(self): + self.dbg('cleanup') + if self.cancellable: + self.cancellable.cancel() + # 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() + self.cancellable = None self.dbus.cleanup() self.dbus = None @@ -408,8 +426,9 @@ register_func = self.scan_cb_register_automatic if mcc_mnc is None else self.scan_cb_register result_handler = lambda obj, result, user_data: defer(register_func, result, user_data) error_handler = lambda obj, e, user_data: defer(self.scan_cb_error_handler, e, mcc_mnc) - dbus_async_call(netreg, netreg.Scan, timeout=30, result_handler=result_handler, - error_handler=error_handler, user_data=mcc_mnc) + dbus_async_call(netreg, netreg.Scan, timeout=30, cancellable=self.cancellable, + result_handler=result_handler, error_handler=error_handler, + user_data=mcc_mnc) def scan_cb_error_handler(self, e, mcc_mnc): # It was detected that Scan() method can fail for some modems on some -- To view, visit https://gerrit.osmocom.org/2910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5e9bcac8e4114718243d178ff50d1ed8b30c95d 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 Wed Jun 14 13:31:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 14 Jun 2017 13:31:21 +0000 Subject: [PATCH] osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo Message-ID: Review at https://gerrit.osmocom.org/2916 Copy sysmobts.service to osmo-bts-sysmo This way the name of systemd service file will match the name of the binary similar to lc15. Add aliases so the user can use both old and new names regardless of which file is installed. Once the corresponding changes to OE recipes are applied old file can be removed. Based on work by Pau Espin Pedrol Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 --- M Makefile.am A contrib/osmo-bts-sysmo.service M contrib/sysmobts.service M src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c M src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c 5 files changed, 28 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/16/2916/1 diff --git a/Makefile.am b/Makefile.am index 9a5e26f..5598c4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ # package the contrib and doc EXTRA_DIST = \ - contrib/dump_docs.py contrib/screenrc-l1fwd contrib/sysmobts.service \ + contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \ contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \ contrib/sysmobts.init contrib/sysmobts-calib/Makefile \ contrib/sysmobts-calib/sysmobts-calib.c \ diff --git a/contrib/osmo-bts-sysmo.service b/contrib/osmo-bts-sysmo.service new file mode 100644 index 0000000..bbb2bef --- /dev/null +++ b/contrib/osmo-bts-sysmo.service @@ -0,0 +1,20 @@ +[Unit] +Description=sysmocom sysmoBTS + +[Service] +Type=simple +ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' +ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M +ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' +ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s' +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +# The msg queues must be read fast enough +CPUSchedulingPolicy=rr +CPUSchedulingPriority=1 + +[Install] +WantedBy=multi-user.target +Alias=sysmobts.service diff --git a/contrib/sysmobts.service b/contrib/sysmobts.service index e07a3db..64e0127 100644 --- a/contrib/sysmobts.service +++ b/contrib/sysmobts.service @@ -17,3 +17,4 @@ [Install] WantedBy=multi-user.target +Alias=osmo-bts-sysmo.service diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c index f01fd14..1be56ac 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c @@ -116,7 +116,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl start sysmobts.service"); + system("/bin/systemctl start osmo-bts-sysmo"); } } @@ -157,7 +157,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl stop sysmobts.service"); + system("/bin/systemctl stop osmo-bts-sysmo"); } } diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c index 3020d90..b49f282 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c @@ -284,7 +284,7 @@ DEFUN(cfg_action_bts_srv_on, cfg_action_bts_srv_on_cmd, "bts-service-on", - "Start the systemd sysmobts.service\n") + "Start the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action |= TEMP_ACT_NORM_BTS_SRV_ON; @@ -293,7 +293,7 @@ DEFUN(cfg_no_action_bts_srv_on, cfg_no_action_bts_srv_on_cmd, "no bts-service-on", - NO_STR "Start the systemd sysmobts.service\n") + NO_STR "Start the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action &= ~TEMP_ACT_NORM_BTS_SRV_ON; @@ -338,7 +338,7 @@ DEFUN(cfg_action_bts_srv_off, cfg_action_bts_srv_off_cmd, "bts-service-off", - "Stop the systemd sysmobts.service\n") + "Stop the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action |= TEMP_ACT_BTS_SRV_OFF; @@ -347,7 +347,7 @@ DEFUN(cfg_no_action_bts_srv_off, cfg_no_action_bts_srv_off_cmd, "no bts-service-off", - NO_STR "Stop the systemd sysmobts.service\n") + NO_STR "Stop the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action &= ~TEMP_ACT_BTS_SRV_OFF; -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 14 13:39:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 14 Jun 2017 13:39:20 +0000 Subject: osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Once this is merged, we can proceed with patches from sysmo2osmo branch and then follow up with cleanup patch removing old sysmobts.service -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 14 13:45:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 13:45:30 +0000 Subject: osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 14 14:07:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 14:07:25 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: Update sample test script Message-ID: Review at https://gerrit.osmocom.org/2917 OsmoGsmTester: Update sample test script Copied from newest sms.py test. Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe --- M OsmoGSMTester/chapters/intro.adoc 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/17/2917/1 diff --git a/OsmoGSMTester/chapters/intro.adoc b/OsmoGSMTester/chapters/intro.adoc index 8a09910..50b6dff 100644 --- a/OsmoGSMTester/chapters/intro.adoc +++ b/OsmoGSMTester/chapters/intro.adoc @@ -161,7 +161,6 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * -print('use resources...') nitb = suite.nitb() bts = suite.bts() ms_mo = suite.modem() @@ -170,19 +169,21 @@ print('start nitb and bts...') nitb.bts_add(bts) nitb.start() -sleep(1) -assert nitb.running() bts.start() nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) + +print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) -sms = ms_mo.sms_send(ms_mt.msisdn) -wait(ms_mt.sms_received, sms) +sms = ms_mo.sms_send(ms_mt) +wait(ms_mt.sms_was_received, sms) ---- === Resource Resolution -- To view, visit https://gerrit.osmocom.org/2917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 14:07:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 14:07:26 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: Add missing dependency python-smpplib Message-ID: Review at https://gerrit.osmocom.org/2918 OsmoGsmTester: Add missing dependency python-smpplib Change-Id: I9a6ad33d41c8a90317d079ff0d1f9640c48a2353 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/18/2918/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index 41c85e4..ae8412a 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -25,6 +25,7 @@ ofono \ python3-pip pip3 install pydbus +pip3 install git+git://github.com/podshumok/python-smpplib.git ---- IMPORTANT: ofono may need to be installed from source to contain the most -- To view, visit https://gerrit.osmocom.org/2918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a6ad33d41c8a90317d079ff0d1f9640c48a2353 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 14:07:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 14 Jun 2017 14:07:26 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: install.adoc: Remove trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/2919 OsmoGsmTester: install.adoc: Remove trailing whitespace My editor is removing it automatically. Change-Id: I25c8d179a21c66ab3424204e12215f8e1ddd8e54 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/19/2919/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index ae8412a..b2f0082 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -605,4 +605,3 @@ === osmo-bts-trx TODO: describe B200 family - -- To view, visit https://gerrit.osmocom.org/2919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25c8d179a21c66ab3424204e12215f8e1ddd8e54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:29:03 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:29:03 +0000 Subject: [MERGED] osmo-trx[master]: build: Require and check for gcc C++11 support In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: build: Require and check for gcc C++11 support ...................................................................... build: Require and check for gcc C++11 support It is now 2017. We can and should be able to use C++11 features now. Change-Id: I96477e4125390b17b43a3705bb1daf98fa01c9bb Signed-off-by: Tom Tsou --- A config/ax_cxx_compile_stdcxx.m4 A config/ax_cxx_compile_stdcxx_11.m4 M configure.ac 3 files changed, 1,022 insertions(+), 0 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/config/ax_cxx_compile_stdcxx.m4 b/config/ax_cxx_compile_stdcxx.m4 new file mode 100644 index 0000000..5032bba --- /dev/null +++ b/config/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1,982 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AX_REQUIRE_DEFINED([AC_MSG_WARN]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) + m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus <= 201402L + +#error "This is not a C++17 compiler" + +#else + +#if defined(__clang__) + #define REALLY_CLANG +#else + #if defined(__GNUC__) + #define REALLY_GCC + #endif +#endif + +#include +#include +#include + +namespace cxx17 +{ + +#if !defined(REALLY_CLANG) + namespace test_constexpr_lambdas + { + + // TODO: test it with clang++ from git + + constexpr int foo = [](){return 42;}(); + + } +#endif // !defined(REALLY_CLANG) + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + +#if !defined(REALLY_CLANG) + namespace test_template_argument_deduction_for_class_templates + { + + // TODO: test it with clang++ from git + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } +#endif // !defined(REALLY_CLANG) + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + +#if !defined(REALLY_CLANG) + namespace test_structured_bindings + { + + // TODO: test it with clang++ from git + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } +#endif // !defined(REALLY_CLANG) + +#if !defined(REALLY_CLANG) + namespace test_exception_spec_type_system + { + + // TODO: test it with clang++ from git + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } +#endif // !defined(REALLY_CLANG) + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus <= 201402L + +]]) diff --git a/config/ax_cxx_compile_stdcxx_11.m4 b/config/ax_cxx_compile_stdcxx_11.m4 new file mode 100644 index 0000000..1733fd8 --- /dev/null +++ b/config/ax_cxx_compile_stdcxx_11.m4 @@ -0,0 +1,39 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++11. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/configure.ac b/configure.ac index 8ddd07d..8cfd25d 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,7 @@ AM_PROG_AS AC_PROG_CXX +AX_CXX_COMPILE_STDCXX_11 AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_INSTALL -- To view, visit https://gerrit.osmocom.org/2869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96477e4125390b17b43a3705bb1daf98fa01c9bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:29:42 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:29:42 +0000 Subject: osmo-trx[master]: uhd: Use map container for for device parameter access In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:29:48 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:29:48 +0000 Subject: [MERGED] osmo-trx[master]: uhd: Use map container for for device parameter access In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: uhd: Use map container for for device parameter access ...................................................................... uhd: Use map container for for device parameter access OsmoTRX is written in C++ so we might as well use built-in container types when applicable. Map access allows removal of significant amounts of special device handling code. Aggregate device rates and timing offsets into a single table with access keyed by device/tx-sps/rx-sps tuples. Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 83 insertions(+), 273 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ce6d1be..cea68cc 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -21,6 +21,7 @@ * See the COPYING file in the main directory for details. */ +#include #include "radioDevice.h" #include "Threads.h" #include "Logger.h" @@ -37,12 +38,6 @@ #include #endif -#define B2XX_CLK_RT 26e6 -#define B2XX_MCBTS_CLK_RT 51.2e6 -#define E1XX_CLK_RT 52e6 -#define LIMESDR_CLK_RT (GSMRATE*32) -#define B100_BASE_RT 400000 -#define USRP2_BASE_RT 390625 #define USRP_TX_AMPL 0.3 #define UMTRX_TX_AMPL 0.7 #define LIMESDR_TX_AMPL 0.3 @@ -73,15 +68,6 @@ X3XX, UMTRX, LIMESDR, - NUM_USRP_TYPES, -}; - -struct uhd_dev_offset { - enum uhd_dev_type type; - size_t tx_sps; - size_t rx_sps; - double offset; - const std::string desc; }; /* @@ -109,76 +95,44 @@ * Notes: * USRP1 with timestamps is not supported by UHD. */ -static struct uhd_dev_offset uhd_offsets[] = { - { USRP1, 1, 1, 0.0, "USRP1 not supported" }, - { USRP1, 4, 1, 0.0, "USRP1 not supported"}, - { USRP2, 1, 1, 1.2184e-4, "N2XX 1 SPS" }, - { USRP2, 4, 1, 7.6547e-5, "N2XX 4/1 SPS" }, - { B100, 1, 1, 1.2104e-4, "B100 1 SPS" }, - { B100, 4, 1, 7.9307e-5, "B100 4 SPS" }, - { B200, 1, 1, B2XX_TIMING_1SPS, "B200 1 SPS" }, - { B200, 4, 1, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" }, - { B210, 1, 1, B2XX_TIMING_1SPS, "B210 1 SPS" }, - { B210, 4, 1, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" }, - { B2XX_MCBTS, 4, 4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" }, - { E1XX, 1, 1, 9.5192e-5, "E1XX 1 SPS" }, - { E1XX, 4, 1, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" }, - { E3XX, 1, 1, 1.84616e-4, "E3XX 1 SPS" }, - { E3XX, 4, 1, 1.29231e-4, "E3XX 4/1 Tx/Rx SPS" }, - { X3XX, 1, 1, 1.5360e-4, "X3XX 1 SPS"}, - { X3XX, 4, 1, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS"}, - { UMTRX, 1, 1, 9.9692e-5, "UmTRX 1 SPS" }, - { UMTRX, 4, 1, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS" }, - { USRP2, 4, 4, 4.6080e-5, "N2XX 4 SPS" }, - { B200, 4, 4, B2XX_TIMING_4_4SPS, "B200 4 SPS" }, - { B210, 4, 4, B2XX_TIMING_4_4SPS, "B210 4 SPS" }, - { X3XX, 4, 4, 5.6567e-5, "X3XX 4 SPS"}, - { UMTRX, 4, 4, 5.1503e-5, "UmTRX 4 SPS" }, - { LIMESDR, 4, 4, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" }, + +/* Device Type, Tx-SPS, Rx-SPS */ +typedef std::tuple dev_key; + +/* Device parameter descriptor */ +struct dev_desc { + unsigned channels; + double mcr; + double rate; + double offset; + std::string str; }; -#define NUM_UHD_OFFSETS (sizeof(uhd_offsets)/sizeof(uhd_offsets[0])) -/* - * Select sample rate based on device type and requested samples-per-symbol. - * The base rate is either GSM symbol rate, 270.833 kHz, or the minimum - * usable channel spacing of 400 kHz. - */ -static double select_rate(uhd_dev_type type, int sps, - RadioDevice::InterfaceType iface) -{ - if ((sps != 4) && (sps != 1)) - return -9999.99; - - if (iface == RadioDevice::MULTI_ARFCN) { - switch (type) { - case B2XX_MCBTS: - return 4 * MCBTS_SPACING; - default: - LOG(ALERT) << "Invalid device combination"; - return -9999.99; - } - } - - switch (type) { - case USRP2: - case X3XX: - return USRP2_BASE_RT * sps; - case B100: - return B100_BASE_RT * sps; - case B200: - case B210: - case E1XX: - case E3XX: - case UMTRX: - case LIMESDR: - return GSMRATE * sps; - default: - break; - } - - LOG(ALERT) << "Unknown device type " << type; - return -9999.99; -} +static const std::map dev_param_map { + { std::make_tuple(USRP2, 1, 1), { 1, 0.0, 390625, 1.2184e-4, "N2XX 1 SPS" } }, + { std::make_tuple(USRP2, 4, 1), { 1, 0.0, 390625, 7.6547e-5, "N2XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(USRP2, 4, 4), { 1, 0.0, 390625, 4.6080e-5, "N2XX 4 SPS" } }, + { std::make_tuple(B100, 1, 1), { 1, 0.0, 400000, 1.2104e-4, "B100 1 SPS" } }, + { std::make_tuple(B100, 4, 1), { 1, 0.0, 400000, 7.9307e-5, "B100 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B200, 1, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B200 1 SPS" } }, + { std::make_tuple(B200, 4, 1), { 1, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B200 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B200, 4, 4), { 1, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B200 4 SPS" } }, + { std::make_tuple(B210, 1, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_1SPS, "B210 1 SPS" } }, + { std::make_tuple(B210, 4, 1), { 2, 26e6, GSMRATE, B2XX_TIMING_4SPS, "B210 4/1 Tx/Rx SPS" } }, + { std::make_tuple(B210, 4, 4), { 2, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B210 4 SPS" } }, + { std::make_tuple(E1XX, 1, 1), { 1, 52e6, GSMRATE, 9.5192e-5, "E1XX 1 SPS" } }, + { std::make_tuple(E1XX, 4, 1), { 1, 52e6, GSMRATE, 6.5571e-5, "E1XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(E3XX, 1, 1), { 2, 26e6, GSMRATE, 1.8462e-4, "E3XX 1 SPS" } }, + { std::make_tuple(E3XX, 4, 1), { 2, 26e6, GSMRATE, 1.2923e-4, "E3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 1, 1), { 2, 0.0, 390625, 1.5360e-4, "X3XX 1 SPS" } }, + { std::make_tuple(X3XX, 4, 1), { 2, 0.0, 390625, 1.1264e-4, "X3XX 4/1 Tx/Rx SPS" } }, + { std::make_tuple(X3XX, 4, 4), { 2, 0.0, 390625, 5.6567e-5, "X3XX 4 SPS" } }, + { std::make_tuple(UMTRX, 1, 1), { 2, 0.0, GSMRATE, 9.9692e-5, "UmTRX 1 SPS" } }, + { std::make_tuple(UMTRX, 4, 1), { 2, 0.0, GSMRATE, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS"} }, + { std::make_tuple(UMTRX, 4, 4), { 2, 0.0, GSMRATE, 5.1503e-5, "UmTRX 4 SPS" } }, + { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" } }, + { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, +}; /* Sample Buffer - Allows reading and writing of timed samples using osmo-trx @@ -339,9 +293,7 @@ std::vector rx_buffers; void init_gains(); - double get_dev_offset(); - int set_master_clk(double rate); - int set_rates(double tx_rate, double rx_rate); + void set_rates(); bool parse_dev_type(); bool flush_recv(size_t num_pkts); int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls); @@ -470,105 +422,22 @@ } -double uhd_device::get_dev_offset() +void uhd_device::set_rates() { - struct uhd_dev_offset *offset = NULL; + dev_desc desc = dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)); + if (desc.mcr != 0.0) + usrp_dev->set_master_clock_rate(desc.mcr); - /* Reject USRP1 */ - if (dev_type == USRP1) { - LOG(ERR) << "Invalid device type"; - return 0.0; - } + tx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * tx_sps : desc.rate; + rx_rate = (dev_type != B2XX_MCBTS) ? desc.rate * rx_sps : desc.rate; - /* Search for matching offset value */ - for (size_t i = 0; i < NUM_UHD_OFFSETS; i++) { - if ((dev_type == uhd_offsets[i].type) && - (tx_sps == uhd_offsets[i].tx_sps) && - (rx_sps == uhd_offsets[i].rx_sps)) { - offset = &uhd_offsets[i]; - break; - } - } + usrp_dev->set_tx_rate(tx_rate); + usrp_dev->set_rx_rate(rx_rate); + tx_rate = usrp_dev->get_tx_rate(); + rx_rate = usrp_dev->get_rx_rate(); - if (!offset) { - LOG(ERR) << "Invalid device configuration"; - return 0.0; - } - - std::cout << "-- Setting " << offset->desc << std::endl; - - return offset->offset; -} - -int uhd_device::set_master_clk(double clk_rate) -{ - double actual, offset, limit = 1.0; - - try { - usrp_dev->set_master_clock_rate(clk_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD clock rate setting failed: " << clk_rate; - LOG(ALERT) << ex.what(); - return -1; - } - - actual = usrp_dev->get_master_clock_rate(); - offset = fabs(clk_rate - actual); - - if (offset > limit) { - LOG(ALERT) << "Failed to set master clock rate"; - LOG(ALERT) << "Requested clock rate " << clk_rate; - LOG(ALERT) << "Actual clock rate " << actual; - return -1; - } - - return 0; -} - -int uhd_device::set_rates(double tx_rate, double rx_rate) -{ - double offset_limit = 1.0; - double tx_offset, rx_offset; - - /* B2XX and E1xx are the only device where we set FPGA clocking */ - if ((dev_type == B200) || (dev_type == B210) || (dev_type == E3XX)) { - if (set_master_clk(B2XX_CLK_RT) < 0) - return -1; - } else if (dev_type == E1XX) { - if (set_master_clk(E1XX_CLK_RT) < 0) - return -1; - } else if (dev_type == B2XX_MCBTS) { - if (set_master_clk(B2XX_MCBTS_CLK_RT) < 0) - return -1; - } - else if (dev_type == LIMESDR) { - if (set_master_clk(LIMESDR_CLK_RT) < 0) - return -1; - } - - - // Set sample rates - try { - usrp_dev->set_tx_rate(tx_rate); - usrp_dev->set_rx_rate(rx_rate); - } catch (const std::exception &ex) { - LOG(ALERT) << "UHD rate setting failed"; - LOG(ALERT) << ex.what(); - return -1; - } - this->tx_rate = usrp_dev->get_tx_rate(); - this->rx_rate = usrp_dev->get_rx_rate(); - - tx_offset = fabs(this->tx_rate - tx_rate); - rx_offset = fabs(this->rx_rate - rx_rate); - if ((tx_offset > offset_limit) || (rx_offset > offset_limit)) { - LOG(ALERT) << "Actual sample rate differs from desired rate"; - LOG(ALERT) << "Tx/Rx (" << this->tx_rate << "/" - << this->rx_rate << ")"; - return -1; - } - - return 0; + ts_offset = (TIMESTAMP) desc.offset * rx_rate; + LOG(INFO) << "Rates configured for " << desc.str; } double uhd_device::setTxGain(double db, size_t chan) @@ -641,85 +510,39 @@ */ bool uhd_device::parse_dev_type() { - std::string mboard_str, dev_str; - uhd::property_tree::sptr prop_tree; - size_t usrp1_str, usrp2_str, e100_str, e110_str, e310_str, e3xx_str, - b100_str, b200_str, b210_str, x300_str, x310_str, umtrx_str, limesdr_str; + uhd::property_tree::sptr prop_tree = usrp_dev->get_device()->get_tree(); + std::string devString = prop_tree->access("/name").get(); + std::string mboardString = usrp_dev->get_mboard_name(); - prop_tree = usrp_dev->get_device()->get_tree(); - dev_str = prop_tree->access("/name").get(); - mboard_str = usrp_dev->get_mboard_name(); + const std::map> devStringMap { + { "B100", { B100, TX_WINDOW_USRP1 } }, + { "B200", { B200, TX_WINDOW_USRP1 } }, + { "B200mini", { B200, TX_WINDOW_USRP1 } }, + { "B210", { B210, TX_WINDOW_USRP1 } }, + { "E100", { E1XX, TX_WINDOW_FIXED } }, + { "E110", { E1XX, TX_WINDOW_FIXED } }, + { "E310", { E3XX, TX_WINDOW_FIXED } }, + { "E3XX", { E3XX, TX_WINDOW_FIXED } }, + { "X300", { X3XX, TX_WINDOW_FIXED } }, + { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, + { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, + }; - usrp1_str = dev_str.find("USRP1"); - usrp2_str = dev_str.find("USRP2"); - b100_str = mboard_str.find("B100"); - b200_str = mboard_str.find("B200"); - b210_str = mboard_str.find("B210"); - e100_str = mboard_str.find("E100"); - e110_str = mboard_str.find("E110"); - e310_str = mboard_str.find("E310"); - e3xx_str = mboard_str.find("E3XX"); - x300_str = mboard_str.find("X300"); - x310_str = mboard_str.find("X310"); - umtrx_str = dev_str.find("UmTRX"); - // LimeSDR is based on STREAM board, so it's advertized as such - limesdr_str = dev_str.find("STREAM"); + // Compare UHD motherboard and device strings */ + std::string found; + if (devStringMap.find(devString) != devStringMap.end()) + found = devString; + else if (devStringMap.find(mboardString) != devStringMap.end()) + found = mboardString; - if (usrp1_str != std::string::npos) { - LOG(ALERT) << "USRP1 is not supported using the UHD driver"; - LOG(ALERT) << "Please compile with GNU Radio libusrp support"; - dev_type = USRP1; + if (found.empty()) { + LOG(ALERT) << "Unsupported device " << devString; return false; } - if (b100_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B100; - } else if (b200_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B200; - } else if (b210_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = B210; - } else if (e100_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (e110_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = E1XX; - } else if (usrp2_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = USRP2; - } else if ((e310_str != std::string::npos) || - (e3xx_str != std::string::npos)) { - tx_window = TX_WINDOW_FIXED; - dev_type = E3XX; - } else if (x300_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (x310_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = X3XX; - } else if (umtrx_str != std::string::npos) { - tx_window = TX_WINDOW_FIXED; - dev_type = UMTRX; - } else if (limesdr_str != std::string::npos) { - tx_window = TX_WINDOW_USRP1; - dev_type = LIMESDR; - } else { - LOG(ALERT) << "Unknown UHD device type " - << dev_str << " " << mboard_str; - return false; - } - - if (tx_window == TX_WINDOW_USRP1) { - LOG(INFO) << "Using USRP1 type transmit window for " - << dev_str << " " << mboard_str; - } else { - LOG(INFO) << "Using fixed transmit window for " - << dev_str << " " << mboard_str; - } - + dev_type = devStringMap.at(found).first; + tx_window = devStringMap.at(found).second; return true; } @@ -820,14 +643,12 @@ usrp_dev->set_clock_source(refstr); - // Set rates - double _rx_rate = select_rate(dev_type, rx_sps, iface); - double _tx_rate = select_rate(dev_type, tx_sps, iface); - - if ((_tx_rate < 0.0) || (_rx_rate < 0.0)) + try { + set_rates(); + } catch (const std::exception &e) { + LOG(ALERT) << "UHD rate setting failed - " << e.what(); return -1; - if (set_rates(_tx_rate, _rx_rate) < 0) - return -1; + } // Set RF frontend bandwidth if (dev_type == UMTRX) { @@ -859,17 +680,6 @@ size_t buf_len = SAMPLE_BUF_SZ / sizeof(uint32_t); for (size_t i = 0; i < rx_buffers.size(); i++) rx_buffers[i] = new smpl_buf(buf_len, rx_rate); - - // Set receive chain sample offset. Trigger the EDGE offset - // table by checking for 4 SPS on the receive path. No other - // configuration supports using 4 SPS. - double offset = get_dev_offset(); - if (offset == 0.0) { - LOG(ERR) << "Unsupported configuration, no correction applied"; - ts_offset = 0; - } else { - ts_offset = (TIMESTAMP) (offset * rx_rate); - } // Initialize and shadow gain values init_gains(); @@ -1236,7 +1046,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > B2XX_CLK_RT) { + if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/2871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8660f75a2b2a13488b913c07637bdd0f5f0f4cf9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:30:24 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:30:24 +0000 Subject: osmo-trx[master]: sigProcLib: Remove unused functions from public interface In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:30:28 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:30:28 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Remove unused functions from public interface In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Remove unused functions from public interface ...................................................................... sigProcLib: Remove unused functions from public interface Also remove entirely completely unused calls. Most of these calls have been around since OpenBTS conception. Nearly a decade is long enough time for deprecation. Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0 --- M Transceiver52M/sigProcLib.cpp M Transceiver52M/sigProcLib.h 2 files changed, 52 insertions(+), 467 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Tom Tsou: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 9a8c824..3a9a529 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -46,9 +46,9 @@ #define CLIP_THRESH 30000.0f /** Lookup tables for trigonometric approximation */ -float cosTable[TABLESIZE+1]; // add 1 element for wrap around -float sinTable[TABLESIZE+1]; -float sincTable[TABLESIZE+1]; +static float cosTable[TABLESIZE+1]; // add 1 element for wrap around +static float sinTable[TABLESIZE+1]; +static float sincTable[TABLESIZE+1]; /** Constants */ static const float M_PI_F = (float)M_PI; @@ -64,7 +64,7 @@ /* Precomputed fractional delay filters */ static signalVector *delayFilters[DELAYFILTS]; -static Complex psk8_table[8] = { +static const Complex psk8_table[8] = { Complex(-0.70710678, 0.70710678), Complex( 0.0, -1.0), Complex( 0.0, 1.0), @@ -172,67 +172,7 @@ GSMPulse4 = NULL; } -// dB relative to 1.0. -// if > 1.0, then return 0 dB -float dB(float x) { - - float arg = 1.0F; - float dB = 0.0F; - - if (x >= 1.0F) return 0.0F; - if (x <= 0.0F) return -200.0F; - - float prevArg = arg; - float prevdB = dB; - float stepSize = 16.0F; - float dBstepSize = 12.0F; - while (stepSize > 1.0F) { - do { - prevArg = arg; - prevdB = dB; - arg /= stepSize; - dB -= dBstepSize; - } while (arg > x); - arg = prevArg; - dB = prevdB; - stepSize *= 0.5F; - dBstepSize -= 3.0F; - } - return ((arg-x)*(dB-3.0F) + (x-arg*0.5F)*dB)/(arg - arg*0.5F); - -} - -// 10^(-dB/10), inverse of dB func. -float dBinv(float x) { - - float arg = 1.0F; - float dB = 0.0F; - - if (x >= 0.0F) return 1.0F; - if (x <= -200.0F) return 0.0F; - - float prevArg = arg; - float prevdB = dB; - float stepSize = 16.0F; - float dBstepSize = 12.0F; - while (stepSize > 1.0F) { - do { - prevArg = arg; - prevdB = dB; - arg /= stepSize; - dB -= dBstepSize; - } while (dB > x); - arg = prevArg; - dB = prevdB; - stepSize *= 0.5F; - dBstepSize -= 3.0F; - } - - return ((dB-x)*(arg*0.5F)+(x-(dB-3.0F))*(arg))/3.0F; - -} - -float vectorNorm2(const signalVector &x) +static float vectorNorm2(const signalVector &x) { signalVector::const_iterator xPtr = x.begin(); float Energy = 0.0; @@ -241,41 +181,6 @@ } return Energy; } - - -float vectorPower(const signalVector &x) -{ - return vectorNorm2(x)/x.size(); -} - -/** compute cosine via lookup table */ -float cosLookup(const float x) -{ - float arg = x*M_1_2PI_F; - while (arg > 1.0F) arg -= 1.0F; - while (arg < 0.0F) arg += 1.0F; - - const float argT = arg*((float)TABLESIZE); - const int argI = (int)argT; - const float delta = argT-argI; - const float iDelta = 1.0F-delta; - return iDelta*cosTable[argI] + delta*cosTable[argI+1]; -} - -/** compute sine via lookup table */ -float sinLookup(const float x) -{ - float arg = x*M_1_2PI_F; - while (arg > 1.0F) arg -= 1.0F; - while (arg < 0.0F) arg += 1.0F; - - const float argT = arg*((float)TABLESIZE); - const int argI = (int)argT; - const float delta = argT-argI; - const float iDelta = 1.0F-delta; - return iDelta*sinTable[argI] + delta*sinTable[argI+1]; -} - /** compute e^(-jx) via lookup table. */ static complex expjLookup(float x) @@ -401,11 +306,18 @@ return true; } -signalVector *convolve(const signalVector *x, - const signalVector *h, - signalVector *y, - ConvType spanType, size_t start, - size_t len, size_t step, int offset) +/** Convolution type indicator */ +enum ConvType { + START_ONLY, + NO_DELAY, + CUSTOM, + UNDEFINED, +}; + +static signalVector *convolve(const signalVector *x, const signalVector *h, + signalVector *y, ConvType spanType, + size_t start = 0, size_t len = 0, + size_t step = 1, int offset = 0) { int rc; size_t head = 0, tail = 0; @@ -652,29 +564,6 @@ generateInvertC0Pulse(pulse); return pulse; -} - -signalVector* reverseConjugate(signalVector *b) -{ - signalVector *tmp = new signalVector(b->size()); - tmp->isReal(b->isReal()); - signalVector::iterator bP = b->begin(); - signalVector::iterator bPEnd = b->end(); - signalVector::iterator tmpP = tmp->end()-1; - if (!b->isReal()) { - while (bP < bPEnd) { - *tmpP-- = bP->conj(); - bP++; - } - } - else { - while (bP < bPEnd) { - *tmpP-- = bP->real(); - bP++; - } - } - - return tmp; } bool vectorSlicer(SoftVector *x) @@ -1158,7 +1047,7 @@ } } -float sinc(float x) +static float sinc(float x) { if (fabs(x) >= 8 * M_PI) return 0.0; @@ -1173,7 +1062,7 @@ * sinc function generator. The number of filters generated is specified * by the DELAYFILTS value. */ -void generateDelayFilters() +static void generateDelayFilters() { int h_len = 20; complex *data; @@ -1268,31 +1157,8 @@ return out; } -signalVector *gaussianNoise(int length, - float variance, - complex mean) +static complex interpolatePoint(const signalVector &inSig, float ix) { - - signalVector *noise = new signalVector(length); - signalVector::iterator nPtr = noise->begin(); - float stddev = sqrtf(variance); - while (nPtr < noise->end()) { - float u1 = (float) rand()/ (float) RAND_MAX; - while (u1==0.0) - u1 = (float) rand()/ (float) RAND_MAX; - float u2 = (float) rand()/ (float) RAND_MAX; - float arg = 2.0*M_PI*u2; - *nPtr = mean + stddev*complex(cos(arg),sin(arg))*sqrtf(-2.0*log(u1)); - nPtr++; - } - - return noise; -} - -complex interpolatePoint(const signalVector &inSig, - float ix) -{ - int start = (int) (floor(ix) - 10); if (start < 0) start = 0; int end = (int) (floor(ix) + 11); @@ -1332,12 +1198,9 @@ return amp; } -complex peakDetect(const signalVector &rxBurst, - float *peakIndex, - float *avgPwr) +static complex peakDetect(const signalVector &rxBurst, + float *peakIndex, float *avgPwr) { - - complex maxVal = 0.0; float maxIndex = -1; float sumPower = 0.0; @@ -1410,7 +1273,7 @@ } /** in-place conjugation */ -void conjugateVector(signalVector &x) +static void conjugateVector(signalVector &x) { if (x.isReal()) return; signalVector::iterator xP = x.begin(); @@ -1419,37 +1282,6 @@ *xP = xP->conj(); xP++; } -} - - -// in-place addition!! -bool addVector(signalVector &x, - signalVector &y) -{ - signalVector::iterator xP = x.begin(); - signalVector::iterator yP = y.begin(); - signalVector::iterator xPEnd = x.end(); - signalVector::iterator yPEnd = y.end(); - while ((xP < xPEnd) && (yP < yPEnd)) { - *xP = *xP + *yP; - xP++; yP++; - } - return true; -} - -// in-place multiplication!! -bool multVector(signalVector &x, - signalVector &y) -{ - signalVector::iterator xP = x.begin(); - signalVector::iterator yP = y.begin(); - signalVector::iterator xPEnd = x.end(); - signalVector::iterator yPEnd = y.end(); - while ((xP < xPEnd) && (yP < yPEnd)) { - *xP = (*xP) * (*yP); - xP++; yP++; - } - return true; } static bool generateMidamble(int sps, int tsc) @@ -1528,7 +1360,7 @@ return status; } -CorrelationSequence *generateEdgeMidamble(int tsc) +static CorrelationSequence *generateEdgeMidamble(int tsc) { complex *data = NULL; signalVector *midamble = NULL, *_midamble = NULL; @@ -1682,6 +1514,24 @@ return energy/windowLength; } +static signalVector *downsampleBurst(const signalVector &burst) +{ + signalVector *in, *out; + + in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); + out = new signalVector(DOWNSAMPLE_OUT_LEN); + memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); + + if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, + (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { + delete out; + out = NULL; + } + + delete in; + return out; +}; + /* * Detect a burst based on correlation and peak-to-average ratio * @@ -1816,12 +1666,8 @@ * head: Search 8 symbols before target * tail: Search 8 symbols + maximum expected delay */ -int detectRACHBurst(const signalVector &burst, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa) +static int detectRACHBurst(const signalVector &burst, float threshold, int sps, + complex &litude, float &toa, unsigned max_toa) { int rc, target, head, tail; CorrelationSequence *sync; @@ -1845,8 +1691,8 @@ * head: Search 6 symbols before target * tail: Search 6 symbols + maximum expected delay */ -int analyzeTrafficBurst(const signalVector &burst, unsigned tsc, float threshold, - int sps, complex &litude, float &toa, unsigned max_toa) +static int analyzeTrafficBurst(const signalVector &burst, unsigned tsc, float threshold, + int sps, complex &litude, float &toa, unsigned max_toa) { int rc, target, head, tail; CorrelationSequence *sync; @@ -1864,8 +1710,8 @@ return rc; } -int detectEdgeBurst(const signalVector &burst, unsigned tsc, float threshold, - int sps, complex &litude, float &toa, unsigned max_toa) +static int detectEdgeBurst(const signalVector &burst, unsigned tsc, float threshold, + int sps, complex &litude, float &toa, unsigned max_toa) { int rc, target, head, tail; CorrelationSequence *sync; @@ -1913,41 +1759,6 @@ return type; return rc; -} - -signalVector *downsampleBurst(const signalVector &burst) -{ - signalVector *in, *out; - - in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); - out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - - if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, - (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { - delete out; - out = NULL; - } - - delete in; - return out; -}; - -signalVector *decimateVector(signalVector &wVector, size_t factor) -{ - signalVector *dec; - - if (factor <= 1) - return NULL; - - dec = new signalVector(wVector.size() / factor); - dec->isReal(wVector.isReal()); - - signalVector::iterator itr = dec->begin(); - for (size_t i = 0; i < wVector.size(); i += factor) - *itr++ = wVector[i]; - - return dec; } /* @@ -2046,8 +1857,8 @@ * 4 SPS (if activated) to minimize distortion through the fractional * delay filters. Symbol rotation and after always operates at 1 SPS. */ -SoftVector *demodGmskBurst(const signalVector &rxBurst, int sps, - complex channel, float TOA) +static SoftVector *demodGmskBurst(const signalVector &rxBurst, + int sps, complex channel, float TOA) { SoftVector *bits; signalVector *dec; @@ -2075,8 +1886,8 @@ * through the fractional delay filters at 1 SPS renders signal * nearly unrecoverable. */ -SoftVector *demodEdgeBurst(const signalVector &burst, int sps, - complex chan, float toa) +static SoftVector *demodEdgeBurst(const signalVector &burst, + int sps, complex chan, float toa) { SoftVector *bits; signalVector *dec, *rot, *eq; @@ -2136,27 +1947,4 @@ fail: sigProcLibDestroy(); return false; -} - -std::string corrTypeToString(CorrType corr) { - switch (corr) { - case OFF: - return "OFF"; - case TSC: - return "TSC"; - case RACH: - return "RACH"; - case EDGE: - return "EDGE"; - case IDLE: - return "IDLE"; - default: - return "unknown"; - } -} - -std::ostream& operator<<(std::ostream& os, CorrType corr) -{ - os << corrTypeToString(corr); - return os; } diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h index 4318fe0..9bc7e10 100644 --- a/Transceiver52M/sigProcLib.h +++ b/Transceiver52M/sigProcLib.h @@ -25,14 +25,6 @@ #define EDGE_BURST_NBITS 444 #define EDGE_BURST_NSYMS (EDGE_BURST_NBITS / 3) -/** Convolution type indicator */ -enum ConvType { - START_ONLY, - NO_DELAY, - CUSTOM, - UNDEFINED, -}; - /** Codes for burst types of received bursts*/ enum CorrType{ OFF, ///< timeslot is off @@ -41,8 +33,6 @@ EDGE, ///< timeslot should contain an EDGE burst IDLE ///< timeslot is an idle (or dummy) burst }; -std::string corrTypeToString(CorrType corr); -std::ostream& operator<<(std::ostream& os, CorrType corr); enum SignalError { SIGERR_NONE, @@ -61,65 +51,11 @@ */ #define BURST_THRESH 4.0 -/** Convert a linear number to a dB value */ -float dB(float x); - -/** Convert a dB value into a linear value */ -float dBinv(float x); - -/** Compute the energy of a vector */ -float vectorNorm2(const signalVector &x); - -/** Compute the average power of a vector */ -float vectorPower(const signalVector &x); - /** Setup the signal processing library */ bool sigProcLibSetup(); /** Destroy the signal processing library */ void sigProcLibDestroy(void); - -/** - Convolve two vectors. - @param a,b The vectors to be convolved. - @param c, A preallocated vector to hold the convolution result. - @param spanType The type/span of the convolution. - @return The convolution result or NULL on error. -*/ -signalVector *convolve(const signalVector *a, const signalVector *b, - signalVector *c, ConvType spanType, - size_t start = 0, size_t len = 0, - size_t step = 1, int offset = 0); - -/** - Frequency shift a vector. - @param y The frequency shifted vector. - @param x The vector to-be-shifted. - @param freq The digital frequency shift - @param startPhase The starting phase of the oscillator - @param finalPhase The final phase of the oscillator - @return The frequency shifted vector. -*/ -signalVector* frequencyShift(signalVector *y, - signalVector *x, - float freq = 0.0, - float startPhase = 0.0, - float *finalPhase=NULL); - -/** - Correlate two vectors. - @param a,b The vectors to be correlated. - @param c, A preallocated vector to hold the correlation result. - @param spanType The type/span of the correlation. - @return The correlation result. -*/ -signalVector* correlate(signalVector *a, - signalVector *b, - signalVector *c, - ConvType spanType, - bool bReversedConjugated = false, - unsigned startIx = 0, - unsigned len = 0); /** Operate soft slicer on a soft-bit vector */ bool vectorSlicer(SoftVector *x); @@ -148,45 +84,6 @@ /** Generate a dummy GSM burst - 4 or 1 SPS */ signalVector *generateDummyBurst(int sps, int tn); -/** Sinc function */ -float sinc(float x); - -/** Delay a vector */ -signalVector *delayVector(const signalVector *in, signalVector *out, float delay); - -/** Add two vectors in-place */ -bool addVector(signalVector &x, - signalVector &y); - -/** Multiply two vectors in-place*/ -bool multVector(signalVector &x, - signalVector &y); - -/** Generate a vector of gaussian noise */ -signalVector *gaussianNoise(int length, - float variance = 1.0, - complex mean = complex(0.0)); - -/** - Given a non-integer index, interpolate a sample. - @param inSig The signal from which to interpolate. - @param ix The index. - @return The interpolated signal value. -*/ -complex interpolatePoint(const signalVector &inSig, - float ix); - -/** - Given a correlator output, locate the correlation peak. - @param rxBurst The correlator result. - @param peakIndex Pointer to value to receive interpolated peak index. - @param avgPower Power to value to receive mean power. - @return Peak value. -*/ -complex peakDetect(const signalVector &rxBurst, - float *peakIndex, - float *avgPwr); - /** Apply a scalar to a vector. @param x The vector of interest. @@ -203,68 +100,6 @@ */ float energyDetect(const signalVector &rxBurst, unsigned windowLength); - -/** - RACH aka Access Burst correlator/detector. - @param burst The received GSM burst of interest. - @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity. - @param sps The number of samples per GSM symbol. - @param amplitude The estimated amplitude of received RACH burst. - @param toa The estimate time-of-arrival of received RACH burst. - @param max_toa The maximum expected time-of-arrival - @return 1 if threshold value is reached, - negative value (-SignalError) on error, - zero (SIGERR_NONE) if no burst is detected -*/ -int detectRACHBurst(const signalVector &burst, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa); - -/** - GMSK Normal Burst correlator/detector. - @param rxBurst The received GSM burst of interest. - @param tsc Midamble type (0..7) also known as TSC - @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity. - @param sps The number of samples per GSM symbol. - @param amplitude The estimated amplitude of received TSC burst. - @param toa The estimate time-of-arrival of received TSC burst. - @param max_toa The maximum expected time-of-arrival - @return 1 if threshold value is reached, - negative value (-SignalError) on error, - zero (SIGERR_NONE) if no burst is detected -*/ -int analyzeTrafficBurst(const signalVector &burst, - unsigned tsc, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa); - -/** - EDGE/8-PSK Normal Burst correlator/detector - @param burst The received GSM burst of interest - @param tsc Midamble type (0..7) also known as TSC - @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity. - @param sps The number of samples per GSM symbol. - @param amplitude The estimated amplitude of received TSC burst. - @param toa The estimate time-of-arrival of received TSC burst. - @param max_toa The maximum expected time-of-arrival - @return 1 if threshold value is reached, - negative value (-SignalError) on error, - zero (SIGERR_NONE) if no burst is detected -*/ -int detectEdgeBurst(const signalVector &burst, - unsigned tsc, - float threshold, - int sps, - complex &litude, - float &toa, - unsigned max_toa); - /** 8-PSK/GMSK/RACH burst detector @param burst The received GSM burst of interest @@ -286,44 +121,6 @@ complex &, float &toa, unsigned max_toa); - -/** - Downsample 4 SPS to 1 SPS using a polyphase filterbank - @param burst Input burst of at least 624 symbols - @return Decimated signal vector of 156 symbols -*/ -signalVector *downsampleBurst(const signalVector &burst); - -/** - Decimate a vector. - @param wVector The vector of interest. - @param factor Decimation factor. - @return The decimated signal vector. -*/ -signalVector *decimateVector(signalVector &wVector, size_t factor); - -/** - Demodulates a GMSK burst using a soft-slicer. - @param rxBurst The burst to be demodulated. - @param gsmPulse The GSM pulse. - @param sps The number of samples per GSM symbol. - @param channel The amplitude estimate of the received burst. - @param TOA The time-of-arrival of the received burst. - @return The demodulated bit sequence. -*/ -SoftVector *demodGmskBurst(const signalVector &rxBurst, int sps, - complex channel, float TOA); - -/** - Demodulate 8-PSK EDGE burst with soft symbol ooutput - @param rxBurst The burst to be demodulated. - @param sps The number of samples per GSM symbol. - @param channel The amplitude estimate of the received burst. - @param TOA The time-of-arrival of the received burst. - @return The demodulated bit sequence. -*/ -SoftVector *demodEdgeBurst(const signalVector &rxBurst, int sps, - complex channel, float TOA); /** Demodulate burst basde on type and output soft bits */ SoftVector *demodAnyBurst(const signalVector &burst, int sps, -- To view, visit https://gerrit.osmocom.org/2898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifc122aaff23414c363b4b00f99061eed8a6902d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:35:39 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:35:39 +0000 Subject: osmo-trx[master]: uhd: Add non-UmTRX channel swap support In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 14 16:35:41 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 16:35:41 +0000 Subject: [MERGED] osmo-trx[master]: uhd: Add non-UmTRX channel swap support In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: uhd: Add non-UmTRX channel swap support ...................................................................... uhd: Add non-UmTRX channel swap support Previously an UmTRX-only feature. Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 44 insertions(+), 21 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index cea68cc..ecf2c34 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -293,6 +293,7 @@ std::vector rx_buffers; void init_gains(); + void set_channels(bool swap); void set_rates(); bool parse_dev_type(); bool flush_recv(size_t num_pkts); @@ -566,6 +567,45 @@ return true; } +void uhd_device::set_channels(bool swap) +{ + if (iface == MULTI_ARFCN) { + if (dev_type != B200 && dev_type != B210) + throw std::invalid_argument("Device does not support MCBTS"); + dev_type = B2XX_MCBTS; + chans = 1; + } + + if (chans > dev_param_map.at(dev_key(dev_type, 1, 1)).channels) + throw std::invalid_argument("Device does not support number of requested channels"); + + std::string subdev_string; + switch (dev_type) { + case B210: + case E3XX: + if (chans == 1) + subdev_string = swap ? "A:B" : "A:A"; + else if (chans == 2) + subdev_string = swap ? "A:B A:A" : "A:A A:B"; + break; + case X3XX: + case UMTRX: + if (chans == 1) + subdev_string = swap ? "B:0" : "A:0"; + else if (chans == 2) + subdev_string = swap ? "B:0 A:0" : "A:0 B:0"; + break; + default: + break; + } + + if (!subdev_string.empty()) { + uhd::usrp::subdev_spec_t spec(subdev_string); + usrp_dev->set_tx_subdev_spec(spec); + usrp_dev->set_rx_subdev_spec(spec); + } +} + int uhd_device::open(const std::string &args, int ref, bool swap_channels) { const char *refstr; @@ -596,27 +636,10 @@ return -1; } - // Verify and set channels - if (iface == MULTI_ARFCN) { - if ((dev_type != B200) && (dev_type != B210)) { - LOG(ALERT) << "Unsupported device configuration"; - return -1; - } - - dev_type = B2XX_MCBTS; - chans = 1; - } else if (chans == 2) { - if (dev_type == B210) { - } else if (dev_type == UMTRX) { - uhd::usrp::subdev_spec_t subdev_spec(swap_channels?"B:0 A:0":"A:0 B:0"); - usrp_dev->set_tx_subdev_spec(subdev_spec); - usrp_dev->set_rx_subdev_spec(subdev_spec); - } else { - LOG(ALERT) << "Invalid device configuration"; - return -1; - } - } else if (chans != 1) { - LOG(ALERT) << "Invalid channel combination for device"; + try { + set_channels(swap_channels); + } catch (const std::exception &e) { + LOG(ALERT) << "Channel setting failed - " << e.what(); return -1; } -- To view, visit https://gerrit.osmocom.org/2872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a0e0c1d69e89993158e948535ad33f54e568d2d Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jun 14 22:36:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:36:11 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: Add missing dependency python-smpplib In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9a6ad33d41c8a90317d079ff0d1f9640c48a2353 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Wed Jun 14 22:37:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:37:15 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: Update sample test script In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2917 to look at the new patch set (#2). OsmoGsmTester: Update sample test script Copied from newest mo_mt_sms.py test. Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe --- M OsmoGSMTester/chapters/intro.adoc 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/17/2917/2 diff --git a/OsmoGSMTester/chapters/intro.adoc b/OsmoGSMTester/chapters/intro.adoc index 8a09910..50b6dff 100644 --- a/OsmoGSMTester/chapters/intro.adoc +++ b/OsmoGSMTester/chapters/intro.adoc @@ -161,7 +161,6 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * -print('use resources...') nitb = suite.nitb() bts = suite.bts() ms_mo = suite.modem() @@ -170,19 +169,21 @@ print('start nitb and bts...') nitb.bts_add(bts) nitb.start() -sleep(1) -assert nitb.running() bts.start() nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) + +print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) -sms = ms_mo.sms_send(ms_mt.msisdn) -wait(ms_mt.sms_received, sms) +sms = ms_mo.sms_send(ms_mt) +wait(ms_mt.sms_was_received, sms) ---- === Resource Resolution -- To view, visit https://gerrit.osmocom.org/2917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 22:37:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:37:17 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: Update sample test script In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals 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 Wed Jun 14 22:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:37:37 +0000 Subject: osmo-gsm-manuals[master]: OsmoGsmTester: install.adoc: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25c8d179a21c66ab3424204e12215f8e1ddd8e54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals 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 Wed Jun 14 22:37:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:37:55 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGsmTester: Update sample test script In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGsmTester: Update sample test script ...................................................................... OsmoGsmTester: Update sample test script Copied from newest mo_mt_sms.py test. Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe --- M OsmoGSMTester/chapters/intro.adoc 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGSMTester/chapters/intro.adoc b/OsmoGSMTester/chapters/intro.adoc index 8a09910..50b6dff 100644 --- a/OsmoGSMTester/chapters/intro.adoc +++ b/OsmoGSMTester/chapters/intro.adoc @@ -161,7 +161,6 @@ #!/usr/bin/env python3 from osmo_gsm_tester.test import * -print('use resources...') nitb = suite.nitb() bts = suite.bts() ms_mo = suite.modem() @@ -170,19 +169,21 @@ print('start nitb and bts...') nitb.bts_add(bts) nitb.start() -sleep(1) -assert nitb.running() bts.start() nitb.subscriber_add(ms_mo) nitb.subscriber_add(ms_mt) -ms_mo.connect(nitb) -ms_mt.connect(nitb) +ms_mo.connect(nitb.mcc_mnc()) +ms_mt.connect(nitb.mcc_mnc()) + +print('waiting for modems to attach...') +wait(ms_mo.is_connected, nitb.mcc_mnc()) +wait(ms_mt.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms_mo, ms_mt) -sms = ms_mo.sms_send(ms_mt.msisdn) -wait(ms_mt.sms_received, sms) +sms = ms_mo.sms_send(ms_mt) +wait(ms_mt.sms_was_received, sms) ---- === Resource Resolution -- To view, visit https://gerrit.osmocom.org/2917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49644f6f8223d45bccbcbb3aa8325c20c06dcdbe Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 22:38:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:38:23 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGsmTester: install.adoc: Remove trailing whitespace In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGsmTester: install.adoc: Remove trailing whitespace ...................................................................... OsmoGsmTester: install.adoc: Remove trailing whitespace My editor is removing it automatically. Change-Id: I25c8d179a21c66ab3424204e12215f8e1ddd8e54 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index ae8412a..b2f0082 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -605,4 +605,3 @@ === osmo-bts-trx TODO: describe B200 family - -- To view, visit https://gerrit.osmocom.org/2919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I25c8d179a21c66ab3424204e12215f8e1ddd8e54 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 22:38:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:38:23 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGsmTester: Add missing dependency python-smpplib In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGsmTester: Add missing dependency python-smpplib ...................................................................... OsmoGsmTester: Add missing dependency python-smpplib Change-Id: I9a6ad33d41c8a90317d079ff0d1f9640c48a2353 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 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 41c85e4..ae8412a 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -25,6 +25,7 @@ ofono \ python3-pip pip3 install pydbus +pip3 install git+git://github.com/podshumok/python-smpplib.git ---- IMPORTANT: ofono may need to be installed from source to contain the most -- To view, visit https://gerrit.osmocom.org/2918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a6ad33d41c8a90317d079ff0d1f9640c48a2353 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 14 22:42:35 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Wed, 14 Jun 2017 22:42:35 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations Message-ID: Review at https://gerrit.osmocom.org/2920 sigProcLib: Remove heap based signal vector allocations The osmo-trx internals rely heavily on dynamic alloction of I/Q signal vectors. In a number of cases there is no reason to to use dynamic rather than stack based allocation. Convert these cases accordingly.t Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede --- M Transceiver52M/sigProcLib.cpp 1 file changed, 49 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/2920/1 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 3a9a529..04cb0d4 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -626,8 +626,7 @@ { int burst_len, sps = 4; float phase; - signalVector *c0_pulse, *c1_pulse, *c0_burst; - signalVector *c1_burst, *c0_shaped, *c1_shaped; + signalVector *c0_pulse, *c1_pulse, *c0_shaped, *c1_shaped; signalVector::iterator c0_itr, c1_itr; c0_pulse = GSMPulse4->c0; @@ -638,13 +637,10 @@ burst_len = 625; - c0_burst = new signalVector(burst_len, c0_pulse->size()); - c0_burst->isReal(true); - c0_itr = c0_burst->begin(); - - c1_burst = new signalVector(burst_len, c1_pulse->size()); - c1_burst->isReal(true); - c1_itr = c1_burst->begin(); + signalVector c0_burst(burst_len, c0_pulse->size()); + signalVector c1_burst(burst_len, c1_pulse->size()); + c0_itr = c0_burst.begin(); + c1_itr = c1_burst.begin(); /* Padded differential tail bits */ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; @@ -660,10 +656,9 @@ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; /* Generate C0 phase coefficients */ - GMSKRotate(*c0_burst, sps); - c0_burst->isReal(false); + GMSKRotate(c0_burst, sps); - c0_itr = c0_burst->begin(); + c0_itr = c0_burst.begin(); c0_itr += sps * 2; c1_itr += sps * 2; @@ -688,8 +683,8 @@ *c1_itr = *c0_itr * Complex(0, phase); /* Primary (C0) and secondary (C1) pulse shaping */ - c0_shaped = convolve(c0_burst, c0_pulse, NULL, START_ONLY); - c1_shaped = convolve(c1_burst, c1_pulse, NULL, START_ONLY); + c0_shaped = convolve(&c0_burst, c0_pulse, NULL, START_ONLY); + c1_shaped = convolve(&c1_burst, c1_pulse, NULL, START_ONLY); /* Sum shaped outputs into C0 */ c0_itr = c0_shaped->begin(); @@ -697,10 +692,7 @@ for (unsigned i = 0; i < c0_shaped->size(); i++ ) *c0_itr++ += *c1_itr++; - delete c0_burst; - delete c1_burst; delete c1_shaped; - return c0_shaped; } @@ -774,7 +766,7 @@ static signalVector *shapeEdgeBurst(const signalVector &symbols) { size_t nsyms, nsamps = 625, sps = 4; - signalVector *burst, *shape; + signalVector *shape; signalVector::iterator burst_itr; nsyms = symbols.size(); @@ -782,10 +774,10 @@ if (nsyms * sps > nsamps) nsyms = 156; - burst = new signalVector(nsamps, GSMPulse4->c0->size()); + signalVector burst(nsamps, GSMPulse4->c0->size()); /* Delay burst by 1 symbol */ - burst_itr = burst->begin() + sps; + burst_itr = burst.begin() + sps; for (size_t i = 0; i < nsyms; i++) { float phase = i * 3.0f * M_PI / 8.0f; Complex rot = Complex(cos(phase), sin(phase)); @@ -795,8 +787,7 @@ } /* Single Gaussian pulse approximation shaping */ - shape = convolve(burst, GSMPulse4->c0, NULL, START_ONLY); - delete burst; + shape = convolve(&burst, GSMPulse4->c0, NULL, START_ONLY); return shape; } @@ -812,38 +803,37 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(148); + BitVector bits(148); signalVector *burst; /* Tail bits */ for (; i < 3; i++) - (*bits)[i] = 0; + bits[i] = 0; /* Random bits */ for (; i < 60; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Training sequence */ for (int n = 0; i < 87; i++, n++) - (*bits)[i] = gTrainingSequence[tsc][n]; + bits[i] = gTrainingSequence[tsc][n]; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Random bits */ for (; i < 145; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 148; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 8 + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; + burst = modulateBurst(bits, guard, sps); return burst; } @@ -861,28 +851,27 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(88+delay); + BitVector bits(88 + delay); signalVector *burst; /* delay */ for (; i < delay; i++) - (*bits)[i] = 0; + bits[i] = 0; /* head and synch bits */ for (int n = 0; i < 49+delay; i++, n++) - (*bits)[i] = gRACHBurst[n]; + bits[i] = gRACHBurst[n]; /* Random bits */ for (; i < 85+delay; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 88+delay; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 68-delay + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; + burst = modulateBurst(bits, guard, sps); return burst; } @@ -921,17 +910,18 @@ if ((tsc < 0) || (tsc > 7)) return NULL; - signalVector *shape, *burst = new signalVector(148); + signalVector *shape; + signalVector burst(148); const BitVector *midamble = &gEdgeTrainingSequence[tsc]; /* Tail */ int n, i = 0; for (; i < tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; /* Body */ for (; i < tail + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* TSC */ for (n = 0; i < tail + data + train; i++, n++) { @@ -939,19 +929,18 @@ (((unsigned) (*midamble)[3 * n + 1] & 0x01) << 1) | (((unsigned) (*midamble)[3 * n + 2] & 0x01) << 2); - (*burst)[i] = psk8_table[index]; + burst[i] = psk8_table[index]; } /* Body */ for (; i < tail + data + train + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* Tail */ for (; i < tail + data + train + data + tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; - shape = shapeEdgeBurst(*burst); - delete burst; + shape = shapeEdgeBurst(burst); return shape; } @@ -989,7 +978,7 @@ int guard_len, int sps) { int burst_len; - signalVector *pulse, *burst, *shaped; + signalVector *pulse, *shaped; signalVector::iterator burst_itr; if (sps == 1) @@ -999,9 +988,9 @@ burst_len = sps * (bits.size() + guard_len); - burst = new signalVector(burst_len, pulse->size()); - burst->isReal(true); - burst_itr = burst->begin(); + signalVector burst(burst_len, pulse->size()); + burst.isReal(true); + burst_itr = burst.begin(); /* Raw bits are not differentially encoded */ for (unsigned i = 0; i < bits.size(); i++) { @@ -1009,13 +998,11 @@ burst_itr += sps; } - GMSKRotate(*burst, sps); - burst->isReal(false); + GMSKRotate(burst, sps); + burst.isReal(false); /* Single Gaussian pulse approximation shaping */ - shaped = convolve(burst, pulse, NULL, START_ONLY); - - delete burst; + shaped = convolve(&burst, pulse, NULL, START_ONLY); return shaped; } @@ -1516,19 +1503,16 @@ static signalVector *downsampleBurst(const signalVector &burst) { - signalVector *in, *out; + signalVector in(DOWNSAMPLE_IN_LEN, dnsampler->len()); + signalVector *out = new signalVector(DOWNSAMPLE_OUT_LEN); + memcpy(in.begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); - out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - - if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, + if (dnsampler->rotate((float *) in.begin(), DOWNSAMPLE_IN_LEN, (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { delete out; out = NULL; } - delete in; return out; }; @@ -1621,7 +1605,6 @@ { int rc, start, len; bool clipping = false; - signalVector *corr; if ((sps != 1) && (sps != 4)) return -SIGERR_UNSUPPORTED; @@ -1637,12 +1620,10 @@ start = target - head - 1; len = head + tail; - corr = new signalVector(len); + signalVector corr(len); - rc = detectBurst(rxBurst, *corr, sync, + rc = detectBurst(rxBurst, corr, sync, thresh, sps, &, &toa, start, len); - delete corr; - if (rc < 0) { return -SIGERR_INTERNAL; } else if (!rc) { -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jun 14 22:42:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 22:42:35 +0000 Subject: libosmocore[master]: gsm0808: add speech codec type constants In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Wed Jun 14 23:03:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:03:21 +0000 Subject: libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (10 comments) (coding style comments, can't claim to have confirmed correctness with specs) https://gerrit.osmocom.org/#/c/2820/2/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 149: case GSM0808_SCT_FR1: let's do it like this: bool type_extended; (i.e. not setting a value at first) switch(sc->type) { case GSM0808_SCT_FR1: case GSM0808_SCT_FR2: case GSM0808_SCT_FR3: (i.e. one combined case for all) case [...]: type_extended = false; break; case GSM0808_SCT_SCD: type_extended = true; break; default: OSMO_ASSERT(false); break; } I'd prefer actual logging instead of ASSERT(false) but it seems this file has no logging anywhere; not sure whether that is policy, so accepting that. Line 206: /* Note: If a configuration is present or not depends on the selected This first sentence has no meaning? Ah, replace "If" with "Whether", please Line 207: * codec type. If present, it can either consist of one or two octet, "octets" Line 212: break; please align the 'break' with the code, i.e. one more level of indent, to match general osmocom coding style. Line 217: case GSM0808_SCT_FR5: combine with FR4 case above Line 221: case GSM0808_SCT_HR3: combine with FR3 above Line 224: case GSM0808_SCT_HR4: again combine, same below. Better to avoid code dup, fine to give up alphabetic ordering. Line 308: * depending on the codec type */ "Whether ... octets" Line 309: switch (sc->type) { combine all similar cases, as above https://gerrit.osmocom.org/#/c/2820/2/tests/gsm0808/gsm0808_test.c File tests/gsm0808/gsm0808_test.c: Line 591: (we usually avoid double blank lines ... maybe drop one that existed before this patch) -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Jun 14 23:06:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:06:26 +0000 Subject: libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) nitpick... https://gerrit.osmocom.org/#/c/2811/4/include/osmocom/gsm/protocol/gsm_08_08.h File include/osmocom/gsm/protocol/gsm_08_08.h: Line 397: GSM0808_PERM_FR1 = 0x01, /* GSM FR */ It would be good to keep the unrelated comment changes in a separate patch. Above line has a tab before the comment, where below you're adding just a space in the same places. -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d Gerrit-PatchSet: 4 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 Wed Jun 14 23:10:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:10:53 +0000 Subject: libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2812/4/include/osmocom/gsm/protocol/gsm_04_08.h File include/osmocom/gsm/protocol/gsm_04_08.h: Line 1626: GSM48_BCAP_SV_FR = 0, /* GSM FR V1 (GSM FR) */ would be better to keep unrelated comment changes in a separate patch, to be able to immediately see the functional changes in the patch that adds the constants. For example, combine the comment addition patches (from #2811) in one, then have patches that only add the new constants. If it makes sense you could also combine the new constants in one patch, to me it sounds like it does make sense to combine, since all are related to new speech modes? -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 4 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 Wed Jun 14 23:22:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:22:18 +0000 Subject: libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (5 comments) https://gerrit.osmocom.org/#/c/2830/3/include/osmocom/gsm/gsm0808_utils.h File include/osmocom/gsm/gsm0808_utils.h: Line 77: * representation we use in struct gsm0808_speech_codec */ Typically we don't place comments with the function declarations in .h files. Not sure why this file has comments for each. The API doc belongs in the .c file as proper doxygen comments, and shouldn't be duplicated in the .h file. https://gerrit.osmocom.org/#/c/2830/3/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 659: * representation we use in struct gsm0808_speech_codec */ Make this a proper doxygen comment, you will see that the other functions have them now when you rebase this patch onto current master. Line 665: * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ Does this comment rather belong joined to above API doc comment? Line 670: break; after a 'return' no 'break' necessary. Drop those. Line 694: break; in another patch you had a default: OSMO_ASSERT(false) ... why not here? Are we checking the -EINVAL return value at the caller? -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Jun 14 23:31:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:31:55 +0000 Subject: libosmocore[master]: gsm0808: add function to extrapolate speech codec In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (7 comments) https://gerrit.osmocom.org/#/c/2831/3//COMMIT_MSG Commit Message: Line 17: This patch adds a function that can be used as a helper to fill (generally in commit logs, rather use the imperative form: "Add function foo()." It is also good practice to put relevant information in the API doc and limit the commit log to reasons / decision process) https://gerrit.osmocom.org/#/c/2831/3/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 701: /* Extrapolate a speech codec field from a given permitted speech parameter */ Need proper API doc, as you will see for other functions now committed on master. Line 707: * codec that field that consistantly matches the channel type "that field that"? "consistently" Line 708: * configuration. This will basically reflect a non-transcoding- "This reflects a" Line 710: * stream may be differ from the codec used on the air interface) */ "may differ from" seems to me this comment belongs in the API doc Line 722: /* Depending on the, pick a default codc configuration, that on the? No comma before "that" Line 743: } missing "default:" case to return -EINVAL? -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Jun 14 23:41:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:41:39 +0000 Subject: osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (5 comments) marking -1 just to highlight question on isReal(). Also some cosmetics. https://gerrit.osmocom.org/#/c/2920/1//COMMIT_MSG Commit Message: Line 12: these cases accordingly.t "to to", ".t" https://gerrit.osmocom.org/#/c/2920/1/Transceiver52M/sigProcLib.cpp File Transceiver52M/sigProcLib.cpp: Line 644: how about c1_burst.isReal(true)? isn't that missing now? Line 660: c0_burst.isReal(false)? Line 943: shape = shapeEdgeBurst(burst); could also return shapeEdgeBurst(burst); and drop the shape var (because the final 'delete' is not needed anymore) Line 1005: shaped = convolve(&burst, pulse, NULL, START_ONLY); return convolve(...) ? -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 14 23:49:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 14 Jun 2017 23:49:10 +0000 Subject: osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2916/1/Makefile.am File Makefile.am: Line 8: contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \ we're removing sysmobts.service from EXTRA_DIST but keeping the file in the git repos? When the osmo-bts-sysmo.service file has an alias of sysmobts.service, can't we actually drop the sysmobts.service file from the repos safely? Does this also have implications on the debian files, i.e. missing changes? https://gerrit.osmocom.org/#/c/2916/1/contrib/sysmobts.service File contrib/sysmobts.service: Line 20: Alias=osmo-bts-sysmo.service I can understand aliasing the new service file as the old name, but adding an alias to the old file doesn't make sense to me. -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max 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 Thu Jun 15 00:04:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 00:04:34 +0000 Subject: osmo-gsm-tester[master]: Unuse resources after every test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (5 comments) https://gerrit.osmocom.org/#/c/2914/1//COMMIT_MSG Commit Message: Line 10: this test starts using it so it fixes it too. "this test"? commit log: good to stick to imperative form: "Fix bug in put_all()" should do here? Line 12: The process list is also cleaned after the processes are stopped, "is also cleaned"? Again in the imperative form rather describe directly what this patch does. That is the shortest and clearest way. https://gerrit.osmocom.org/#/c/2914/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 514: for my_item in item_list: I don't really like the "my_"... I'd choose just "item" Line 516: my_item.pop(USED_KEY) let's do just item.pop(USED_KEY, None) and then no 'if' is needed. https://gerrit.osmocom.org/#/c/2914/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 293: process.terminate() hmm, does it make sense to do this instead? while self._processes: self._processes.pop().terminate() -- To view, visit https://gerrit.osmocom.org/2914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 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-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 00:08:28 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 00:08:28 +0000 Subject: osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/2920/1//COMMIT_MSG Commit Message: Line 12: these cases accordingly.t > "to to", ".t" Oops. https://gerrit.osmocom.org/#/c/2920/1/Transceiver52M/sigProcLib.cpp File Transceiver52M/sigProcLib.cpp: Line 644: > how about c1_burst.isReal(true)? isn't that missing now? Looking at this again, c0 should be initialized with isReal(true) and changed to isReal(false) only after GMSKRotate(). Burst c1 should be initialized with isReal(false) - the default. So the original c1 setting was incorrect (but did not affect behavior), and the patch made c0 incorrect (disabling some optimizations). Changes are not trivial. I'll make a separate patch. Line 943: shape = shapeEdgeBurst(burst); > could also Noted. -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 00:22:06 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 00:22:06 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Fix complex/real vector flag in Laurent modulator Message-ID: Review at https://gerrit.osmocom.org/2921 sigProcLib: Fix complex/real vector flag in Laurent modulator The modulator vector to be shaped by Laurent C1 pulse is complex, but was set as real. The error does not affect behaviour because we only support complex-complex and complex-real calculations; real-real convolution is not supported. So in this case the data vector was already assumed to be complex despite the improper flag setting. Change-Id: I03afc6a93a01fde7a9a02e4eb9d201d3ee37d21a --- M Transceiver52M/sigProcLib.cpp 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/21/2921/1 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 3a9a529..04391d6 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -643,7 +643,6 @@ c0_itr = c0_burst->begin(); c1_burst = new signalVector(burst_len, c1_pulse->size()); - c1_burst->isReal(true); c1_itr = c1_burst->begin(); /* Padded differential tail bits */ -- To view, visit https://gerrit.osmocom.org/2921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03afc6a93a01fde7a9a02e4eb9d201d3ee37d21a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 15 00:27:23 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 00:27:23 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations 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/2920 to look at the new patch set (#2). sigProcLib: Remove heap based signal vector allocations The osmo-trx internals rely heavily on dynamic alloction of I/Q signal vectors. In a number of cases there is no reason to to use dynamic rather than stack based allocation. Convert these cases accordingly. Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede --- M Transceiver52M/sigProcLib.cpp 1 file changed, 53 insertions(+), 74 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/2920/2 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 04391d6..baea124 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -585,7 +585,7 @@ int guardPeriodLength, int sps) { int burst_len; - signalVector *pulse, rotated, *shaped; + signalVector *pulse, rotated; signalVector::iterator itr; pulse = GSMPulse1->empty; @@ -602,11 +602,7 @@ rotated.isReal(false); /* Dummy filter operation */ - shaped = convolve(&rotated, pulse, NULL, START_ONLY); - if (!shaped) - return NULL; - - return shaped; + return convolve(&rotated, pulse, NULL, START_ONLY); } static void rotateBurst2(signalVector &burst, double phase) @@ -626,8 +622,7 @@ { int burst_len, sps = 4; float phase; - signalVector *c0_pulse, *c1_pulse, *c0_burst; - signalVector *c1_burst, *c0_shaped, *c1_shaped; + signalVector *c0_pulse, *c1_pulse, *c0_shaped, *c1_shaped; signalVector::iterator c0_itr, c1_itr; c0_pulse = GSMPulse4->c0; @@ -638,12 +633,12 @@ burst_len = 625; - c0_burst = new signalVector(burst_len, c0_pulse->size()); - c0_burst->isReal(true); - c0_itr = c0_burst->begin(); + signalVector c0_burst(burst_len, c0_pulse->size()); + c0_burst.isReal(true); + c0_itr = c0_burst.begin(); - c1_burst = new signalVector(burst_len, c1_pulse->size()); - c1_itr = c1_burst->begin(); + signalVector c1_burst(burst_len, c1_pulse->size()); + c1_itr = c1_burst.begin(); /* Padded differential tail bits */ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; @@ -659,10 +654,10 @@ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; /* Generate C0 phase coefficients */ - GMSKRotate(*c0_burst, sps); - c0_burst->isReal(false); + GMSKRotate(c0_burst, sps); + c0_burst.isReal(false); - c0_itr = c0_burst->begin(); + c0_itr = c0_burst.begin(); c0_itr += sps * 2; c1_itr += sps * 2; @@ -687,8 +682,8 @@ *c1_itr = *c0_itr * Complex(0, phase); /* Primary (C0) and secondary (C1) pulse shaping */ - c0_shaped = convolve(c0_burst, c0_pulse, NULL, START_ONLY); - c1_shaped = convolve(c1_burst, c1_pulse, NULL, START_ONLY); + c0_shaped = convolve(&c0_burst, c0_pulse, NULL, START_ONLY); + c1_shaped = convolve(&c1_burst, c1_pulse, NULL, START_ONLY); /* Sum shaped outputs into C0 */ c0_itr = c0_shaped->begin(); @@ -696,10 +691,7 @@ for (unsigned i = 0; i < c0_shaped->size(); i++ ) *c0_itr++ += *c1_itr++; - delete c0_burst; - delete c1_burst; delete c1_shaped; - return c0_shaped; } @@ -773,7 +765,7 @@ static signalVector *shapeEdgeBurst(const signalVector &symbols) { size_t nsyms, nsamps = 625, sps = 4; - signalVector *burst, *shape; + signalVector *shape; signalVector::iterator burst_itr; nsyms = symbols.size(); @@ -781,10 +773,10 @@ if (nsyms * sps > nsamps) nsyms = 156; - burst = new signalVector(nsamps, GSMPulse4->c0->size()); + signalVector burst(nsamps, GSMPulse4->c0->size()); /* Delay burst by 1 symbol */ - burst_itr = burst->begin() + sps; + burst_itr = burst.begin() + sps; for (size_t i = 0; i < nsyms; i++) { float phase = i * 3.0f * M_PI / 8.0f; Complex rot = Complex(cos(phase), sin(phase)); @@ -794,8 +786,7 @@ } /* Single Gaussian pulse approximation shaping */ - shape = convolve(burst, GSMPulse4->c0, NULL, START_ONLY); - delete burst; + shape = convolve(&burst, GSMPulse4->c0, NULL, START_ONLY); return shape; } @@ -811,38 +802,37 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(148); + BitVector bits(148); signalVector *burst; /* Tail bits */ for (; i < 3; i++) - (*bits)[i] = 0; + bits[i] = 0; /* Random bits */ for (; i < 60; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Training sequence */ for (int n = 0; i < 87; i++, n++) - (*bits)[i] = gTrainingSequence[tsc][n]; + bits[i] = gTrainingSequence[tsc][n]; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Random bits */ for (; i < 145; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 148; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 8 + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; + burst = modulateBurst(bits, guard, sps); return burst; } @@ -860,28 +850,27 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(88+delay); + BitVector bits(88 + delay); signalVector *burst; /* delay */ for (; i < delay; i++) - (*bits)[i] = 0; + bits[i] = 0; /* head and synch bits */ for (int n = 0; i < 49+delay; i++, n++) - (*bits)[i] = gRACHBurst[n]; + bits[i] = gRACHBurst[n]; /* Random bits */ for (; i < 85+delay; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 88+delay; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 68-delay + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; + burst = modulateBurst(bits, guard, sps); return burst; } @@ -920,17 +909,18 @@ if ((tsc < 0) || (tsc > 7)) return NULL; - signalVector *shape, *burst = new signalVector(148); + signalVector *shape; + signalVector burst(148); const BitVector *midamble = &gEdgeTrainingSequence[tsc]; /* Tail */ int n, i = 0; for (; i < tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; /* Body */ for (; i < tail + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* TSC */ for (n = 0; i < tail + data + train; i++, n++) { @@ -938,19 +928,18 @@ (((unsigned) (*midamble)[3 * n + 1] & 0x01) << 1) | (((unsigned) (*midamble)[3 * n + 2] & 0x01) << 2); - (*burst)[i] = psk8_table[index]; + burst[i] = psk8_table[index]; } /* Body */ for (; i < tail + data + train + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* Tail */ for (; i < tail + data + train + data + tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; - shape = shapeEdgeBurst(*burst); - delete burst; + shape = shapeEdgeBurst(burst); return shape; } @@ -988,7 +977,7 @@ int guard_len, int sps) { int burst_len; - signalVector *pulse, *burst, *shaped; + signalVector *pulse; signalVector::iterator burst_itr; if (sps == 1) @@ -998,9 +987,9 @@ burst_len = sps * (bits.size() + guard_len); - burst = new signalVector(burst_len, pulse->size()); - burst->isReal(true); - burst_itr = burst->begin(); + signalVector burst(burst_len, pulse->size()); + burst.isReal(true); + burst_itr = burst.begin(); /* Raw bits are not differentially encoded */ for (unsigned i = 0; i < bits.size(); i++) { @@ -1008,15 +997,11 @@ burst_itr += sps; } - GMSKRotate(*burst, sps); - burst->isReal(false); + GMSKRotate(burst, sps); + burst.isReal(false); /* Single Gaussian pulse approximation shaping */ - shaped = convolve(burst, pulse, NULL, START_ONLY); - - delete burst; - - return shaped; + return convolve(&burst, pulse, NULL, START_ONLY); } /* Assume input bits are not differentially encoded */ @@ -1515,19 +1500,16 @@ static signalVector *downsampleBurst(const signalVector &burst) { - signalVector *in, *out; + signalVector in(DOWNSAMPLE_IN_LEN, dnsampler->len()); + signalVector *out = new signalVector(DOWNSAMPLE_OUT_LEN); + memcpy(in.begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); - out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - - if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, + if (dnsampler->rotate((float *) in.begin(), DOWNSAMPLE_IN_LEN, (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { delete out; out = NULL; } - delete in; return out; }; @@ -1620,7 +1602,6 @@ { int rc, start, len; bool clipping = false; - signalVector *corr; if ((sps != 1) && (sps != 4)) return -SIGERR_UNSUPPORTED; @@ -1636,12 +1617,10 @@ start = target - head - 1; len = head + tail; - corr = new signalVector(len); + signalVector corr(len); - rc = detectBurst(rxBurst, *corr, sync, + rc = detectBurst(rxBurst, corr, sync, thresh, sps, &, &toa, start, len); - delete corr; - if (rc < 0) { return -SIGERR_INTERNAL; } else if (!rc) { -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 15 00:35:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 00:35:26 +0000 Subject: osmo-gsm-tester[master]: Use a subdir of run_dir for each test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) I am not that sure that we should tie each process to a test script instead of a suite_run. When I wrote the code the intention was to allow processes to run for the duration of a suite, across several tests, and we will probably do so in the future. But I welcome having a run dir structure that reflects which test started the process, in fact wanted to add this every time I read logs. So I want this, but a bit differently... This patch changes many lines to insert 'test' before 'suite_run' ("self.test.suite_run..."). The only reason to need the 'Test' instance in each process class like OsmoNitb is to get its run_dir. Otherwise suite_run provides everything those classes need. So let's still pass suite_run instead of test. In each process class let's still store self.suite_run, not self.test, and hence make this patch a lot shorter. (Even if we were storing self.test, I'd also store self.suite_run to avoid the numerous code changes inserting 'test'.) But since the process classes need nothing from the Test() class except the run_dir, let's not store a Test() reference at all. I would rather put the change here: each process class like OsmoNitb() calls so far suite_run.get_run_dir(). Let's have a new suite_run.new_run_dir(name) function, which creates a new run dir using suite_run.current_test.get_run_dir().new_dir(). Change all self.suite_run.get_run_dir() to self.suite_run.new_run_dir(name_str). This way we don't even need to change the signature of classes like OsmoNitb(). And still the run dirs per test are only created when we are actually going to put something inside, i.e. when calling suite_run.new_run_dir(), so that we're not creating empty run dirs if a test doesn't use it. Makes sense? https://gerrit.osmocom.org/#/c/2915/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 94: self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name)) rather self.name() -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 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-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 01:39:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 01:39:12 +0000 Subject: osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (27 comments) https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/esme.py File src/osmo_gsm_tester/esme.py: Line 37: self.system_id = 'esme-id' each new Esme class gets an identical system_id, which gets put in a config in a for loop, i.e. it's easy to mistakenly create multiple esmes with the same ID? Line 41: self.binded = False "bound" ... 'binded' is not a word Line 42: self.listen_flag = False "flag" is ambiguous. rather name it "is_listening" or "listening" Line 54: self.system_id = name It's easy to create an Esme with system_id == None? then the config file would say "None" as id? Line 57: self.password = password does self.password == None produce a valid config? Line 60: config = { 'system_id': self.system_id, 'password': self.password } (I kinda like using dict(name=val, name2=val2), because it has less quoting, but it's up to you) Line 64: self.client.poll() why handler? not just "poll()"? Line 71: if self.listen_flag: early exit Line 90: self.log('Connected and binded successfully. Start listening') "bound"; "Starting to listen" Line 100: self.connected = False I'm wondering, will there ever be a valid state where we're not all of the three, connected, bound and listening? Does it make sense to keep only one flag for all three? https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/osmo_msc.py File src/osmo_gsm_tester/osmo_msc.py: Line 25: class OsmoMsc(log.Origin, smsc.Smsc): I would prefer using composition instead of multiple inheritance: OsmoMsc.smsc = Smsc(...) Line 36: smsc.Smsc.__init__(self, (ip_address.get('addr'), 2775)) ...because multiple inheritance is a bit ugly, in pretty much every language. https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/sms.py File src/osmo_gsm_tester/sms.py: Line 24: def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): any particular reason for this rename? https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/smsc.py File src/osmo_gsm_tester/smsc.py: Line 41: def esme_add(self, esme): validate against dup ids or empty passwords? Line 46: return self.addr_port can't callers just use smsc.addr_port directly? https://gerrit.osmocom.org/#/c/2884/2/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 351: def msisdn(self): > This change was needed, otherwise I get an error with something like "suite looks like a bugfix indeed. So far we used only subscriber_add(), never this function yet. https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl: Line 27: policy ${msc.smsc.policy} as with mgcpgw, it would make sense to just use 'smsc.policy' as key, dropping the 'msc' part. https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl: Line 80: policy ${nitb.smsc.policy} drop 'nitb.' from key https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_connect_policy_acceptall.py File suites/aoip_smpp/esme_connect_policy_acceptall.py: Line 18: # here we deliberately ommit calling msc.esme_add() to avoid having it included in the smsc config. "omit" Line 25: # Connect should work even if we didn't previously configure the esme in the smsc. "Due to accept-all policy," https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_connect_policy_closed.py File suites/aoip_smpp/esme_connect_policy_closed.py: Line 31: # Connect should work as we configured msc properly at esme_add() time. the log message already says it, drop the comment? (also below) Line 39: new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' really? lol why not just new_password = 'garble'? Line 47: new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' 'garble'? https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_ms_sms.py File suites/aoip_smpp/esme_ms_sms.py: Line 52: # esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) (I think we accept SMS for any MSISDN? As in, deliver it once the subscriber becomes available, without checking that a destination is valid in advance.) https://gerrit.osmocom.org/#/c/2884/3/suites/smpp/esme_connect_policy_acceptall.py File suites/smpp/esme_connect_policy_acceptall.py: Line 12: # here we deliberately ommit calling nitb.esme_add() to avoid having it included in the smsc config. "omit" Line 15: # Connect should work even if we didn't previously configure the esme in the smsc. "Due to accept-all policy..." https://gerrit.osmocom.org/#/c/2884/3/suites/smpp/esme_connect_policy_closed.py File suites/smpp/esme_connect_policy_closed.py: Line 22: # Connect should work as we configured nitb properly at esme_add() time. drop comments -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 3 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 01:50:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 01:50:21 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) When I read this, I still have a question. So we install to separate dirs, then stow creates symlinks to combine the installed files in one dir again? But then we need to pass only one LD_LIBRARY_PATH and one PKG_CONFIG_PATH with the symlinks? So how then does it make us find errors like forgotten dep dirs? Or otherwise, why the symlinks? https://gerrit.osmocom.org/#/c/2691/3/scripts/osmo-build-dep.sh File scripts/osmo-build-dep.sh: Line 54: mkdir -p "$inst/stow" I still don't understand why a separate 'stow' subdir is needed. $inst is an empty directory intended for storing installation files. Does stow put things in "$STOW_DIR/.." or why the extra path element? -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 01:54:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 01:54:10 +0000 Subject: osmo-trx[master]: sigProcLib: Fix complex/real vector flag in Laurent modulator In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I don't, but sounds like you know that it's correct :) -- To view, visit https://gerrit.osmocom.org/2921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03afc6a93a01fde7a9a02e4eb9d201d3ee37d21a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 01:58:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 01:58:37 +0000 Subject: osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) two unimportant cosmetics that you could tweak ... otherwise I'd +2 if I had the powers https://gerrit.osmocom.org/#/c/2920/2/Transceiver52M/sigProcLib.cpp File Transceiver52M/sigProcLib.cpp: Line 791: return shape; return convolve(); and drop shape, like above? Line 944: return shape; same? -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 02:00:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 02:00:35 +0000 Subject: libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2901/1/include/osmocom/core/utils.h File include/osmocom/core/utils.h: Line 23: #define OSMO_NUM_BYTES(N) ((N + 8 - 1) / 8) (could call it BITS instead of N) -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Thu Jun 15 02:03:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 02:03:36 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (2 comments) seems you forgot to 'git add' the common script? https://gerrit.osmocom.org/#/c/2894/7/contrib/jenkins_bts_trx.sh File contrib/jenkins_bts_trx.sh: Line 3: # shellcheck source=contrib/jenkins_common_prefix.sh shellcheck? Line 4: . $(dirname "$0")/jenkins_common_prefix.sh I'd call it 'jenkins_common.sh', because 'prefix' is usually an installation destination passed to ./configure scripts. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 02:06:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 02:06:56 +0000 Subject: osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/2747/3//COMMIT_MSG Commit Message: Line 9: Change Id of the code implementation: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 no, that's the same change Id of this patch :) -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals 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 Thu Jun 15 02:09:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 02:09:35 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (1 comment) looks good except... https://gerrit.osmocom.org/#/c/2891/7/contrib/jenkins_common_prefix.sh File contrib/jenkins_common_prefix.sh: Line 1: #!/bin/sh this file seems to belong in the other patch https://gerrit.osmocom.org/2894 -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts 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 Thu Jun 15 02:14:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 02:14:47 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) (btw, osmo-gsm-tester scripts don't use osmo-ci, to be self-contained in osmo-gsm-tester.git) https://gerrit.osmocom.org/#/c/2893/4/scripts/osmo-layer1-headers.sh File scripts/osmo-layer1-headers.sh: Line 31: # if 2nd parameter was specified and it's not 'master' than use it instead of default "then" -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 02:20:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 15 Jun 2017 02:20:58 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 11: Code-Review-1 (7 comments) whoa, I just found some old comments of mine that I forgot to post. I was going to accept this patch now, but maybe take a look at my old comments first... sorry to keep you busy for so long https://gerrit.osmocom.org/#/c/2465/10/scripts/osmo-build.sh File scripts/osmo-build.sh: Line 43: # # Holds all required dependencies in the following form: rather "Return in stdout"? Line 55: # # (e.g. PARALLEL_MAKE="-j1" to disable mutlithreading) PARALLEL_MAKE is not an argument, it is an environment variable Line 56: # # - arg 1: dep_project = the git repository name, gets places in a git.osmocom.org URL. what? above you say $1 is "one of these script/functions", now it is a repository name? ... i.e. need to clarify whose script you're talking about Line 58: # # - arg 3: configuration (optional: $cfg used in osmo-build-dep.sh) "options to pass to ./configure, see $cfg in osmo-build-dep.sh" Line 61: # "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") how is this verification step part of 'generic_deps'? It should be part of something with "build" in its name. Line 109: # ( '/' separates job name and matrix-axis) "in $JOB_NAME" Line 170: would be nicer to need only one way to get branch and rev ...or to be given the branch from the caller and only need to determine the git hash -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 11 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 08:21:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 15 Jun 2017 08:21:09 +0000 Subject: osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/2916/1/Makefile.am File Makefile.am: Line 8: contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \ > we're removing sysmobts.service from EXTRA_DIST but keeping the file in the This is the point of this patch, to not remove the file yet so that Openembedded build doesn't fail. It will be removed later as a next step. This way we don't need to coordinate tightly the changes in the 2 places. This is what OE does: install -m 0644 ${S}/contrib/sysmobts.service ${D}${systemd_unitdir}/system/ https://gerrit.osmocom.org/#/c/2916/1/contrib/sysmobts.service File contrib/sysmobts.service: Line 20: Alias=osmo-bts-sysmo.service > I can understand aliasing the new service file as the old name, but adding I think is still nice if someone is already building an image (thus installing sysmobts.service) that they already have the possibility to use osmo-bts-sysmo service. -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max 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 Thu Jun 15 08:38:29 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Thu, 15 Jun 2017 08:38:29 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) > (1 comment) > > When I read this, I still have a question. So we install to > separate dirs, then stow creates symlinks to combine the installed > files in one dir again? But then we need to pass only one > LD_LIBRARY_PATH and one PKG_CONFIG_PATH with the symlinks? So how > then does it make us find errors like forgotten dep dirs? Or > otherwise, why the symlinks? The reason is that the .pc files point to the original install locations, not to the one where stow aggregates the installations. That makes the difference during the build. Just give it a try with the openbsc repository. Revert commit 5265bea76c90427d70257b7fac0f0b7d40a015cb and run contrib/jenkins.sh without this changeset applied to osmo-ci. https://gerrit.osmocom.org/#/c/2691/3/scripts/osmo-build-dep.sh File scripts/osmo-build-dep.sh: Line 54: mkdir -p "$inst/stow" > I still don't understand why a separate 'stow' subdir is needed. $inst is a Yes, it does. >From the manpage: > the target directory is assumed to be the parent of the current directory -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 08:53:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 15 Jun 2017 08:53:17 +0000 Subject: osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Patch Set 3: (25 comments) Thanks for the review! https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/esme.py File src/osmo_gsm_tester/esme.py: Line 37: self.system_id = 'esme-id' > each new Esme class gets an identical system_id, which gets put in a config Yes, but the ID can be changed using the set_system_id method. I could move the set_msisdn to the constructor and use the unique msisdn there for the initial system-id. Line 41: self.binded = False > "bound" ... 'binded' is not a word Oops true :P Line 42: self.listen_flag = False > "flag" is ambiguous. rather name it "is_listening" or "listening" ACK Line 54: self.system_id = name > It's easy to create an Esme with system_id == None? then the config file wo I think now it doesn't make sense to have it to None, so I'll remove the =None and probably also do some extra checks, like len()>0 and len() does self.password == None produce a valid config? Same as above, not sure it makes sense to have None there. Not sure if it's OK to have an empty password, I'll check that too. Line 60: config = { 'system_id': self.system_id, 'password': self.password } > (I kinda like using dict(name=val, name2=val2), because it has less quoting I think I found it like this in some places too. I like it, it looks more like json and I usually think as in json when using dictionaries :) Line 64: self.client.poll() > why handler? not just "poll()"? I can change that to poll() Line 71: if self.listen_flag: > early exit ACK Line 90: self.log('Connected and binded successfully. Start listening') > "bound"; "Starting to listen" ACK Line 100: self.connected = False > I'm wondering, will there ever be a valid state where we're not all of the client.connect() or client.bind() can fail, so for sure it can happen :) For example, during bind SMSC already checks the system-id and password, I am actually testing that (with explicit wrong system-id/password) in some test. https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/osmo_msc.py File src/osmo_gsm_tester/osmo_msc.py: Line 25: class OsmoMsc(log.Origin, smsc.Smsc): > I would prefer using composition instead of multiple inheritance: OsmoMsc.s Ok, I can change that. Is there some specific syntax in python for that? Or I just create a property in the constructor? self.smsc = smsc.Smsc() Then I use self.smsc everywhere instead of self? https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/osmo_nitb.py File src/osmo_gsm_tester/osmo_nitb.py: Line 26: class OsmoNitb(log.Origin, smsc.Smsc): Same here regarding inheritance vs composition https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/sms.py File src/osmo_gsm_tester/sms.py: Line 24: def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): > any particular reason for this rename? It looks clearer to me, as in any packet you usually use src + dst terminology. https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/smsc.py File src/osmo_gsm_tester/smsc.py: Line 41: def esme_add(self, esme): > validate against dup ids or empty passwords? I'll fix the dup ids using the msisdn and the passwd stuff also in the Esme class, no need to do it here. Line 46: return self.addr_port > can't callers just use smsc.addr_port directly? Yes. Initially this was an abstract method to be implemented by subclasses, but finally I just saw I could pass it through the constructor so it got simplified. I can remove the method entirely. https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl: Line 27: policy ${msc.smsc.policy} > as with mgcpgw, it would make sense to just use 'smsc.policy' as key, dropp ACK, will do https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl: Line 80: policy ${nitb.smsc.policy} > drop 'nitb.' from key ACK, will do https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_connect_policy_acceptall.py File suites/aoip_smpp/esme_connect_policy_acceptall.py: Line 18: # here we deliberately ommit calling msc.esme_add() to avoid having it included in the smsc config. > "omit" ACK Line 25: # Connect should work even if we didn't previously configure the esme in the smsc. > "Due to accept-all policy," ACK, will add it https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_connect_policy_closed.py File suites/aoip_smpp/esme_connect_policy_closed.py: Line 31: # Connect should work as we configured msc properly at esme_add() time. > the log message already says it, drop the comment? (also below) ACK, will remove this one and add "it should fail" to the prints below + remove the comments. Line 39: new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' > really? lol it's not like adding a lot of code and this way we assert it won't be an issue later if somebody decides to change the default password :) Let's be paranoic! https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_ms_sms.py File suites/aoip_smpp/esme_ms_sms.py: Line 52: # esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) > (I think we accept SMS for any MSISDN? As in, deliver it once the subscribe Well when I was manually running nitb with no modem connected to test python-smpplib, I was always receiving this kind of error, so it's probably some part of the config which is different. I need to check which part of the config handles this and tweak it, but it can be done later on, no need to implement the whole SMPP support + all possible tests now. Hopefully somebody will collaborate and add more tests once there are a few of them as an example. https://gerrit.osmocom.org/#/c/2884/3/suites/smpp/esme_connect_policy_acceptall.py File suites/smpp/esme_connect_policy_acceptall.py: Line 12: # here we deliberately ommit calling nitb.esme_add() to avoid having it included in the smsc config. > "omit" ACK Line 15: # Connect should work even if we didn't previously configure the esme in the smsc. > "Due to accept-all policy..." ACK https://gerrit.osmocom.org/#/c/2884/3/suites/smpp/esme_connect_policy_closed.py File suites/smpp/esme_connect_policy_closed.py: Line 22: # Connect should work as we configured nitb properly at esme_add() time. > drop comments Will do same as in the other file. -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 3 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 08:58:00 2017 From: gerrit-no-reply at lists.osmocom.org (blobb) Date: Thu, 15 Jun 2017 08:58:00 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 11: (2 comments) Thanks for your review! I actually expected more comments as you stated "some comments" in an earlier PS. :) I will apply all comments, but for two of them I need further information/clarification. Please see my comments, just want to be sure to get your points right before pushing next PS. https://gerrit.osmocom.org/#/c/2465/10/scripts/osmo-build.sh File scripts/osmo-build.sh: Line 61: # "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") > how is this verification step part of 'generic_deps'? It should be part of I agree. Then it's probably best to use generic_deps() only to determine artifact name. And let the build script, which sources osmo-build.sh declare build_deps() additionally to generic_deps() and build_project(). That's probably more comprehensive too? Line 170: > would be nicer to need only one way to get branch and rev ...or to be given Do you mean branch_and_rev_of{remote,local}_repo when speaking about "... needed only one way"? branch_and_rev_of_remote_repo gets branch already by caller. branch_and_rev_of_remote_repo can actually do the same. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 11 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 08:59:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 15 Jun 2017 08:59:20 +0000 Subject: osmo-gsm-tester[master]: Unuse resources after every test In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/2914/1//COMMIT_MSG Commit Message: Line 10: this test starts using it so it fixes it too. > "this test"? commit log: good to stick to imperative form: Heh I meant "this patch" but I was thinking about the tests added in previous patch. I'll re-do this part. Line 12: The process list is also cleaned after the processes are stopped, > "is also cleaned"? Again in the imperative form rather describe directly wh ACK https://gerrit.osmocom.org/#/c/2914/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 514: for my_item in item_list: > I don't really like the "my_"... I'd choose just "item" ACK Line 516: my_item.pop(USED_KEY) > let's do just ACK https://gerrit.osmocom.org/#/c/2914/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 293: process.terminate() > hmm, does it make sense to do this instead? Yes, I initially wanted to pop() somehow but wasn't sure which was the best way to do that. I like your proposal. -- To view, visit https://gerrit.osmocom.org/2914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 09:00:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 15 Jun 2017 09:00:33 +0000 Subject: osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote In-Reply-To: References: Message-ID: Patch Set 3: Oops, I probably copied it from the wrong tab in my web browser, good catch! -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals 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 Thu Jun 15 09:09:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 09:09:43 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 7: > this file seems to belong in the other patch jenkins_lc15.sh uses it so it belongs to this commit - you've asked to first merge jenkins_lc15.sh and than other changes so I changed the order of commits. Please make up your mind which commit should go first. -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 7 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 09:10:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 09:10:43 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 7: > shellcheck? Tool for static analysis of shell scripts. This comment is directive instructing it where to look for sourced file. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max 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 Jun 15 09:11:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 09:11:28 +0000 Subject: osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: > Does this also have implications on the debian files, i.e. missing changes? No, I check that .deb builds fine before submitting this patch. -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max 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 Thu Jun 15 09:16:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 15 Jun 2017 09:16:23 +0000 Subject: osmo-gsm-tester[master]: Use a subdir of run_dir for each test In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) I am not all convinced that we will end up using a process over all tests runs in it, but it may happen. I think we agree though that for now we want to run processes in per-test scope, which is good. If later we want to add per-suite scope processes then we may need to add another list in suite_run to those kind of processes, and it may make sense moving the current one to the Test class. Regarding your proposed modifications, I agree in simplifying it, but instead of having a suite_run._new_run_dir(name) which creates suite-name/suite-test/name, I'd prefer to have a suite_run.get_run_dir() and suite_run.get_test_run_dir() (which internally calls suite_run,get_run_dir + appends test-name) and build whatever is needed from there as it is done now using util.dir(), as we may want to do more complex stuff later on as described in the first paragraph. What do you think? https://gerrit.osmocom.org/#/c/2915/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 94: self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name)) > rather self.name() I initially did that but then the line number gets added which doesn't make sense imho. -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 09:32:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 09:32:16 +0000 Subject: [PATCH] libosmocore[master]: Move NUM_BYTES macro to core library 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/2901 to look at the new patch set (#2). Move NUM_BYTES macro to core library It's universally useful so it make sense to have it in the shared core: * move macro from libosmocoding to libosmocore * add OSMO_ prefix * add doxygen docs Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/core/utils.h M src/coding/gsm0503_coding.c 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/2901/2 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index 55375bb..2f0e631 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -13,7 +13,6 @@ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) -#define NUM_BYTES(N) ((N + 8 - 1) / 8) enum gsm0503_egprs_mcs { EGPRS_MCS0, diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..1f8bdd8 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -19,6 +19,8 @@ #define OSMO_STRINGIFY(x) #x /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Number of bytes necessary to store given BITS */ +#define OSMO_NUM_BYTES(BITS) ((BITS + 8 - 1) / 8) #include #include diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 7039863..ea9578a 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -901,7 +901,7 @@ u, 0, data_len, 1); /* Return the number of bytes required for the bit message */ - return NUM_BYTES(code->hdr_len + code->data_len); + return OSMO_NUM_BYTES(code->hdr_len + code->data_len); } /*! \brief Decode EGPRS UL message -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 15 09:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 09:34:59 +0000 Subject: [PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2893 to look at the new patch set (#5). Add script for fetching BTS-specific L1 headers Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682 --- A scripts/osmo-layer1-headers.sh 1 file changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/5 diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh new file mode 100755 index 0000000..b2372d4 --- /dev/null +++ b/scripts/osmo-layer1-headers.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# -e: fail if any of the subsequent commands fail +# -x: trace each executed command via debug log +set -e -x + +# Usage: +# ./osmo-layer1-headers.sh sysmo superfemto_v5.1 +# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset) +# 2nd parameter is optional and defaults to latest master branch + +case "$1" in + sysmo) + uri="git://git.sysmocom.de/sysmo-bts/layer1-api" + version="origin/master" + ;; + oct) + uri="git://git.osmocom.org/octphy-2g-headers" + version="origin/master" + ;; + lc15) + uri="https://gitlab.com/nrw_litecell15/litecell15-fw" + version="nrw/litecell15-next" + ;; + *) + echo "Unknown BTS model '$1'" + exit 1 + ;; +esac + +# if 2nd parameter was specified and it's not 'master' then use it instead of default +if [ -n "$2" ] +then + if [ "$2" != "master" ] + then + version=$2 + fi +fi + +if ! test -d layer1-headers; +then + git clone "$uri" layer1-headers +fi + +cd layer1-headers +git fetch origin +git reset --hard "$version" -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Jun 15 09:38:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 09:38:35 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 4: > osmo-gsm-tester scripts don't use osmo-ci So why you've comment in another patch that "each is still callable on its own" in the context of osmo-gsm-tester and jenkins_* helpers in osmo-bts? Those are using osmo-ci. -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 09:55:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 15 Jun 2017 09:55:01 +0000 Subject: osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl File src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl: Line 24: smpp indentation is not correct. Line 26: system-id test-nitb this should be test-msc -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 3 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: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 10:42:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 10:42:48 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 11: Would be also nice to make script executable by default. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 11 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 11:04:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 11:04:29 +0000 Subject: openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2819/3/openbsc/src/libbsc/bsc_init.c File openbsc/src/libbsc/bsc_init.c: Line 118: rc = rsl_bcch_info(bts, trx, i, GSM_BTS_SI(bts, i), si_len); we resolve 'bts' from trx->bts above, there's no point in passing both into the function. Please just pass trx, as trx->bts can allways dereferenced there. -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 15 11:04:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 11:04:55 +0000 Subject: openbsc[master]: Move SI-related defines In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Thu Jun 15 11:07:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 11:07:48 +0000 Subject: openbsc[master]: Update SI data structures and generation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Thu Jun 15 11:08:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 11:08:46 +0000 Subject: osmo-bts[master]: Cleanup SI scheduling In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 Gerrit-PatchSet: 2 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 Thu Jun 15 11:10:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 11:10:56 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/2824/1/src/common/rsl.c File src/common/rsl.c: Line 318: memset(GSM_BTS_SI2Q(bts, bts->si2q_index), 0x2b, sizeof(sysinfo_buf_t)); we can use GSM_MACBLOCK_PADDING from libosmogsm gsm_04_08.h for that Line 328: memset(bts->si_buf[osmo_si], 0x2b, sizeof(sysinfo_buf_t)); same here -- To view, visit https://gerrit.osmocom.org/2824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Gerrit-PatchSet: 1 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 Thu Jun 15 11:18:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 11:18:02 +0000 Subject: [PATCH] openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2819 to look at the new patch set (#4). bsc_init: Forget which SIs are valid for the trx Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 14 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/2819/4 diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index e61d4ea..400e09f 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -25,7 +25,7 @@ #include #include #include - +#include #include struct gsm_bts; @@ -35,8 +35,7 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len); +int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr, diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 7ee19a7..6ae790f 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -226,11 +226,16 @@ /* Send a BCCH_INFO message as per Chapter 8.5.1 */ -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len) +int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len) { struct abis_rsl_dchan_hdr *dh; + const struct gsm_bts *bts = trx->bts; struct msgb *msg = rsl_msgb_alloc(); + uint8_t type = osmo_sitype2rsl(si_type); + + if (bts->c0 != trx) + LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS%u/TRX%u\n", + get_value_string(osmo_sitype_strs, si_type), bts->nr, trx->nr); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof*dh); init_dchan_hdr(dh, RSL_MT_BCCH_INFO); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 91d3a14..12bf80b 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -116,11 +116,10 @@ break; case SYSINFO_TYPE_2quater: for (j = 0; j <= bts->si2q_count; j++) - rc = rsl_bcch_info(bts, trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); + rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); break; } @@ -139,6 +138,9 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; + /* Zero, forget the state of the SIs */ + bts->si_valid = 0; + /* First, we determine which of the SI messages we actually need */ if (trx == bts->c0) { -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 11:43:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 11:43:10 +0000 Subject: [MERGED] openbsc[master]: Move SI-related defines In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move SI-related defines ...................................................................... Move SI-related defines * move SI2quater related defines to shared header * add define from OsmoBTS which checks for presence of a given SI message in gsm_bts struct. Rename it to avoid conflicts with OsmoBTS code and to match naming conventions of similar macros. Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Related: OS#1660 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/include/openbsc/rest_octets.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.c 5 files changed, 11 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index b72ed2d..a507606 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -26,6 +26,12 @@ #include +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 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; @@ -486,6 +492,7 @@ }; #define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater]) +#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) #define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i]) #define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i]) diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 7b324d3..49a2312 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -5,12 +5,6 @@ #include #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 4-bit index is used */ -#define SI2Q_MAX_NUM 16 -/* length in bits (for single SI2quater message) */ -#define SI2Q_MAX_LEN 160 -#define SI2Q_MIN_LEN 18 - /* generate SI1 rest octets */ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); int rest_octets_si2quater(uint8_t *data, struct gsm_bts *bts); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index e5226a9..25f3fdc 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -186,7 +186,7 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; - if (!(bts->si_valid & (1 << i))) + if (!GSM_BTS_HAS_SI(bts, i)) continue; rc = rsl_si(trx, i, si_len[i]); if (rc < 0) diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 644bebd..a074a78 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -774,13 +774,13 @@ /* allow/disallow DTXu */ gsm48_set_dtx(&si3->cell_options, bts->dtxu, bts->dtxu, true); - if ((bts->si_valid & (1 << SYSINFO_TYPE_2ter))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) { LOGP(DRR, LOGL_INFO, "SI 2ter is included.\n"); si_info.si2ter_indicator = 1; } else { si_info.si2ter_indicator = 0; } - if ((bts->si_valid & (1 << SYSINFO_TYPE_2quater))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater)) { LOGP(DRR, LOGL_INFO, "SI 2quater is included, based on %zu EARFCNs and %zu UARFCNs.\n", si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); si_info.si2quater_indicator = 1; diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 36f6993..5a78505 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -105,7 +105,7 @@ r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); if (r > 0) printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", - (bts->si_valid & (1 << SYSINFO_TYPE_2quater)) ? "valid" : "invalid", + GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", bts->si2q_index, bts->si2q_count, r, osmo_hexdump((void *)GSM_BTS_SI2Q(bts), GSM_MACBLOCK_LEN)); else -- To view, visit https://gerrit.osmocom.org/2821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Gerrit-PatchSet: 4 Gerrit-Project: openbsc 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 Thu Jun 15 11:51:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 11:51:22 +0000 Subject: [PATCH] osmo-bts[master]: RSL: receive and send multiple SI2q 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/2824 to look at the new patch set (#2). RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Related: OS#1660 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 49 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/2824/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index 0f2b671..9cb3f7c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -292,36 +292,43 @@ 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_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + switch (osmo_si) { + case SYSINFO_TYPE_2quater: + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + 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); + break; + case SYSINFO_TYPE_3: + if (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; + } /* intentional fall-through to copy SI3 data */ + default: + 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); + LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n", + get_value_string(osmo_sitype_strs, osmo_si), len); } } else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/2824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 12:12:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 12:12:14 +0000 Subject: openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 12:13:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 12:13:13 +0000 Subject: osmo-bts[master]: Extend Get Attribute responder In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 9 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 Thu Jun 15 12:13:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 12:13:29 +0000 Subject: osmo-bts[master]: Set and report BTS features In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Gerrit-PatchSet: 7 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 Thu Jun 15 12:55:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 12:55:16 +0000 Subject: [MERGED] osmo-bts[master]: Set and report BTS features In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Set and report BTS features ...................................................................... Set and report BTS features Set (possibly incomplete) list of BTS model-specific features and report them in response to attribute request via OML. Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Related: OS#1614 --- M src/common/oml.c M src/osmo-bts-litecell15/main.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/main.c M src/osmo-bts-trx/main.c 5 files changed, 24 insertions(+), 0 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 f97823d..982713e 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -163,6 +163,12 @@ abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } +/* Add BTS features as 3GPP TS 52.021 ?9.4.30 Manufacturer Id */ +static inline void add_bts_feat(struct msgb *msg, const struct gsm_bts *bts) +{ + msgb_tl16v_put(msg, NM_ATT_MANUF_ID, _NUM_BTS_FEAT/8 + 1, bts->_features_data); +} + static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) { const struct phy_instance *pinst = trx_phy_instance(trx); @@ -236,6 +242,9 @@ case NM_ATT_SW_CONFIG: add_bts_attrs(attr_buf, bts); break; + case NM_ATT_MANUF_ID: + add_bts_feat(attr_buf, bts); + break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS.\n", i, get_value_string(abis_nm_att_names, attr[i])); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ab13981..97b5359 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -91,6 +91,10 @@ exit(23); } + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP); + bts_model_vty_init(bts); return 0; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 042ecc3..85b5a86 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -782,6 +782,9 @@ /* FIXME: what is the nominal transmit power of the PHY/board? */ bts->c0->nominal_power = 15; + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + bts_model_vty_init(bts); return 0; diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index 547d084..a8b7b50 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -78,6 +78,11 @@ exit(23); } + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_EGPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + gsm_bts_set_feature(bts, BTS_FEAT_AGCH_PCH_PROP); + bts_model_vty_init(bts); return 0; diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index b2cbb39..da3dc60 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -106,6 +106,9 @@ * value */ bts->c0->nominal_power = 23; + gsm_bts_set_feature(bts, BTS_FEAT_GPRS); + gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); + bts_model_vty_init(bts); return 0; -- To view, visit https://gerrit.osmocom.org/2799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Gerrit-PatchSet: 8 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 Thu Jun 15 12:55:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 12:55:17 +0000 Subject: [MERGED] osmo-bts[master]: Extend Get Attribute responder In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Extend Get Attribute responder ...................................................................... Extend Get Attribute responder * detect if attributes are requested for BTS or TRX and act accordingly * report TRX phy version Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Related: OS#1614 --- M src/common/oml.c 1 file changed, 87 insertions(+), 45 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 9dddf57..f97823d 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include #include #include +#include static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg); @@ -153,70 +154,101 @@ return mo_buf; } -static inline struct msgb *add_bts_attr(const struct gsm_bts *bts) +static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - struct msgb *a = oml_msgb_alloc(); - - if (!a) - return NULL; - - abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); - abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + abis_nm_put_sw_file(msg, btstype2str(GSM_BTS_TYPE_OSMOBTS), PACKAGE_VERSION, true); + abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); if (strlen(bts->sub_model)) - abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); - - return a; + abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); } -static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len, uint8_t *out) +static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +{ + const struct phy_instance *pinst = trx_phy_instance(trx); + + abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), strlen(pinst->version) ? pinst->version : "Unknown", + true); +} + +/* The number of attributes in ?9.4.26 List of Required Attributes is 2 bytes, + but the Count of not-reported attributes from ?9.4.64 is 1 byte */ +static inline uint8_t pack_num_unreported_attr(uint16_t attrs) +{ + if (attrs > 255) { + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes, Count of not-reported attributes is too big: %u\n", + attrs); + return 255; + } + return attrs; /* Return number of unhandled attributes */ +} + +/* copy all the attributes accumulated in msg to out and return the total length of out buffer */ +static inline int cleanup_attr_msg(uint8_t *out, int out_offset, struct msgb *msg) +{ + int len = 0; + + out[0] = pack_num_unreported_attr(out_offset - 1); + + if (msg) { + memcpy(out + out_offset, msgb_data(msg), msg->len); + len = msg->len; + msgb_free(msg); + } + + return len + out_offset + 1; +} + +static inline int handle_attrs_trx(uint8_t *out, struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *ba = NULL; - int length; + struct msgb *attr_buf = oml_msgb_alloc(); + + if (!attr_buf) + return -ENOMEM; for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: - switch (mo->obj_class) { - case NM_OC_BTS: - ba = add_bts_attr(mo->bts); - break; - default: - LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, mo->obj_class)); - return -EINVAL; - } + add_trx_attr(attr_buf, trx); break; default: - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported.\n", i, + 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]; + out[attr_out_index] = attr[i]; /* assemble values of supported attributes and list of unsupported ones */ attr_out_index++; } } - if (attr_out_index - 1 > 255) { /* The number of attributes in ?9.4.26 List of Required Attributes is 2 bytes, - but the Count of not-reported attributes from ?9.4.64 is 1 byte */ - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes, Count of not-reported attributes is too big: %u\n", - attr_out_index - 1); - out[0] = 255; - } else - out[0] = attr_out_index - 1; /* Count number of unhandled attributes */ + return cleanup_attr_msg(out, attr_out_index, attr_buf); +} - length = attr_out_index + 1; +static inline int handle_attrs_bts(uint8_t *out, const struct gsm_bts *bts, const uint8_t *attr, uint16_t attr_len) +{ + uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ + struct msgb *attr_buf = oml_msgb_alloc(); - if (ba) { - memcpy(out + attr_out_index, msgb_data(ba), ba->len); - length += ba->len; - msgb_free(ba); + if (!attr_buf) + return -ENOMEM; + + for (i = 0; i < attr_len; i++) { + switch (attr[i]) { + case NM_ATT_SW_CONFIG: + add_bts_attrs(attr_buf, bts); + break; + default: + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS.\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 */ + attr_out_index++; + } } - return length; + return cleanup_attr_msg(out, attr_out_index, attr_buf); } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ @@ -227,7 +259,19 @@ if (!nmsg) return -ENOMEM; - len = handle_attr(mo, attr, attr_len, resp); + switch (mo->obj_class) { + case NM_OC_BTS: + len = handle_attrs_bts(resp, bts, attr, attr_len); + break; + case NM_OC_BASEB_TRANSC: + len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr), attr, attr_len); + break; + default: + LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", + get_value_string(abis_nm_obj_class_names, mo->obj_class)); + len = -EINVAL; + } + if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); msgb_free(nmsg); @@ -467,13 +511,11 @@ { struct abis_om_fom_hdr *foh = msgb_l3(msg); struct tlv_parsed tp; - struct gsm_abis_mo *mo; int rc; - if (!foh) + if (!foh || !bts) return -EINVAL; - mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx GET ATTR\n"); @@ -483,13 +525,13 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - if (!TLVP_PRESENT(&tp, NM_ATT_LIST_REQ_ATTR)) { + if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) { LOGP(DOML, LOGL_ERROR, "O&M Get Attributes message without Attribute List?!\n"); oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, &bts->mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/2786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32 Gerrit-PatchSet: 10 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 Thu Jun 15 13:12:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 13:12:40 +0000 Subject: [PATCH] openbsc[master]: bsc_init: Forget which SIs are valid for the trx 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/2819 to look at the new patch set (#6). bsc_init: Forget which SIs are valid for the trx Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/2819/6 diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index e61d4ea..400e09f 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -25,7 +25,7 @@ #include #include #include - +#include #include struct gsm_bts; @@ -35,8 +35,7 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len); +int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr, diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 7ee19a7..6ae790f 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -226,11 +226,16 @@ /* Send a BCCH_INFO message as per Chapter 8.5.1 */ -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len) +int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len) { struct abis_rsl_dchan_hdr *dh; + const struct gsm_bts *bts = trx->bts; struct msgb *msg = rsl_msgb_alloc(); + uint8_t type = osmo_sitype2rsl(si_type); + + if (bts->c0 != trx) + LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS%u/TRX%u\n", + get_value_string(osmo_sitype_strs, si_type), bts->nr, trx->nr); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof*dh); init_dchan_hdr(dh, RSL_MT_BCCH_INFO); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 25f3fdc..ed37519 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -115,8 +115,7 @@ GSM_BTS_SI(bts, i), si_len); break; default: - rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); break; } @@ -135,6 +134,9 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; + /* Zero, forget the state of the SIs */ + bts->si_valid = 0; + /* First, we determine which of the SI messages we actually need */ if (trx == bts->c0) { -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 13:19:14 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 15 Jun 2017 13:19:14 +0000 Subject: [PATCH] libosmocore[master]: vty: additional nodes for sccp-address configuration Message-ID: Review at https://gerrit.osmocom.org/2922 vty: additional nodes for sccp-address configuration The planned sccp-addressbook implementation in libosmo-sccp requires to additional VTY nodes. Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 --- M TODO-RELEASE M include/osmocom/vty/command.h 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/2922/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index a23fcea..1964cff 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,4 @@ 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 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index b39bbf7..62989c1 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -92,13 +92,13 @@ L_CS7_RTABLE_NODE, /*!< \brief SS7 Routing Table */ L_CS7_LINK_NODE, /*!< \brief SS7 Link */ L_CS7_LINKSET_NODE, /*!< \brief SS7 Linkset */ + L_CS7_SCCPADDR_NODE, /*!< \brief SS7 SCCP Address */ + L_CS7_SCCPADDR_GT_NODE, /*!< \brief SS7 SCCP Global Title */ /* * When adding new nodes to the libosmocore project, these nodes can be * used to avoid ABI changes for unrelated projects. */ - RESERVED1_NODE, /*!< \brief Reserved for later extensions */ - RESERVED2_NODE, /*!< \brief Reserved for later extensions */ RESERVED3_NODE, /*!< \brief Reserved for later extensions */ _LAST_OSMOVTY_NODE -- To view, visit https://gerrit.osmocom.org/2922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 15 13:20:41 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 15 Jun 2017 13:20:41 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: fix typo Message-ID: Review at https://gerrit.osmocom.org/2923 cosmetic: fix typo Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c --- M src/osmo_ss7_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/23/2923/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 0ff9e76..97b5cf0 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -262,7 +262,7 @@ "Point Code Length\n" "Specify Destination Linkset\n" "Linkset Name\n" - "Specity Priority\n" + "Specify Priority\n" "Priority\n" "Specify QoS Class\n" "QoS Class\n" -- To view, visit https://gerrit.osmocom.org/2923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 15 13:20:41 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 15 Jun 2017 13:20:41 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses Message-ID: Review at https://gerrit.osmocom.org/2924 sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTX function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 535 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..f948727 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,8 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr_list *osmo_sccp_addr_by_name(const char *name, + struct osmo_ss7_instance + *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..d584a44 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,486 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_list { + struct llist_head list; + struct osmo_ss7_instance *inst; + char *name; + struct osmo_sccp_addr *addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr_list *osmo_sccp_addr_by_name(const char *name, + struct osmo_ss7_instance + *ss7) +{ + struct osmo_sccp_addr_list *addr; + llist_for_each_entry(addr, &ss7->cfg.sccp_address_book, list) { + if (strcmp(addr->name, name) == 0) + return addr; + } + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_list *addr; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(addr, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", addr->name, VTY_NEWLINE); + switch (addr->addr->ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (addr->addr->presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(addr->inst, + addr->addr->pc), + VTY_NEWLINE); + if (addr->addr->presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", addr->addr->ssn, + VTY_NEWLINE); + if (addr->addr->presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + addr->addr->gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + addr->addr->gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + addr->addr->gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + addr->addr->gt.nai, VTY_NEWLINE); + if (strlen(addr->addr->gt.digits)) + vty_out(vty, " digits %s%s", + addr->addr->gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_list *addr; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(addr, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", addr->name); + + /* RI */ + switch (addr->addr->ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(addr->inst, + addr->addr->pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", addr->addr->ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &addr->addr->ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (addr->addr->presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &addr->addr->ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", addr->addr->gt.gti); + vty_out(vty, "TT:%u ", addr->addr->gt.tt); + vty_out(vty, "NPI:%u ", addr->addr->gt.npi); + vty_out(vty, "NAI:%u ", addr->addr->gt.nai); + if (strlen(addr->addr->gt.digits)) + vty_out(vty, "%s ", addr->addr->gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address .NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_list *addr; + const char *name = argv[0]; + + addr = osmo_sccp_addr_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!addr) { + addr = talloc_zero(inst, struct osmo_sccp_addr_list); + addr->name = talloc_strdup(addr, name); + addr->addr = talloc_zero(addr, struct osmo_sccp_addr); + llist_add_tail(&addr->list, &inst->cfg.sccp_address_book); + addr->addr->ri = OSMO_SCCP_RI_SSN_PC; + } + + addr->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = addr; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address .NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_list *addr; + const char *name = argv[0]; + + addr = osmo_sccp_addr_by_name(name, inst); + if (addr) { + llist_del(&addr->list); + talloc_free(addr); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + switch (argv[0][0]) { + case 'G': + addr->addr->ri = OSMO_SCCP_RI_GT; + break; + case 'P': + addr->addr->ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + addr->addr->ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence |= OSMO_SCCP_ADDR_T_PC; + addr->addr->pc = osmo_ss7_pointcode_parse(addr->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_PC; + addr->addr->pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence |= OSMO_SCCP_ADDR_T_SSN; + addr->addr->ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_SSN; + addr->addr->ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + unsigned int rc; + OSMO_ASSERT(addr); + + addr->addr->presence |= OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + rc = inet_pton(AF_INET, argv[1], &addr->addr->ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + unsigned int rc; + OSMO_ASSERT(addr); + + addr->addr->presence |= OSMO_SCCP_ADDR_T_IPv6; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + rc = inet_pton(AF_INET6, argv[1], &addr->addr->ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + addr->addr->presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_GT; + memset(&addr->addr->gt, 0, sizeof(addr->addr->gt)); + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-255>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-4294967295>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-4294967295>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits .DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + + if (strlen(argv[0]) > sizeof(addr->addr->gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(addr->addr->gt.digits, 0, sizeof(addr->addr->gt.digits)); + strcpy(addr->addr->gt.digits, argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1425,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1437,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_list *addr; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1461,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + addr = vty->index; + vty->node = L_CS7_NODE; + vty->index = addr->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1485,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1559,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 15 13:22:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 13:22:12 +0000 Subject: [MERGED] osmo-bts[master]: Cleanup SI scheduling In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Cleanup SI scheduling ...................................................................... Cleanup SI scheduling * use GSM_BTS_HAS_SI() from OpenBSC instead of local copy * arrange GSM_BTS_HAS_SI() checks to improve readability * constify SI scheduler parameters Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 Related: OS#1660 --- M include/osmo-bts/bts.h M src/common/sysinfo.c 2 files changed, 13 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 567772e..9e16e05 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -31,7 +31,7 @@ int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, int is_ag_res); -uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time); +uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time); uint8_t *lchan_sacch_get(struct gsm_lchan *lchan); int lchan_init_lapdm(struct gsm_lchan *lchan); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index d8671c8..7a53627 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,10 +25,8 @@ #include #include -#define BTS_HAS_SI(bts, sinum) ((bts)->si_valid & (1 << sinum)) - /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ -uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time) +uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { struct gsm_bts_role_bts *btsb = bts_role_bts(bts); unsigned int tc4_cnt = 0; @@ -77,22 +75,20 @@ /* iterate over 2ter, 2quater, 9, 13 */ /* determine how many SI we need to send on TC=4, * and which of them we send when */ - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && - BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_2ter; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && - (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) || - BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && + (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) || GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter))) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_2quater; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_13)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) { tc4_sub[tc4_cnt] = SYSINFO_TYPE_13; tc4_cnt += 1; } - if (BTS_HAS_SI(bts, SYSINFO_TYPE_9)) { + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_9)) { /* FIXME: check SI3 scheduling info! */ tc4_sub[tc4_cnt] = SYSINFO_TYPE_9; tc4_cnt += 1; @@ -107,21 +103,17 @@ } case 5: /* 2bis, 2ter, 2quater */ - if (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2ter); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2bis); - else if (BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && - !BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) + else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && + !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); break; case 6: @@ -137,7 +129,7 @@ { struct gsm_bts *b = trx->bts; struct gsm48_system_information_type_3 *si3; - if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) { + if (GSM_BTS_HAS_SI(b, SYSINFO_TYPE_3)) { si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3); return si3->control_channel_desc.bs_ag_blks_res; } -- To view, visit https://gerrit.osmocom.org/2822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2 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 Thu Jun 15 13:45:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 13:45:01 +0000 Subject: [PATCH] openbsc[master]: Update SI data structures and generation 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/2832 to look at the new patch set (#5). Update SI data structures and generation To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660 --- M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/include/openbsc/system_information.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.c M openbsc/tests/gsm0408/gsm0408_test.ok 9 files changed, 353 insertions(+), 164 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/32/2832/5 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 05d834e..5ab7c3f 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -29,6 +29,13 @@ #define tmsi_from_string(str) strtoul(str, NULL, 10) +/* 3-bit long values */ +#define EARFCN_PRIO_INVALID 8 +#define EARFCN_MEAS_BW_INVALID 8 +/* 5-bit long values */ +#define EARFCN_QRXLV_INVALID 32 +#define EARFCN_THRESH_LOW_INVALID 32 + enum gsm_security_event { GSM_SECURITY_NOAVAIL, GSM_SECURITY_AUTH_FAILED, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index a507606..d3fd757 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -26,7 +26,8 @@ #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 4-bit index is used (2#1111 = 10#15) */ +/* 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 @@ -301,8 +302,9 @@ /* 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 */ - sysinfo_buf_t buf[_MAX_SYSINFO_TYPE]; + /* 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; @@ -491,10 +493,10 @@ struct gsm_bts_trx_ts ts[TRX_NR_TS]; }; -#define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater]) +#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]) -#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[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, @@ -739,7 +741,7 @@ 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]; + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; /* offsets used while generating SI2quater */ size_t e_offset; size_t u_offset; diff --git a/openbsc/include/openbsc/system_information.h b/openbsc/include/openbsc/system_information.h index 21016b8..71bea26 100644 --- a/openbsc/include/openbsc/system_information.h +++ b/openbsc/include/openbsc/system_information.h @@ -14,6 +14,8 @@ int range_encode(enum gsm48_range r, int *arfcns, int arfcns_used, int *w, int f0, uint8_t *chan_list); uint8_t si2q_num(struct gsm_bts *bts); +int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, + uint8_t qrx, uint8_t meas_bw); int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble); int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ed37519..ec87a7b 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -101,7 +101,7 @@ static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) { struct gsm_bts *bts = trx->bts; - int rc; + int rc, j; DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); @@ -114,6 +114,10 @@ rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), GSM_BTS_SI(bts, i), si_len); break; + case SYSINFO_TYPE_2quater: + for (j = 0; j <= bts->si2q_count; j++) + rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); + break; default: rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); break; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index b05d3d9..2fc39ab 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -2774,6 +2774,7 @@ return CMD_SUCCESS; } +/* help text should be kept in sync with EARFCN_*_INVALID defines */ DEFUN(cfg_bts_si2quater_neigh_add, cfg_bts_si2quater_neigh_add_cmd, "si2quater neighbor-list add earfcn <0-65535> thresh-hi <0-31> " "thresh-lo <0-32> prio <0-8> qrxlv <0-32> meas <0-8>", @@ -2791,54 +2792,37 @@ uint16_t arfcn = atoi(argv[0]); uint8_t thresh_hi = atoi(argv[1]), thresh_lo = atoi(argv[2]), prio = atoi(argv[3]), qrx = atoi(argv[4]), meas = atoi(argv[5]); - int r = osmo_earfcn_add(e, arfcn, - (meas < 8) ? meas : OSMO_EARFCN_MEAS_INVALID); + int r = bts_earfcn_add(bts, arfcn, thresh_hi, thresh_lo, prio, qrx, meas); - if (r < 0) { - vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), - VTY_NEWLINE); - return CMD_WARNING; + switch (r) { + case 1: + vty_out(vty, "Warning: multiple threshold-high are not supported, overriding with %u%s", + thresh_hi, VTY_NEWLINE); + break; + case EARFCN_THRESH_LOW_INVALID: + vty_out(vty, "Warning: multiple threshold-low are not supported, overriding with %u%s", + thresh_lo, VTY_NEWLINE); + break; + case EARFCN_QRXLV_INVALID + 1: + vty_out(vty, "Warning: multiple QRXLEVMIN are not supported, overriding with %u%s", + qrx, VTY_NEWLINE); + break; + case EARFCN_PRIO_INVALID: + vty_out(vty, "Warning: multiple priorities are not supported, overriding with %u%s", + prio, VTY_NEWLINE); + break; + default: + if (r < 0) { + vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), VTY_NEWLINE); + return CMD_WARNING; + } } - if (e->thresh_hi && thresh_hi != e->thresh_hi) - vty_out(vty, "Warning: multiple threshold-high are not " - "supported, overriding previous threshold %u%s", - e->thresh_hi, VTY_NEWLINE); - - e->thresh_hi = thresh_hi; - - if (thresh_lo != 32) { - if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) - vty_out(vty, "Warning: multiple threshold-low are not " - "supported, overriding previous threshold %u%s", - e->thresh_lo, VTY_NEWLINE); - e->thresh_lo = thresh_lo; - e->thresh_lo_valid = true; - } - - if (qrx != 32) { - if (e->qrxlm_valid && e->qrxlm != qrx) - vty_out(vty, "Warning: multiple QRXLEVMIN are not " - "supported, overriding previous value %u%s", - e->qrxlm, VTY_NEWLINE); - e->qrxlm = qrx; - e->qrxlm_valid = true; - } - - if (prio != 8) { - if (e->prio_valid && e->prio != prio) - vty_out(vty, "Warning: multiple priorities are not " - "supported, overriding previous value %u%s", - e->prio, VTY_NEWLINE); - e->prio = prio; - e->prio_valid = true; - } - - if (si2q_num(bts) < 2) /* FIXME: use SI2Q_MAX_NUM */ + if (si2q_num(bts) <= SI2Q_MAX_NUM) return CMD_SUCCESS; vty_out(vty, "Warning: not enough space in SI2quater (%u/%u used) for a given EARFCN %u%s", - bts->si2q_count, 2, arfcn, VTY_NEWLINE); /* FIXME: use SI2Q_MAX_NUM */ + bts->si2q_count, SI2Q_MAX_NUM, arfcn, VTY_NEWLINE); osmo_earfcn_del(e, arfcn); return CMD_WARNING; @@ -2877,16 +2861,14 @@ switch(bts_uarfcn_add(bts, arfcn, scramble, atoi(argv[2]))) { case -ENOMEM: - vty_out(vty, "Unable to add arfcn: max number of UARFCNs (%u) " - "reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); + vty_out(vty, "Unable to add UARFCN: max number of UARFCNs (%u) reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); return CMD_WARNING; case -ENOSPC: - vty_out(vty, "Warning: not enough space in si2quater for a " - "given arfcn%s", VTY_NEWLINE); + vty_out(vty, "Warning: not enough space in SI2quater for a given UARFCN (%u, %u)%s", + arfcn, scramble, VTY_NEWLINE); return CMD_WARNING; case -EADDRINUSE: - vty_out(vty, "Unable to add arfcn: (%u, %u) is already added%s", - arfcn, scramble, VTY_NEWLINE); + vty_out(vty, "Unable to add UARFCN: (%u, %u) is already added%s", arfcn, scramble, VTY_NEWLINE); return CMD_WARNING; } diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index a6fdf46..fdab70a 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -65,6 +65,12 @@ 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 */ + + if (budget <= 6) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + /* first we have to properly adjust budget requirements */ if (e->prio_valid) /* E-UTRAN_PRIORITY: 3GPP TS 45.008*/ rem -= 4; @@ -87,16 +93,17 @@ if (skip < offset) { skip++; /* ignore EARFCNs added on previous calls */ } else { - earfcn_budget = 17; /* computer budget per-EARFCN */ + earfcn_budget = 17; /* compute budget per-EARFCN */ if (OSMO_EARFCN_MEAS_INVALID == e->meas_bw[i]) earfcn_budget++; else earfcn_budget += 4; - if (rem - earfcn_budget < 0) { + if (rem - earfcn_budget < 0) break; - } else { + else { bts->e_offset++; + rem -= earfcn_budget; bitvec_set_bit(bv, 1); /* EARFCN: */ bitvec_set_uint(bv, e->arfcn[i], 16); @@ -143,6 +150,12 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { + int rem = budget - 25; + if (rem <= 0) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + /* Additions in Rel-5: */ bitvec_set_bit(bv, H); /* No 3G Additional Measurement Param. Descr. */ @@ -191,7 +204,7 @@ 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, budget - 25); + append_eutran_neib_cell(bv, bts, rem); /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ bitvec_set_bit(bv, 0); @@ -267,7 +280,12 @@ 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]; uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ - uint8_t rem = budget - 7; /* account for constant bits right away */ + uint8_t rem = budget - 7, offset_diff; /* account for constant bits right away */ + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + + if (budget <= 7) + return -ENOMEM; /* 3G Neighbour Cell Description */ bitvec_set_bit(bv, 1); @@ -282,20 +300,22 @@ bitvec_set_bit(bv, 0); for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - for (j = st, k = 0; j < i; j++) + offset_diff = 0; + for (j = st, k = 0; j < i; j++) { a[k++] = sc[j]; /* copy corresponding SCs */ - + offset_diff++; /* compute proper offset step */ + } 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; } - if (rem - rc < 0) { + if (rem - rc <= 0) break; /* we have ran out of budget in current SI2q */ - } else { + else { rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset++; + bts->u_offset += offset_diff; } cu = u[i]; st = i; /* update start position */ @@ -303,9 +323,11 @@ } if (rem > 22) { /* add last UARFCN not covered by previous cycle if it could possibly fit into budget */ - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++) + 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; @@ -313,7 +335,7 @@ if (rem - rc >= 0) { rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset++; + bts->u_offset += offset_diff; } } @@ -331,6 +353,10 @@ { int rc; struct bitvec bv; + + if (bts->si2q_count < bts->si2q_index) + return -EINVAL; + bv.data = data; bv.data_len = 20; bitvec_zero(&bv); @@ -362,34 +388,28 @@ /* No extension (length) */ bitvec_set_bit(&bv, 0); - if (bts->si_common.uarfcn_length) { - /* Even if we do not append EARFCN we still need to set 3 bits */ - rc = append_uarfcns(&bv, bts, SI2Q_MAX_LEN - (bv.cur_bit + 3)); + 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: failed to append %zu UARFCNs due to range encoding failure: %s\n", - bts->si_common.uarfcn_length, strerror(-rc)); + 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 */ + } else /* No 3G Neighbour Cell Description */ bitvec_set_bit(&bv, 0); - } /* No 3G Measurement Parameters Description */ bitvec_set_bit(&bv, 0); /* No GPRS_3G_MEASUREMENT Parameters Descr. */ bitvec_set_bit(&bv, 0); - if (si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) { - append_earfcn(&bv, bts, SI2Q_MAX_LEN - bv.cur_bit); - - /* FIXME: remove following check once multiple SI2q are properly supported */ - if ((bts->e_offset != si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) || - si2q_earfcn_count(&bts->si_common.si2quater_neigh_list) > 5) - return -ENOMEM; - } else { - /* No Additions in Rel-5: */ + rc = SI2Q_MAX_LEN - bv.cur_bit; + if (rc > 0 && si2q_earfcn_count(&bts->si_common.si2quater_neigh_list) - bts->e_offset > 0) + append_earfcn(&bv, bts, rc); + else /* No Additions in Rel-5: */ bitvec_set_bit(&bv, L); - } bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); return bv.data_len; diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index a074a78..dcabbbd 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -122,50 +122,73 @@ } } -static inline unsigned earfcn_size(const struct gsm_bts *bts) +size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) { - const struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; /* EARFCN */ + unsigned i, ret = 0; - /* account for all the constant bits in append_earfcn() */ - return 25 + osmo_earfcn_bit_size_ext(e, bts->e_offset); + if (!e) + return 0; + + for (i = 0; i < e->length; i++) + if (e->arfcn[i] != OSMO_EARFCN_INVALID) + ret++; + + return ret; } -static inline unsigned uarfcn_size(const struct gsm_bts *bts) +/* generate SI2quater messages, return rest octets length of last generated message or negative error code */ +static int make_si2quaters(struct gsm_bts *bts, bool counting) { - const uint16_t *u = bts->si_common.data.uarfcn_list; - uint16_t cu = u[bts->u_offset]; /* UARFCN */ - /* account for all the constant bits in append_uarfcns() */ - unsigned s = 7, append = 22, r = 0, i, st = 0, j, k; + int rc; + bool memory_exceeded = true; + struct gsm48_system_information_type_2quater *si2q; - for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - for (j = st, k = 0; j < i; j++, k++); - if (u[i] != cu) { /* we've reached new UARFCN */ - r += (append + range1024_p(k)); - cu = u[i]; - st = i; /* update start position */ + for (bts->si2q_index = 0; bts->si2q_index < SI2Q_MAX_NUM; bts->si2q_index++) { + si2q = GSM_BTS_SI2Q(bts, bts->si2q_index); + if (counting) { /* that's legitimate if we're called for counting purpose: */ + if (bts->si2q_count < bts->si2q_index) + bts->si2q_count = bts->si2q_index; + } else { + memset(si2q, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + + si2q->header.l2_plen = GSM48_LEN2PLEN(22); + si2q->header.rr_protocol_discriminator = GSM48_PDISC_RR; + si2q->header.skip_indicator = 0; + si2q->header.system_information = GSM48_MT_RR_SYSINFO_2quater; + } + + rc = rest_octets_si2quater(si2q->rest_octets, bts); + if (rc < 0) + return rc; + + if (bts->u_offset >= bts->si_common.uarfcn_length && + bts->e_offset >= si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) { + memory_exceeded = false; + break; } } - /* add last UARFCN not covered by previous cycle */ - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++, k++); + if (memory_exceeded) + return -ENOMEM; - return s + r + append + range1024_p(k); + return rc; } +/* we generate SI2q rest octets twice to get proper estimation but it's one time cost anyway */ uint8_t si2q_num(struct gsm_bts *bts) { - size_t est, e_sz = 1, u_sz = 1; + int rc = make_si2quaters(bts, true); + uint8_t num = bts->si2q_index + 1; /* number of SI2quater messages */ - if (&bts->si_common.si2quater_neigh_list) /* EARFCN */ - e_sz = earfcn_size(bts); + /* N. B: si2q_num() should NEVER be called during actualSI2q rest octets generation + we're not re-entrant because of the following code: */ + bts->u_offset = 0; + bts->e_offset = 0; - if (bts->si_common.uarfcn_length) /* UARFCN */ - u_sz = uarfcn_size(bts); + if (rc < 0) + return 0xFF; /* return impossible index as an indicator of error in generating SI2quater */ - /* 2 bits are used in between UARFCN and EARFCN structs */ - est = 1 + (e_sz + u_sz) / (SI2Q_MAX_LEN - (SI2Q_MIN_LEN + 2)); - - return est; + return num; } /* 3GPP TS 44.018, Table 9.1.54.1 - prepend diversity bit to scrambling code */ @@ -174,6 +197,44 @@ if (diversity) return scramble | (1 << 9); return scramble; +} + +int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, + uint8_t qrx, uint8_t meas_bw) +{ + struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; + int r = osmo_earfcn_add(e, earfcn, (meas_bw < EARFCN_MEAS_BW_INVALID) ? meas_bw : OSMO_EARFCN_MEAS_INVALID); + + if (r < 0) + return r; + + if (e->thresh_hi && thresh_hi != e->thresh_hi) + r = 1; + + e->thresh_hi = thresh_hi; + + if (thresh_lo != EARFCN_THRESH_LOW_INVALID) { + if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) + r = EARFCN_THRESH_LOW_INVALID; + e->thresh_lo = thresh_lo; + e->thresh_lo_valid = true; + } + + if (qrx != EARFCN_QRXLV_INVALID) { + if (e->qrxlm_valid && e->qrxlm != qrx) + r = EARFCN_QRXLV_INVALID + 1; + e->qrxlm = qrx; + e->qrxlm_valid = true; + } + + if (prio != EARFCN_PRIO_INVALID) { + if (e->prio_valid && e->prio != prio) + r = EARFCN_PRIO_INVALID; + e->prio = prio; + e->prio_valid = true; + } + + return r; } int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble) @@ -237,8 +298,10 @@ scl[k] = scr; bts->si_common.uarfcn_length++; - if (si2q_num(bts) < 2) /* FIXME: use SI2Q_MAX_NUM */ + if (si2q_num(bts) <= SI2Q_MAX_NUM) { + bts->si2q_count = si2q_num(bts) - 1; return 0; + } bts_uarfcn_del(bts, arfcn, scramble); return -ENOSPC; @@ -689,39 +752,26 @@ return false; } -size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) -{ - unsigned i, ret = 0; - - if (!e) - return 0; - - for (i = 0; i < e->length; i++) - if (e->arfcn[i] != OSMO_EARFCN_INVALID) - ret++; - - return ret; -} - static int generate_si2quater(enum osmo_sysinfo_type t, struct gsm_bts *bts) { int rc; - struct gsm48_system_information_type_2quater *si2q = GSM_BTS_SI2Q(bts); + struct gsm48_system_information_type_2quater *si2q; if (si2quater_not_needed(bts)) /* generate rest_octets for SI2q only when necessary */ return GSM_MACBLOCK_LEN; - memset(si2q, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + bts->u_offset = 0; + bts->e_offset = 0; + bts->si2q_index = 0; + bts->si2q_count = si2q_num(bts) - 1; - si2q->header.l2_plen = GSM48_LEN2PLEN(22); - si2q->header.rr_protocol_discriminator = GSM48_PDISC_RR; - si2q->header.skip_indicator = 0; - si2q->header.system_information = GSM48_MT_RR_SYSINFO_2quater; - - rc = rest_octets_si2quater(si2q->rest_octets, bts); + rc = make_si2quaters(bts, false); if (rc < 0) return rc; + OSMO_ASSERT(bts->si2q_count == bts->si2q_index); + OSMO_ASSERT(bts->si2q_count <= SI2Q_MAX_NUM); + return sizeof(*si2q) + rc; } diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a78505..5a8c6ca 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -89,25 +89,19 @@ { int r; - bts->u_offset = 0; - bts->e_offset = 0; - bts->si2q_index = 0; - bts->si2q_count = 0; bts->si_valid = 0; bts->si_valid |= (1 << SYSINFO_TYPE_2quater); - - /* should be no-op as entire buffer is filled with padding: */ - memset(GSM_BTS_SI(bts, SYSINFO_TYPE_2quater), 0xAE, GSM_MACBLOCK_LEN); printf("generating SI2quater for %zu EARFCNs and %zu UARFCNs...\n", si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); if (r > 0) - printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", - GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", - bts->si2q_index, bts->si2q_count, r, - osmo_hexdump((void *)GSM_BTS_SI2Q(bts), GSM_MACBLOCK_LEN)); + for (bts->si2q_index = 0; bts->si2q_index < bts->si2q_count + 1; bts->si2q_index++) + printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", + GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", + bts->si2q_index, bts->si2q_count, r, + osmo_hexdump((void *)GSM_BTS_SI2Q(bts, bts->si2q_index), GSM_MACBLOCK_LEN)); else printf("%s() failed to generate SI2quater: %s\n", s, strerror(-r)); } @@ -145,8 +139,10 @@ r = bts_uarfcn_add(bts, arfcn, scramble, diversity); if (r < 0) printf("failed to add UARFCN to SI2quater: %s\n", strerror(-r)); - else + else { + bts->si2q_count = si2q_num(bts) - 1; gen(bts, __func__); + } } static inline void test_si2q_segfault(void) @@ -181,7 +177,6 @@ _bts_uarfcn_add(bts, 10613, 64, 0); _bts_uarfcn_add(bts, 10613, 164, 0); _bts_uarfcn_add(bts, 10613, 14, 0); - gen(bts, __func__); } static inline void test_si2q_u(void) @@ -192,10 +187,12 @@ if (!network) exit(1); + bts = gsm_bts_alloc(network); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); + /* subsequent calls should produce valid SI if there's enough memory */ _bts_uarfcn_add(bts, 1982, 13, 1); _bts_uarfcn_add(bts, 1982, 44, 0); @@ -208,7 +205,6 @@ _bts_uarfcn_add(bts, 1982, 223, 1); _bts_uarfcn_add(bts, 1982, 14, 0); _bts_uarfcn_add(bts, 1982, 88, 0); - gen(bts, __func__); } static inline void test_si2q_e(void) @@ -219,6 +215,7 @@ if (!network) exit(1); + bts = gsm_bts_alloc(network); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; @@ -227,8 +224,10 @@ bts->si_common.si2quater_neigh_list.thresh_hi = 5; osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); + /* first generate invalid SI as no EARFCN added */ gen(bts, __func__); + /* subsequent calls should produce valid SI if there's enough memory and EARFCNs */ add_earfcn_b(bts, 1917, 5); del_earfcn_b(bts, 1917); @@ -239,6 +238,54 @@ add_earfcn_b(bts, 1965, OSMO_EARFCN_MEAS_INVALID); add_earfcn_b(bts, 1967, 4); add_earfcn_b(bts, 1982, 3); +} + +static inline void test_si2q_long(void) +{ + struct gsm_bts *bts; + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + printf("Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation:\n"); + + if (!network) + exit(1); + + bts = gsm_bts_alloc(network); + + bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; + bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; + bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; + bts->si_common.si2quater_neigh_list.thresh_hi = 5; + + osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); + + bts_earfcn_add(bts, 1922, 11, 22, 8,32, 8); + bts_earfcn_add(bts, 1922, 11, 22, 8, 32, 8); + bts_earfcn_add(bts, 1924, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 1923, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 1925, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2111, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2112, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2113, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2114, 11, 12, 6, 11, 2); + bts_earfcn_add(bts, 2131, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2132, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2133, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2134, 11, 12, 6, 11, 2); + bts_earfcn_add(bts, 2121, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2122, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2123, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2124, 11, 12, 6, 11, 2); + _bts_uarfcn_add(bts, 1976, 13, 1); + _bts_uarfcn_add(bts, 1976, 38, 1); + _bts_uarfcn_add(bts, 1976, 44, 1); + _bts_uarfcn_add(bts, 1976, 120, 1); + _bts_uarfcn_add(bts, 1976, 140, 1); + _bts_uarfcn_add(bts, 1976, 163, 1); + _bts_uarfcn_add(bts, 1976, 166, 1); + _bts_uarfcn_add(bts, 1976, 217, 1); + _bts_uarfcn_add(bts, 1976, 224, 1); + _bts_uarfcn_add(bts, 1976, 225, 1); + _bts_uarfcn_add(bts, 1976, 226, 1); } static void test_mi_functionality(void) @@ -642,6 +689,9 @@ test_si2q_e(); test_si2q_u(); test_si2q_mu(); + test_si2q_long(); + printf("Done.\n"); + return EXIT_SUCCESS; } diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index 5e0b9d5..d30f421 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -71,11 +71,11 @@ 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 Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 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 added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... @@ -87,12 +87,14 @@ 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 added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -add_earfcn_b() failed to generate SI2quater: Cannot allocate memory +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 added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -add_earfcn_b() failed to generate SI2quater: Cannot allocate memory +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 Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 generating SI2quater for 0 EARFCNs and 2 UARFCNs... @@ -111,10 +113,10 @@ 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 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 -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -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 +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 +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 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 @@ -124,9 +126,79 @@ 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 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 -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 Done. -- To view, visit https://gerrit.osmocom.org/2832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:19:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 14:19:03 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 11: Nevermind - if it's not meant to be run directly than there's no point in making it executable. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 11 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: blobb Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:36:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:36:19 +0000 Subject: openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Patch Set 6: are there any "SYSTEM INFORMATION" messages that we can set on non-BCCH TRXs anyway? The only SI sent on non-BCCH are those over the SACCH, and those are set by RSL SACCH FILLING, right? -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:36:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:36:54 +0000 Subject: openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:38:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:38:03 +0000 Subject: openbsc[master]: Update SI data structures and generation In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Gerrit-PatchSet: 5 Gerrit-Project: openbsc 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 Thu Jun 15 14:39:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:34 +0000 Subject: libosmocore[master]: vty/command.c: drop useless assignment In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Thu Jun 15 14:39:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:36 +0000 Subject: libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Thu Jun 15 14:39:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:38 +0000 Subject: [MERGED] libosmocore[master]: core/conv/viterbi.c: fix possible NULL-pointer reference In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: core/conv/viterbi.c: fix possible NULL-pointer reference ...................................................................... core/conv/viterbi.c: fix possible NULL-pointer reference Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 --- M src/viterbi.c 1 file changed, 16 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/viterbi.c b/src/viterbi.c index 854754c..308cfe0 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -394,12 +394,15 @@ int olen = (code->N == 2) ? 2 : 4; trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + if (!trellis) + goto fail; + trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs) + if (!trellis->sums || !trellis->outputs || !trellis->vals) goto fail; /* Populate the trellis state objects */ @@ -507,9 +510,13 @@ if (!dec) return; - vdec_free(dec->paths[0]); - free(dec->paths); free_trellis(dec->trellis); + + if (dec->paths != NULL) { + vdec_free(dec->paths[0]); + free(dec->paths); + } + free(dec); } @@ -572,7 +579,13 @@ goto fail; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + if (!dec->paths) + goto fail; + dec->paths[0] = vdec_malloc(ns * dec->len); + if (!dec->paths[0]) + goto fail; + for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; -- To view, visit https://gerrit.osmocom.org/2876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Thu Jun 15 14:39:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:40 +0000 Subject: [MERGED] libosmocore[master]: vty/command.c: drop useless assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty/command.c: drop useless assignment ...................................................................... vty/command.c: drop useless assignment Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7 --- 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 e50706e..0168462 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1655,7 +1655,7 @@ /* Make sure that cmd_vector is filtered based on current word */ command = vector_slot(vline, index); if (command) - match = cmd_filter(command, cmd_vector, index, any_match); + cmd_filter(command, cmd_vector, index, any_match); /* Make description vector. */ for (i = 0; i < vector_active(cmd_vector); i++) { -- To view, visit https://gerrit.osmocom.org/2880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:39:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:40 +0000 Subject: [MERGED] libosmocore[master]: ctrl_test.c: fix build with GCC 7.1.1 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ctrl_test.c: fix build with GCC 7.1.1 ...................................................................... ctrl_test.c: fix build with GCC 7.1.1 According to GCC's online docs: When an inline function is not static, then the compiler must assume that there may be calls from other source files; since a global symbol can be defined only once in any program, the function must not be defined in the other source files, so the calls therein cannot be integrated. Therefore, a non-static inline function is always compiled on its own in the usual fashion. There is no any (performance or size) benefit from 'inline' keyword in this particular file, so let's replace one by 'static'. Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f --- M tests/ctrl/ctrl_test.c 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 Jenkins Builder: Verified diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index 3bbab76..08be15f 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -7,7 +7,7 @@ #include #include -inline void check_type(enum ctrl_type c) +static void check_type(enum ctrl_type c) { const char *t = get_value_string(ctrl_type_vals, c); int v = get_string_value(ctrl_type_vals, t); -- To view, visit https://gerrit.osmocom.org/2895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:39:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:41 +0000 Subject: [MERGED] libosmocore[master]: core/conv/conv.c: drop useless assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: core/conv/conv.c: drop useless assignment ...................................................................... core/conv/conv.c: drop useless assignment Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206 --- M src/conv.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/conv.c b/src/conv.c index 8e97e52..b81e37e 100644 --- a/src/conv.c +++ b/src/conv.c @@ -624,7 +624,7 @@ l = osmo_conv_decode_scan(&decoder, input, code->len); if (code->term == CONV_TERM_FLUSH) - l = osmo_conv_decode_flush(&decoder, &input[l]); + osmo_conv_decode_flush(&decoder, &input[l]); rv = osmo_conv_decode_get_output(&decoder, output, code->term == CONV_TERM_FLUSH, /* has_flush */ -- To view, visit https://gerrit.osmocom.org/2879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:39:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:41 +0000 Subject: [MERGED] libosmocore[master]: gsm/gsm48.c: drop useless assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm/gsm48.c: drop useless assignment ...................................................................... gsm/gsm48.c: drop useless assignment Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4 --- M src/gsm/gsm48.c 1 file changed, 0 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/gsm/gsm48.c b/src/gsm/gsm48.c index 1b25538..405c904 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -421,7 +421,6 @@ bcd[1] = val % 10; val = val / 10; bcd[0] = val % 10; - val = val / 10; } /*! \brief Checks is particular message is cipherable in A/Gb mode according to -- To view, visit https://gerrit.osmocom.org/2881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:39:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:41 +0000 Subject: [MERGED] libosmocore[master]: sim/core.c: drop useless double assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sim/core.c: drop useless double assignment ...................................................................... sim/core.c: drop useless double assignment Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a --- M src/sim/core.c 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 Jenkins Builder: Verified diff --git a/src/sim/core.c b/src/sim/core.c index 2f129c9..1ce2fed 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -306,7 +306,7 @@ const struct osim_card_sw **sw_lists = cp->sws; const struct osim_card_sw *sw_list, *sw; - for (sw_list = *sw_lists++; sw_list != NULL; sw = sw_list = *sw_lists++) { + for (sw_list = *sw_lists++; sw_list != NULL; sw_list = *sw_lists++) { for (sw = sw_list; sw->code != 0 && sw->mask != 0; sw++) { if ((sw_in & sw->mask) == sw->code) return sw; -- To view, visit https://gerrit.osmocom.org/2877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:39:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:39:41 +0000 Subject: [MERGED] libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gb/gprs_bssgp.c: avoid valueless goto usage ...................................................................... gb/gprs_bssgp.c: avoid valueless goto usage Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d --- M src/gb/gprs_bssgp.c 1 file changed, 3 insertions(+), 10 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/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index aa6e37b..142f589 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -698,24 +698,17 @@ /* ... and subtract the number of leaked bytes */ bucket_predicted -= leaked; - if (bucket_predicted < pdu_len) { - /* this is just to make sure the bucket doesn't underflow */ - bucket_predicted = pdu_len; - goto pass; - } + if (bucket_predicted < pdu_len) + return 0; if (bucket_predicted <= fc->bucket_size_max) { /* the bucket is not full yet, we can pass the packet */ fc->bucket_counter = bucket_predicted; - goto pass; + return 0; } /* bucket is full, PDU needs to be delayed */ return 1; - -pass: - /* if we reach here, the PDU can pass */ - return 0; } /* output callback for BVC flow control */ -- To view, visit https://gerrit.osmocom.org/2878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:40:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:40:06 +0000 Subject: osmo-bts[master]: scheduler_trx.c: strip unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:40:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:40:19 +0000 Subject: osmo-bts[master]: cosmetic: fix some typos In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Thu Jun 15 14:40:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:40:21 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: fix some typos In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: fix some typos ...................................................................... cosmetic: fix some typos Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05 --- M include/osmo-bts/scheduler.h M include/osmo-bts/scheduler_backend.h M src/common/scheduler.c M src/osmo-bts-trx/scheduler_trx.c 4 files changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h index 33a99bb..9dbc946 100644 --- a/include/osmo-bts/scheduler.h +++ b/include/osmo-bts/scheduler.h @@ -127,7 +127,7 @@ uint8_t mf_period; /* period of multiframe */ const struct trx_sched_frame *mf_frames; /* pointer to frame layout */ - struct llist_head dl_prims; /* Queue primitves for TX */ + struct llist_head dl_prims; /* Queue primitives for TX */ /* Channel states for all logical channels */ struct l1sched_chan_state chan_state[_TRX_CHAN_MAX]; @@ -160,7 +160,7 @@ /*! \brief Handle a PH-TCH.req from L2 down to L1 */ int trx_sched_tch_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap); -/*! \brief PHY informs us of new (current) GSM freme nunmber */ +/*! \brief PHY informs us of new (current) GSM frame number */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn); /*! \brief handle an UL burst received by PHY */ diff --git a/include/osmo-bts/scheduler_backend.h b/include/osmo-bts/scheduler_backend.h index e63b961..af1cfbf 100644 --- a/include/osmo-bts/scheduler_backend.h +++ b/include/osmo-bts/scheduler_backend.h @@ -29,7 +29,7 @@ trx_sched_dl_func *dl_fn; /*! \brief function to call when burst received from PHY */ trx_sched_ul_func *ul_fn; - /*! \breif is this channel automatically active at start? */ + /*! \brief is this channel automatically active at start? */ int auto_active; }; extern const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX]; diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 27b7630..121475a 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -105,7 +105,7 @@ 0,1,0,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,0,1,1,1,1,1,1,1, }, }; -/*! \brief SCH trainign sequence (TS 05.02 Chapter 5.2.5) */ +/*! \brief SCH training sequence (TS 05.02 Chapter 5.2.5) */ const ubit_t _sched_sch_train[64] = { 1,0,1,1,1,0,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1, 0,0,1,0,1,1,0,1,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,0,0,1,1,0,1,1, @@ -584,7 +584,7 @@ enum trx_chan_type dl_chan; /*! \brief downlink block ID */ uint8_t dl_bid; - /*! \breff uplink TRX channel type */ + /*! \brief uplink TRX channel type */ enum trx_chan_type ul_chan; /*! \brief uplink block ID */ uint8_t ul_bid; @@ -1307,7 +1307,7 @@ uint8_t period; /*! \brief pointer to scheduling structure */ const struct trx_sched_frame *frames; - /*! \brife human-readable name */ + /*! \brief human-readable name */ const char *name; }; diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 9ec9592..8531d5c 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -570,7 +570,7 @@ } if (msgb_l2len(msg_tch) != len) { LOGP(DL1C, LOGL_ERROR, "Cannot send payload with " - "invalid length! (expecing %d, received %d)\n", + "invalid length! (expecting %d, received %d)\n", len, msgb_l2len(msg_tch)); free_bad_msg: /* free message */ @@ -1354,7 +1354,7 @@ /* TCH or BFI */ /* Note on FN 19 or 20: If we received the last burst of a frame, * it actually starts at FN 8 or 9. A burst starting there, overlaps - * with the slot 12, so an extra FN must be substracted to get correct + * with the slot 12, so an extra FN must be subtracted to get correct * start of frame. */ return _sched_compose_tch_ind(l1t, tn, -- To view, visit https://gerrit.osmocom.org/2840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:40:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:40:22 +0000 Subject: [MERGED] osmo-bts[master]: scheduler_trx.c: strip unused variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: scheduler_trx.c: strip unused variable ...................................................................... scheduler_trx.c: strip unused variable Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 0 insertions(+), 2 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/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 8531d5c..cbcde8c 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1428,8 +1428,6 @@ /* check if transceiver is still alive */ if (transceiver_lost++ == TRX_LOSS_FRAMES) { - struct gsm_bts_trx *trx; - LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); no_clock: -- To view, visit https://gerrit.osmocom.org/2842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 15 14:40:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 14:40:40 +0000 Subject: osmocom-bb[master]: host/mobile: use osmocom_ms as talloc context In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d5fcbdd77fe41d78cfe54731dd2ebfc4171f62c Gerrit-PatchSet: 4 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 Thu Jun 15 14:58:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 15 Jun 2017 14:58:25 +0000 Subject: [MERGED] openbsc[master]: Update SI data structures and generation In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Update SI data structures and generation ...................................................................... Update SI data structures and generation To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660 --- M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/include/openbsc/system_information.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c M openbsc/tests/gsm0408/gsm0408_test.c M openbsc/tests/gsm0408/gsm0408_test.ok 9 files changed, 353 insertions(+), 164 deletions(-) Approvals: 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 05d834e..5ab7c3f 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -29,6 +29,13 @@ #define tmsi_from_string(str) strtoul(str, NULL, 10) +/* 3-bit long values */ +#define EARFCN_PRIO_INVALID 8 +#define EARFCN_MEAS_BW_INVALID 8 +/* 5-bit long values */ +#define EARFCN_QRXLV_INVALID 32 +#define EARFCN_THRESH_LOW_INVALID 32 + enum gsm_security_event { GSM_SECURITY_NOAVAIL, GSM_SECURITY_AUTH_FAILED, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index a507606..d3fd757 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -26,7 +26,8 @@ #include -/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018: 4-bit index is used (2#1111 = 10#15) */ +/* 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 @@ -301,8 +302,9 @@ /* 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 */ - sysinfo_buf_t buf[_MAX_SYSINFO_TYPE]; + /* 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; @@ -491,10 +493,10 @@ struct gsm_bts_trx_ts ts[TRX_NR_TS]; }; -#define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater]) +#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]) -#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[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, @@ -739,7 +741,7 @@ 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]; + sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; /* offsets used while generating SI2quater */ size_t e_offset; size_t u_offset; diff --git a/openbsc/include/openbsc/system_information.h b/openbsc/include/openbsc/system_information.h index 21016b8..71bea26 100644 --- a/openbsc/include/openbsc/system_information.h +++ b/openbsc/include/openbsc/system_information.h @@ -14,6 +14,8 @@ int range_encode(enum gsm48_range r, int *arfcns, int arfcns_used, int *w, int f0, uint8_t *chan_list); uint8_t si2q_num(struct gsm_bts *bts); +int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, + uint8_t qrx, uint8_t meas_bw); int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble); int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, bool diversity); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 25f3fdc..b95c7b0 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -101,7 +101,7 @@ static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len) { struct gsm_bts *bts = trx->bts; - int rc; + int rc, j; DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); @@ -114,6 +114,10 @@ rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), GSM_BTS_SI(bts, i), si_len); break; + case SYSINFO_TYPE_2quater: + for (j = 0; j <= bts->si2q_count; j++) + rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); + break; default: rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), GSM_BTS_SI(bts, i), si_len); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index b05d3d9..2fc39ab 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -2774,6 +2774,7 @@ return CMD_SUCCESS; } +/* help text should be kept in sync with EARFCN_*_INVALID defines */ DEFUN(cfg_bts_si2quater_neigh_add, cfg_bts_si2quater_neigh_add_cmd, "si2quater neighbor-list add earfcn <0-65535> thresh-hi <0-31> " "thresh-lo <0-32> prio <0-8> qrxlv <0-32> meas <0-8>", @@ -2791,54 +2792,37 @@ uint16_t arfcn = atoi(argv[0]); uint8_t thresh_hi = atoi(argv[1]), thresh_lo = atoi(argv[2]), prio = atoi(argv[3]), qrx = atoi(argv[4]), meas = atoi(argv[5]); - int r = osmo_earfcn_add(e, arfcn, - (meas < 8) ? meas : OSMO_EARFCN_MEAS_INVALID); + int r = bts_earfcn_add(bts, arfcn, thresh_hi, thresh_lo, prio, qrx, meas); - if (r < 0) { - vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), - VTY_NEWLINE); - return CMD_WARNING; + switch (r) { + case 1: + vty_out(vty, "Warning: multiple threshold-high are not supported, overriding with %u%s", + thresh_hi, VTY_NEWLINE); + break; + case EARFCN_THRESH_LOW_INVALID: + vty_out(vty, "Warning: multiple threshold-low are not supported, overriding with %u%s", + thresh_lo, VTY_NEWLINE); + break; + case EARFCN_QRXLV_INVALID + 1: + vty_out(vty, "Warning: multiple QRXLEVMIN are not supported, overriding with %u%s", + qrx, VTY_NEWLINE); + break; + case EARFCN_PRIO_INVALID: + vty_out(vty, "Warning: multiple priorities are not supported, overriding with %u%s", + prio, VTY_NEWLINE); + break; + default: + if (r < 0) { + vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), VTY_NEWLINE); + return CMD_WARNING; + } } - if (e->thresh_hi && thresh_hi != e->thresh_hi) - vty_out(vty, "Warning: multiple threshold-high are not " - "supported, overriding previous threshold %u%s", - e->thresh_hi, VTY_NEWLINE); - - e->thresh_hi = thresh_hi; - - if (thresh_lo != 32) { - if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) - vty_out(vty, "Warning: multiple threshold-low are not " - "supported, overriding previous threshold %u%s", - e->thresh_lo, VTY_NEWLINE); - e->thresh_lo = thresh_lo; - e->thresh_lo_valid = true; - } - - if (qrx != 32) { - if (e->qrxlm_valid && e->qrxlm != qrx) - vty_out(vty, "Warning: multiple QRXLEVMIN are not " - "supported, overriding previous value %u%s", - e->qrxlm, VTY_NEWLINE); - e->qrxlm = qrx; - e->qrxlm_valid = true; - } - - if (prio != 8) { - if (e->prio_valid && e->prio != prio) - vty_out(vty, "Warning: multiple priorities are not " - "supported, overriding previous value %u%s", - e->prio, VTY_NEWLINE); - e->prio = prio; - e->prio_valid = true; - } - - if (si2q_num(bts) < 2) /* FIXME: use SI2Q_MAX_NUM */ + if (si2q_num(bts) <= SI2Q_MAX_NUM) return CMD_SUCCESS; vty_out(vty, "Warning: not enough space in SI2quater (%u/%u used) for a given EARFCN %u%s", - bts->si2q_count, 2, arfcn, VTY_NEWLINE); /* FIXME: use SI2Q_MAX_NUM */ + bts->si2q_count, SI2Q_MAX_NUM, arfcn, VTY_NEWLINE); osmo_earfcn_del(e, arfcn); return CMD_WARNING; @@ -2877,16 +2861,14 @@ switch(bts_uarfcn_add(bts, arfcn, scramble, atoi(argv[2]))) { case -ENOMEM: - vty_out(vty, "Unable to add arfcn: max number of UARFCNs (%u) " - "reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); + vty_out(vty, "Unable to add UARFCN: max number of UARFCNs (%u) reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); return CMD_WARNING; case -ENOSPC: - vty_out(vty, "Warning: not enough space in si2quater for a " - "given arfcn%s", VTY_NEWLINE); + vty_out(vty, "Warning: not enough space in SI2quater for a given UARFCN (%u, %u)%s", + arfcn, scramble, VTY_NEWLINE); return CMD_WARNING; case -EADDRINUSE: - vty_out(vty, "Unable to add arfcn: (%u, %u) is already added%s", - arfcn, scramble, VTY_NEWLINE); + vty_out(vty, "Unable to add UARFCN: (%u, %u) is already added%s", arfcn, scramble, VTY_NEWLINE); return CMD_WARNING; } diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index a6fdf46..fdab70a 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -65,6 +65,12 @@ 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 */ + + if (budget <= 6) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + /* first we have to properly adjust budget requirements */ if (e->prio_valid) /* E-UTRAN_PRIORITY: 3GPP TS 45.008*/ rem -= 4; @@ -87,16 +93,17 @@ if (skip < offset) { skip++; /* ignore EARFCNs added on previous calls */ } else { - earfcn_budget = 17; /* computer budget per-EARFCN */ + earfcn_budget = 17; /* compute budget per-EARFCN */ if (OSMO_EARFCN_MEAS_INVALID == e->meas_bw[i]) earfcn_budget++; else earfcn_budget += 4; - if (rem - earfcn_budget < 0) { + if (rem - earfcn_budget < 0) break; - } else { + else { bts->e_offset++; + rem -= earfcn_budget; bitvec_set_bit(bv, 1); /* EARFCN: */ bitvec_set_uint(bv, e->arfcn[i], 16); @@ -143,6 +150,12 @@ static inline void append_earfcn(struct bitvec *bv, struct gsm_bts *bts, uint8_t budget) { + int rem = budget - 25; + if (rem <= 0) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + /* Additions in Rel-5: */ bitvec_set_bit(bv, H); /* No 3G Additional Measurement Param. Descr. */ @@ -191,7 +204,7 @@ 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, budget - 25); + append_eutran_neib_cell(bv, bts, rem); /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ bitvec_set_bit(bv, 0); @@ -267,7 +280,12 @@ 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]; uint16_t cu = u[bts->u_offset]; /* caller ensures that length is positive */ - uint8_t rem = budget - 7; /* account for constant bits right away */ + uint8_t rem = budget - 7, offset_diff; /* account for constant bits right away */ + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + + if (budget <= 7) + return -ENOMEM; /* 3G Neighbour Cell Description */ bitvec_set_bit(bv, 1); @@ -282,20 +300,22 @@ bitvec_set_bit(bv, 0); for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - for (j = st, k = 0; j < i; j++) + offset_diff = 0; + for (j = st, k = 0; j < i; j++) { a[k++] = sc[j]; /* copy corresponding SCs */ - + offset_diff++; /* compute proper offset step */ + } 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; } - if (rem - rc < 0) { + if (rem - rc <= 0) break; /* we have ran out of budget in current SI2q */ - } else { + else { rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset++; + bts->u_offset += offset_diff; } cu = u[i]; st = i; /* update start position */ @@ -303,9 +323,11 @@ } if (rem > 22) { /* add last UARFCN not covered by previous cycle if it could possibly fit into budget */ - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++) + 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; @@ -313,7 +335,7 @@ if (rem - rc >= 0) { rem -= append_utran_fdd(bv, cu, a, k); - bts->u_offset++; + bts->u_offset += offset_diff; } } @@ -331,6 +353,10 @@ { int rc; struct bitvec bv; + + if (bts->si2q_count < bts->si2q_index) + return -EINVAL; + bv.data = data; bv.data_len = 20; bitvec_zero(&bv); @@ -362,34 +388,28 @@ /* No extension (length) */ bitvec_set_bit(&bv, 0); - if (bts->si_common.uarfcn_length) { - /* Even if we do not append EARFCN we still need to set 3 bits */ - rc = append_uarfcns(&bv, bts, SI2Q_MAX_LEN - (bv.cur_bit + 3)); + 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: failed to append %zu UARFCNs due to range encoding failure: %s\n", - bts->si_common.uarfcn_length, strerror(-rc)); + 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 */ + } else /* No 3G Neighbour Cell Description */ bitvec_set_bit(&bv, 0); - } /* No 3G Measurement Parameters Description */ bitvec_set_bit(&bv, 0); /* No GPRS_3G_MEASUREMENT Parameters Descr. */ bitvec_set_bit(&bv, 0); - if (si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) { - append_earfcn(&bv, bts, SI2Q_MAX_LEN - bv.cur_bit); - - /* FIXME: remove following check once multiple SI2q are properly supported */ - if ((bts->e_offset != si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) || - si2q_earfcn_count(&bts->si_common.si2quater_neigh_list) > 5) - return -ENOMEM; - } else { - /* No Additions in Rel-5: */ + rc = SI2Q_MAX_LEN - bv.cur_bit; + if (rc > 0 && si2q_earfcn_count(&bts->si_common.si2quater_neigh_list) - bts->e_offset > 0) + append_earfcn(&bv, bts, rc); + else /* No Additions in Rel-5: */ bitvec_set_bit(&bv, L); - } bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); return bv.data_len; diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index a074a78..dcabbbd 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -122,50 +122,73 @@ } } -static inline unsigned earfcn_size(const struct gsm_bts *bts) +size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) { - const struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; /* EARFCN */ + unsigned i, ret = 0; - /* account for all the constant bits in append_earfcn() */ - return 25 + osmo_earfcn_bit_size_ext(e, bts->e_offset); + if (!e) + return 0; + + for (i = 0; i < e->length; i++) + if (e->arfcn[i] != OSMO_EARFCN_INVALID) + ret++; + + return ret; } -static inline unsigned uarfcn_size(const struct gsm_bts *bts) +/* generate SI2quater messages, return rest octets length of last generated message or negative error code */ +static int make_si2quaters(struct gsm_bts *bts, bool counting) { - const uint16_t *u = bts->si_common.data.uarfcn_list; - uint16_t cu = u[bts->u_offset]; /* UARFCN */ - /* account for all the constant bits in append_uarfcns() */ - unsigned s = 7, append = 22, r = 0, i, st = 0, j, k; + int rc; + bool memory_exceeded = true; + struct gsm48_system_information_type_2quater *si2q; - for (i = bts->u_offset; i < bts->si_common.uarfcn_length; i++) { - for (j = st, k = 0; j < i; j++, k++); - if (u[i] != cu) { /* we've reached new UARFCN */ - r += (append + range1024_p(k)); - cu = u[i]; - st = i; /* update start position */ + for (bts->si2q_index = 0; bts->si2q_index < SI2Q_MAX_NUM; bts->si2q_index++) { + si2q = GSM_BTS_SI2Q(bts, bts->si2q_index); + if (counting) { /* that's legitimate if we're called for counting purpose: */ + if (bts->si2q_count < bts->si2q_index) + bts->si2q_count = bts->si2q_index; + } else { + memset(si2q, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + + si2q->header.l2_plen = GSM48_LEN2PLEN(22); + si2q->header.rr_protocol_discriminator = GSM48_PDISC_RR; + si2q->header.skip_indicator = 0; + si2q->header.system_information = GSM48_MT_RR_SYSINFO_2quater; + } + + rc = rest_octets_si2quater(si2q->rest_octets, bts); + if (rc < 0) + return rc; + + if (bts->u_offset >= bts->si_common.uarfcn_length && + bts->e_offset >= si2q_earfcn_count(&bts->si_common.si2quater_neigh_list)) { + memory_exceeded = false; + break; } } - /* add last UARFCN not covered by previous cycle */ - for (i = st, k = 0; i < bts->si_common.uarfcn_length; i++, k++); + if (memory_exceeded) + return -ENOMEM; - return s + r + append + range1024_p(k); + return rc; } +/* we generate SI2q rest octets twice to get proper estimation but it's one time cost anyway */ uint8_t si2q_num(struct gsm_bts *bts) { - size_t est, e_sz = 1, u_sz = 1; + int rc = make_si2quaters(bts, true); + uint8_t num = bts->si2q_index + 1; /* number of SI2quater messages */ - if (&bts->si_common.si2quater_neigh_list) /* EARFCN */ - e_sz = earfcn_size(bts); + /* N. B: si2q_num() should NEVER be called during actualSI2q rest octets generation + we're not re-entrant because of the following code: */ + bts->u_offset = 0; + bts->e_offset = 0; - if (bts->si_common.uarfcn_length) /* UARFCN */ - u_sz = uarfcn_size(bts); + if (rc < 0) + return 0xFF; /* return impossible index as an indicator of error in generating SI2quater */ - /* 2 bits are used in between UARFCN and EARFCN structs */ - est = 1 + (e_sz + u_sz) / (SI2Q_MAX_LEN - (SI2Q_MIN_LEN + 2)); - - return est; + return num; } /* 3GPP TS 44.018, Table 9.1.54.1 - prepend diversity bit to scrambling code */ @@ -174,6 +197,44 @@ if (diversity) return scramble | (1 << 9); return scramble; +} + +int bts_earfcn_add(struct gsm_bts *bts, uint16_t earfcn, uint8_t thresh_hi, uint8_t thresh_lo, uint8_t prio, + uint8_t qrx, uint8_t meas_bw) +{ + struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; + int r = osmo_earfcn_add(e, earfcn, (meas_bw < EARFCN_MEAS_BW_INVALID) ? meas_bw : OSMO_EARFCN_MEAS_INVALID); + + if (r < 0) + return r; + + if (e->thresh_hi && thresh_hi != e->thresh_hi) + r = 1; + + e->thresh_hi = thresh_hi; + + if (thresh_lo != EARFCN_THRESH_LOW_INVALID) { + if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) + r = EARFCN_THRESH_LOW_INVALID; + e->thresh_lo = thresh_lo; + e->thresh_lo_valid = true; + } + + if (qrx != EARFCN_QRXLV_INVALID) { + if (e->qrxlm_valid && e->qrxlm != qrx) + r = EARFCN_QRXLV_INVALID + 1; + e->qrxlm = qrx; + e->qrxlm_valid = true; + } + + if (prio != EARFCN_PRIO_INVALID) { + if (e->prio_valid && e->prio != prio) + r = EARFCN_PRIO_INVALID; + e->prio = prio; + e->prio_valid = true; + } + + return r; } int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble) @@ -237,8 +298,10 @@ scl[k] = scr; bts->si_common.uarfcn_length++; - if (si2q_num(bts) < 2) /* FIXME: use SI2Q_MAX_NUM */ + if (si2q_num(bts) <= SI2Q_MAX_NUM) { + bts->si2q_count = si2q_num(bts) - 1; return 0; + } bts_uarfcn_del(bts, arfcn, scramble); return -ENOSPC; @@ -689,39 +752,26 @@ return false; } -size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) -{ - unsigned i, ret = 0; - - if (!e) - return 0; - - for (i = 0; i < e->length; i++) - if (e->arfcn[i] != OSMO_EARFCN_INVALID) - ret++; - - return ret; -} - static int generate_si2quater(enum osmo_sysinfo_type t, struct gsm_bts *bts) { int rc; - struct gsm48_system_information_type_2quater *si2q = GSM_BTS_SI2Q(bts); + struct gsm48_system_information_type_2quater *si2q; if (si2quater_not_needed(bts)) /* generate rest_octets for SI2q only when necessary */ return GSM_MACBLOCK_LEN; - memset(si2q, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN); + bts->u_offset = 0; + bts->e_offset = 0; + bts->si2q_index = 0; + bts->si2q_count = si2q_num(bts) - 1; - si2q->header.l2_plen = GSM48_LEN2PLEN(22); - si2q->header.rr_protocol_discriminator = GSM48_PDISC_RR; - si2q->header.skip_indicator = 0; - si2q->header.system_information = GSM48_MT_RR_SYSINFO_2quater; - - rc = rest_octets_si2quater(si2q->rest_octets, bts); + rc = make_si2quaters(bts, false); if (rc < 0) return rc; + OSMO_ASSERT(bts->si2q_count == bts->si2q_index); + OSMO_ASSERT(bts->si2q_count <= SI2Q_MAX_NUM); + return sizeof(*si2q) + rc; } diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a78505..5a8c6ca 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -89,25 +89,19 @@ { int r; - bts->u_offset = 0; - bts->e_offset = 0; - bts->si2q_index = 0; - bts->si2q_count = 0; bts->si_valid = 0; bts->si_valid |= (1 << SYSINFO_TYPE_2quater); - - /* should be no-op as entire buffer is filled with padding: */ - memset(GSM_BTS_SI(bts, SYSINFO_TYPE_2quater), 0xAE, GSM_MACBLOCK_LEN); printf("generating SI2quater for %zu EARFCNs and %zu UARFCNs...\n", si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); if (r > 0) - printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", - GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", - bts->si2q_index, bts->si2q_count, r, - osmo_hexdump((void *)GSM_BTS_SI2Q(bts), GSM_MACBLOCK_LEN)); + for (bts->si2q_index = 0; bts->si2q_index < bts->si2q_count + 1; bts->si2q_index++) + printf("generated %s SI2quater [%02u/%02u]: [%d] %s\n", + GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) ? "valid" : "invalid", + bts->si2q_index, bts->si2q_count, r, + osmo_hexdump((void *)GSM_BTS_SI2Q(bts, bts->si2q_index), GSM_MACBLOCK_LEN)); else printf("%s() failed to generate SI2quater: %s\n", s, strerror(-r)); } @@ -145,8 +139,10 @@ r = bts_uarfcn_add(bts, arfcn, scramble, diversity); if (r < 0) printf("failed to add UARFCN to SI2quater: %s\n", strerror(-r)); - else + else { + bts->si2q_count = si2q_num(bts) - 1; gen(bts, __func__); + } } static inline void test_si2q_segfault(void) @@ -181,7 +177,6 @@ _bts_uarfcn_add(bts, 10613, 64, 0); _bts_uarfcn_add(bts, 10613, 164, 0); _bts_uarfcn_add(bts, 10613, 14, 0); - gen(bts, __func__); } static inline void test_si2q_u(void) @@ -192,10 +187,12 @@ if (!network) exit(1); + bts = gsm_bts_alloc(network); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); + /* subsequent calls should produce valid SI if there's enough memory */ _bts_uarfcn_add(bts, 1982, 13, 1); _bts_uarfcn_add(bts, 1982, 44, 0); @@ -208,7 +205,6 @@ _bts_uarfcn_add(bts, 1982, 223, 1); _bts_uarfcn_add(bts, 1982, 14, 0); _bts_uarfcn_add(bts, 1982, 88, 0); - gen(bts, __func__); } static inline void test_si2q_e(void) @@ -219,6 +215,7 @@ if (!network) exit(1); + bts = gsm_bts_alloc(network); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; @@ -227,8 +224,10 @@ bts->si_common.si2quater_neigh_list.thresh_hi = 5; osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); + /* first generate invalid SI as no EARFCN added */ gen(bts, __func__); + /* subsequent calls should produce valid SI if there's enough memory and EARFCNs */ add_earfcn_b(bts, 1917, 5); del_earfcn_b(bts, 1917); @@ -239,6 +238,54 @@ add_earfcn_b(bts, 1965, OSMO_EARFCN_MEAS_INVALID); add_earfcn_b(bts, 1967, 4); add_earfcn_b(bts, 1982, 3); +} + +static inline void test_si2q_long(void) +{ + struct gsm_bts *bts; + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + printf("Testing SYSINFO_TYPE_2quater combined EARFCN & UARFCN generation:\n"); + + if (!network) + exit(1); + + bts = gsm_bts_alloc(network); + + bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; + bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; + bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; + bts->si_common.si2quater_neigh_list.thresh_hi = 5; + + osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); + + bts_earfcn_add(bts, 1922, 11, 22, 8,32, 8); + bts_earfcn_add(bts, 1922, 11, 22, 8, 32, 8); + bts_earfcn_add(bts, 1924, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 1923, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 1925, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2111, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2112, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2113, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2114, 11, 12, 6, 11, 2); + bts_earfcn_add(bts, 2131, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2132, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2133, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2134, 11, 12, 6, 11, 2); + bts_earfcn_add(bts, 2121, 11, 12, 6, 11, 5); + bts_earfcn_add(bts, 2122, 11, 12, 6, 11, 4); + bts_earfcn_add(bts, 2123, 11, 12, 6, 11, 3); + bts_earfcn_add(bts, 2124, 11, 12, 6, 11, 2); + _bts_uarfcn_add(bts, 1976, 13, 1); + _bts_uarfcn_add(bts, 1976, 38, 1); + _bts_uarfcn_add(bts, 1976, 44, 1); + _bts_uarfcn_add(bts, 1976, 120, 1); + _bts_uarfcn_add(bts, 1976, 140, 1); + _bts_uarfcn_add(bts, 1976, 163, 1); + _bts_uarfcn_add(bts, 1976, 166, 1); + _bts_uarfcn_add(bts, 1976, 217, 1); + _bts_uarfcn_add(bts, 1976, 224, 1); + _bts_uarfcn_add(bts, 1976, 225, 1); + _bts_uarfcn_add(bts, 1976, 226, 1); } static void test_mi_functionality(void) @@ -642,6 +689,9 @@ test_si2q_e(); test_si2q_u(); test_si2q_mu(); + test_si2q_long(); + printf("Done.\n"); + return EXIT_SUCCESS; } diff --git a/openbsc/tests/gsm0408/gsm0408_test.ok b/openbsc/tests/gsm0408/gsm0408_test.ok index 5e0b9d5..d30f421 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.ok +++ b/openbsc/tests/gsm0408/gsm0408_test.ok @@ -71,11 +71,11 @@ 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 Testing SYSINFO_TYPE_2quater EARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 removed EARFCN 1917 - generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 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 added EARFCN 1932 - generating SI2quater for 2 EARFCNs and 0 UARFCNs... @@ -87,12 +87,14 @@ 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 added EARFCN 1967 - generating SI2quater for 6 EARFCNs and 0 UARFCNs... -add_earfcn_b() failed to generate SI2quater: Cannot allocate memory +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 added EARFCN 1982 - generating SI2quater for 7 EARFCNs and 0 UARFCNs... -add_earfcn_b() failed to generate SI2quater: Cannot allocate memory +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 Testing SYSINFO_TYPE_2quater UARFCN generation: generating SI2quater for 0 EARFCNs and 0 UARFCNs... -generated invalid SI2quater [00/00]: [23] ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae ae +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 generating SI2quater for 0 EARFCNs and 2 UARFCNs... @@ -111,10 +113,10 @@ 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 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 -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -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 +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 +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 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 @@ -124,9 +126,79 @@ 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 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 -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -failed to add UARFCN to SI2quater: No space left on device -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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 +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 Done. -- To view, visit https://gerrit.osmocom.org/2832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Gerrit-PatchSet: 6 Gerrit-Project: openbsc 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 Thu Jun 15 19:18:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 19:18:46 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Gerrit-PatchSet: 3 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 Thu Jun 15 19:18:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 19:18:48 +0000 Subject: [MERGED] osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL: receive and send multiple SI2q messages ...................................................................... RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Related: OS#1660 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 49 insertions(+), 28 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 eab9379..bb05dec 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -292,36 +292,43 @@ 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_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + switch (osmo_si) { + case SYSINFO_TYPE_2quater: + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + 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); + break; + case SYSINFO_TYPE_3: + if (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; + } /* intentional fall-through to copy SI3 data */ + default: + 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); + LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n", + get_value_string(osmo_sitype_strs, osmo_si), len); } } else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/2824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 21:09:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 21:09:52 +0000 Subject: openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 15 21:09:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 15 Jun 2017 21:09:54 +0000 Subject: [MERGED] openbsc[master]: bsc_init: Forget which SIs are valid for the trx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_init: Forget which SIs are valid for the trx ...................................................................... bsc_init: Forget which SIs are valid for the trx Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 13 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index e61d4ea..400e09f 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -25,7 +25,7 @@ #include #include #include - +#include #include struct gsm_bts; @@ -35,8 +35,7 @@ #define GSM48_LEN2PLEN(a) (((a) << 2) | 1) -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len); +int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len); int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len); int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr, diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 7ee19a7..6ae790f 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -226,11 +226,16 @@ /* Send a BCCH_INFO message as per Chapter 8.5.1 */ -int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type, - const uint8_t *data, int len) +int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len) { struct abis_rsl_dchan_hdr *dh; + const struct gsm_bts *bts = trx->bts; struct msgb *msg = rsl_msgb_alloc(); + uint8_t type = osmo_sitype2rsl(si_type); + + if (bts->c0 != trx) + LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS%u/TRX%u\n", + get_value_string(osmo_sitype_strs, si_type), bts->nr, trx->nr); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof*dh); init_dchan_hdr(dh, RSL_MT_BCCH_INFO); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index b95c7b0..ec87a7b 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -119,8 +119,7 @@ rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); break; } @@ -139,6 +138,9 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; + /* Zero, forget the state of the SIs */ + bts->si_valid = 0; + /* First, we determine which of the SI messages we actually need */ if (trx == bts->c0) { -- To view, visit https://gerrit.osmocom.org/2819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 23:07:58 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 23:07:58 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Fix USRP2/N200/N210 device detection Message-ID: Review at https://gerrit.osmocom.org/2925 uhd: Fix USRP2/N200/N210 device detection Commit 1fb0ce67 "uhd: Use map container for for device parameter access" inadvertently removed the string identifier for the USRP2 and derived devices (N200/N210). Add the missing USRP2 string identifier. Also search for partial string matches in the UHD provided device and mboard stings. This is necessary to guarantee that strings such as "N200r3" instead of just "N200" are sucessfully found. Tested with N200, X310, B200mini and B210 devices. Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/25/2925/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ecf2c34..fe084f7 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -526,16 +526,22 @@ { "E3XX", { E3XX, TX_WINDOW_FIXED } }, { "X300", { X3XX, TX_WINDOW_FIXED } }, { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, }; // Compare UHD motherboard and device strings */ std::string found; - if (devStringMap.find(devString) != devStringMap.end()) - found = devString; - else if (devStringMap.find(mboardString) != devStringMap.end()) - found = mboardString; + auto mapIter = devStringMap.begin(); + while (mapIter != devStringMap.end()) { + if (devString.find(mapIter->first) != std::string::npos || + mboardString.find(mapIter->first) != std::string::npos) { + found = mapIter->first; + break; + } + mapIter++; + } if (found.empty()) { LOG(ALERT) << "Unsupported device " << devString; -- To view, visit https://gerrit.osmocom.org/2925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 15 23:07:58 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 23:07:58 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Fix Tx-RX timing offset setting Message-ID: Review at https://gerrit.osmocom.org/2926 uhd: Fix Tx-RX timing offset setting Integer timestamp offset was set to zero due to bad cast-operator precedence. Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/26/2926/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index fe084f7..a2660dc 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -437,7 +437,7 @@ tx_rate = usrp_dev->get_tx_rate(); rx_rate = usrp_dev->get_rx_rate(); - ts_offset = (TIMESTAMP) desc.offset * rx_rate; + ts_offset = static_cast(desc.offset * rx_rate); LOG(INFO) << "Rates configured for " << desc.str; } @@ -828,7 +828,6 @@ uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS; usrp_dev->issue_stream_cmd(stream_cmd); - async_event_thrd->cancel(); async_event_thrd->join(); delete async_event_thrd; -- To view, visit https://gerrit.osmocom.org/2926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 15 23:07:59 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 23:07:59 +0000 Subject: [PATCH] osmo-trx[master]: transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices Message-ID: Review at https://gerrit.osmocom.org/2927 transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices Upon issuing POWEROFF command to a running transceiver, UHD interfacing thread state may become undefined if the device is stopped with I/O threads still active. Bad behavior is device dependent with only network based USRP devices affected. USB based device thread behavior stops and shutdowns as expected. Tested with N200, X300, and B210. Tested solutions include the following: 1. Set pthread_setcanceltype() with PTHREAD_CANCEL_ASYNCHRONOUS 2. Add sleep delay to allow I/O threads to timeout before stopping the device 3. Wait for I/O threads to join after cancellation before stopping the device This patch resolves the issue by with the third approach. Number 1 is not guaranteed to always work with UHD internals as driver code may explicitly set thread parameters. Using sleep calls to fix order-of-operation issues is almost never a good idea. Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c --- M Transceiver52M/Transceiver.cpp 1 file changed, 4 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/27/2927/1 diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 66eff7f..61da416 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -297,6 +297,10 @@ LOG(NOTICE) << "Stopping the transceiver"; mTxLowerLoopThread->cancel(); mRxLowerLoopThread->cancel(); + mTxLowerLoopThread->join(); + mRxLowerLoopThread->join(); + delete mTxLowerLoopThread; + delete mRxLowerLoopThread; for (size_t i = 0; i < mChans; i++) { mRxServiceLoopThreads[i]->cancel(); @@ -314,11 +318,6 @@ mTxPriorityQueues[i].clear(); } - - mTxLowerLoopThread->join(); - mRxLowerLoopThread->join(); - delete mTxLowerLoopThread; - delete mRxLowerLoopThread; mOn = false; LOG(NOTICE) << "Transceiver stopped"; -- To view, visit https://gerrit.osmocom.org/2927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 15 23:17:45 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 23:17:45 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Fix USRP2/N200/N210 device detection In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2925 to look at the new patch set (#2). uhd: Fix USRP2/N200/N210 device detection Commit 1fb0ce67 "uhd: Use map container for for device parameter access" inadvertently removed the string identifier for the USRP2 and derived devices (N200/N210). Add the missing USRP2 string identifier. Also search for partial string matches in the UHD provided device and mboard stings. This is necessary to guarantee that strings such as "N200r3" instead of just "N200" are sucessfully found. Tested with N200, X310, B200mini and B210 devices. Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/25/2925/2 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ecf2c34..34a5181 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -526,25 +526,25 @@ { "E3XX", { E3XX, TX_WINDOW_FIXED } }, { "X300", { X3XX, TX_WINDOW_FIXED } }, { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, }; // Compare UHD motherboard and device strings */ - std::string found; - if (devStringMap.find(devString) != devStringMap.end()) - found = devString; - else if (devStringMap.find(mboardString) != devStringMap.end()) - found = mboardString; - - if (found.empty()) { - LOG(ALERT) << "Unsupported device " << devString; - return false; + auto mapIter = devStringMap.begin(); + while (mapIter != devStringMap.end()) { + if (devString.find(mapIter->first) != std::string::npos || + mboardString.find(mapIter->first) != std::string::npos) { + dev_type = std::get<0>(mapIter->second); + tx_window = std::get<1>(mapIter->second); + return true; + } + mapIter++; } - dev_type = devStringMap.at(found).first; - tx_window = devStringMap.at(found).second; - return true; + LOG(ALERT) << "Unsupported device " << devString; + return false; } /* -- To view, visit https://gerrit.osmocom.org/2925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 23:22:54 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 23:22:54 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Fix Tx-RX timing offset setting In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2926 to look at the new patch set (#2). uhd: Fix Tx-RX timing offset setting Integer timestamp offset was set to zero due to bad cast-operator precedence. Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/26/2926/2 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ecf2c34..233d465 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -437,7 +437,7 @@ tx_rate = usrp_dev->get_tx_rate(); rx_rate = usrp_dev->get_rx_rate(); - ts_offset = (TIMESTAMP) desc.offset * rx_rate; + ts_offset = static_cast(desc.offset * rx_rate); LOG(INFO) << "Rates configured for " << desc.str; } -- To view, visit https://gerrit.osmocom.org/2926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 15 23:30:48 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 15 Jun 2017 23:30:48 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations 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/2920 to look at the new patch set (#3). sigProcLib: Remove heap based signal vector allocations The osmo-trx internals rely heavily on dynamic alloction of I/Q signal vectors. In a number of cases there is no reason to to use dynamic rather than stack based allocation. Convert these cases accordingly. Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede --- M Transceiver52M/sigProcLib.cpp 1 file changed, 51 insertions(+), 84 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/2920/3 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 04391d6..a72ec43 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -585,7 +585,7 @@ int guardPeriodLength, int sps) { int burst_len; - signalVector *pulse, rotated, *shaped; + signalVector *pulse, rotated; signalVector::iterator itr; pulse = GSMPulse1->empty; @@ -602,11 +602,7 @@ rotated.isReal(false); /* Dummy filter operation */ - shaped = convolve(&rotated, pulse, NULL, START_ONLY); - if (!shaped) - return NULL; - - return shaped; + return convolve(&rotated, pulse, NULL, START_ONLY); } static void rotateBurst2(signalVector &burst, double phase) @@ -626,8 +622,7 @@ { int burst_len, sps = 4; float phase; - signalVector *c0_pulse, *c1_pulse, *c0_burst; - signalVector *c1_burst, *c0_shaped, *c1_shaped; + signalVector *c0_pulse, *c1_pulse, *c0_shaped, *c1_shaped; signalVector::iterator c0_itr, c1_itr; c0_pulse = GSMPulse4->c0; @@ -638,12 +633,12 @@ burst_len = 625; - c0_burst = new signalVector(burst_len, c0_pulse->size()); - c0_burst->isReal(true); - c0_itr = c0_burst->begin(); + signalVector c0_burst(burst_len, c0_pulse->size()); + c0_burst.isReal(true); + c0_itr = c0_burst.begin(); - c1_burst = new signalVector(burst_len, c1_pulse->size()); - c1_itr = c1_burst->begin(); + signalVector c1_burst(burst_len, c1_pulse->size()); + c1_itr = c1_burst.begin(); /* Padded differential tail bits */ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; @@ -659,10 +654,10 @@ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; /* Generate C0 phase coefficients */ - GMSKRotate(*c0_burst, sps); - c0_burst->isReal(false); + GMSKRotate(c0_burst, sps); + c0_burst.isReal(false); - c0_itr = c0_burst->begin(); + c0_itr = c0_burst.begin(); c0_itr += sps * 2; c1_itr += sps * 2; @@ -687,8 +682,8 @@ *c1_itr = *c0_itr * Complex(0, phase); /* Primary (C0) and secondary (C1) pulse shaping */ - c0_shaped = convolve(c0_burst, c0_pulse, NULL, START_ONLY); - c1_shaped = convolve(c1_burst, c1_pulse, NULL, START_ONLY); + c0_shaped = convolve(&c0_burst, c0_pulse, NULL, START_ONLY); + c1_shaped = convolve(&c1_burst, c1_pulse, NULL, START_ONLY); /* Sum shaped outputs into C0 */ c0_itr = c0_shaped->begin(); @@ -696,10 +691,7 @@ for (unsigned i = 0; i < c0_shaped->size(); i++ ) *c0_itr++ += *c1_itr++; - delete c0_burst; - delete c1_burst; delete c1_shaped; - return c0_shaped; } @@ -773,7 +765,6 @@ static signalVector *shapeEdgeBurst(const signalVector &symbols) { size_t nsyms, nsamps = 625, sps = 4; - signalVector *burst, *shape; signalVector::iterator burst_itr; nsyms = symbols.size(); @@ -781,10 +772,10 @@ if (nsyms * sps > nsamps) nsyms = 156; - burst = new signalVector(nsamps, GSMPulse4->c0->size()); + signalVector burst(nsamps, GSMPulse4->c0->size()); /* Delay burst by 1 symbol */ - burst_itr = burst->begin() + sps; + burst_itr = burst.begin() + sps; for (size_t i = 0; i < nsyms; i++) { float phase = i * 3.0f * M_PI / 8.0f; Complex rot = Complex(cos(phase), sin(phase)); @@ -794,10 +785,7 @@ } /* Single Gaussian pulse approximation shaping */ - shape = convolve(burst, GSMPulse4->c0, NULL, START_ONLY); - delete burst; - - return shape; + return convolve(&burst, GSMPulse4->c0, NULL, START_ONLY); } /* @@ -811,40 +799,36 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(148); - signalVector *burst; + BitVector bits(148); /* Tail bits */ for (; i < 3; i++) - (*bits)[i] = 0; + bits[i] = 0; /* Random bits */ for (; i < 60; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Training sequence */ for (int n = 0; i < 87; i++, n++) - (*bits)[i] = gTrainingSequence[tsc][n]; + bits[i] = gTrainingSequence[tsc][n]; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Random bits */ for (; i < 145; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 148; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 8 + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; - - return burst; + return modulateBurst(bits, guard, sps); } /* @@ -860,30 +844,26 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(88+delay); - signalVector *burst; + BitVector bits(88 + delay); /* delay */ for (; i < delay; i++) - (*bits)[i] = 0; + bits[i] = 0; /* head and synch bits */ for (int n = 0; i < 49+delay; i++, n++) - (*bits)[i] = gRACHBurst[n]; + bits[i] = gRACHBurst[n]; /* Random bits */ for (; i < 85+delay; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 88+delay; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 68-delay + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; - - return burst; + return modulateBurst(bits, guard, sps); } signalVector *generateEmptyBurst(int sps, int tn) @@ -920,17 +900,17 @@ if ((tsc < 0) || (tsc > 7)) return NULL; - signalVector *shape, *burst = new signalVector(148); + signalVector burst(148); const BitVector *midamble = &gEdgeTrainingSequence[tsc]; /* Tail */ int n, i = 0; for (; i < tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; /* Body */ for (; i < tail + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* TSC */ for (n = 0; i < tail + data + train; i++, n++) { @@ -938,21 +918,18 @@ (((unsigned) (*midamble)[3 * n + 1] & 0x01) << 1) | (((unsigned) (*midamble)[3 * n + 2] & 0x01) << 2); - (*burst)[i] = psk8_table[index]; + burst[i] = psk8_table[index]; } /* Body */ for (; i < tail + data + train + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* Tail */ for (; i < tail + data + train + data + tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; - shape = shapeEdgeBurst(*burst); - delete burst; - - return shape; + return shapeEdgeBurst(burst); } /* @@ -988,7 +965,7 @@ int guard_len, int sps) { int burst_len; - signalVector *pulse, *burst, *shaped; + signalVector *pulse; signalVector::iterator burst_itr; if (sps == 1) @@ -998,9 +975,9 @@ burst_len = sps * (bits.size() + guard_len); - burst = new signalVector(burst_len, pulse->size()); - burst->isReal(true); - burst_itr = burst->begin(); + signalVector burst(burst_len, pulse->size()); + burst.isReal(true); + burst_itr = burst.begin(); /* Raw bits are not differentially encoded */ for (unsigned i = 0; i < bits.size(); i++) { @@ -1008,15 +985,11 @@ burst_itr += sps; } - GMSKRotate(*burst, sps); - burst->isReal(false); + GMSKRotate(burst, sps); + burst.isReal(false); /* Single Gaussian pulse approximation shaping */ - shaped = convolve(burst, pulse, NULL, START_ONLY); - - delete burst; - - return shaped; + return convolve(&burst, pulse, NULL, START_ONLY); } /* Assume input bits are not differentially encoded */ @@ -1515,19 +1488,16 @@ static signalVector *downsampleBurst(const signalVector &burst) { - signalVector *in, *out; + signalVector in(DOWNSAMPLE_IN_LEN, dnsampler->len()); + signalVector *out = new signalVector(DOWNSAMPLE_OUT_LEN); + memcpy(in.begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); - out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - - if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, + if (dnsampler->rotate((float *) in.begin(), DOWNSAMPLE_IN_LEN, (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { delete out; out = NULL; } - delete in; return out; }; @@ -1620,7 +1590,6 @@ { int rc, start, len; bool clipping = false; - signalVector *corr; if ((sps != 1) && (sps != 4)) return -SIGERR_UNSUPPORTED; @@ -1636,12 +1605,10 @@ start = target - head - 1; len = head + tail; - corr = new signalVector(len); + signalVector corr(len); - rc = detectBurst(rxBurst, *corr, sync, + rc = detectBurst(rxBurst, corr, sync, thresh, sps, &, &toa, start, len); - delete corr; - if (rc < 0) { return -SIGERR_INTERNAL; } else if (!rc) { -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 16 08:05:32 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 08:05:32 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2924 to look at the new patch set (#2). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTX function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 533 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/2 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..ccadba7 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,7 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr_list * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..6e48828 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,485 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_list { + struct llist_head list; + struct osmo_ss7_instance *inst; + char *name; + struct osmo_sccp_addr *addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr_list * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_list *addr; + llist_for_each_entry(addr, &ss7->cfg.sccp_address_book, list) { + if (strcmp(addr->name, name) == 0) + return addr; + } + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_list *addr; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(addr, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", addr->name, VTY_NEWLINE); + switch (addr->addr->ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (addr->addr->presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(addr->inst, + addr->addr->pc), + VTY_NEWLINE); + if (addr->addr->presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", addr->addr->ssn, + VTY_NEWLINE); + if (addr->addr->presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + addr->addr->gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + addr->addr->gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + addr->addr->gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + addr->addr->gt.nai, VTY_NEWLINE); + if (strlen(addr->addr->gt.digits)) + vty_out(vty, " digits %s%s", + addr->addr->gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_list *addr; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(addr, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", addr->name); + + /* RI */ + switch (addr->addr->ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(addr->inst, + addr->addr->pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", addr->addr->ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &addr->addr->ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (addr->addr->presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &addr->addr->ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (addr->addr->presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", addr->addr->gt.gti); + vty_out(vty, "TT:%u ", addr->addr->gt.tt); + vty_out(vty, "NPI:%u ", addr->addr->gt.npi); + vty_out(vty, "NAI:%u ", addr->addr->gt.nai); + if (strlen(addr->addr->gt.digits)) + vty_out(vty, "%s ", addr->addr->gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address .NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_list *addr; + const char *name = argv[0]; + + addr = osmo_sccp_addr_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!addr) { + addr = talloc_zero(inst, struct osmo_sccp_addr_list); + addr->name = talloc_strdup(addr, name); + addr->addr = talloc_zero(addr, struct osmo_sccp_addr); + llist_add_tail(&addr->list, &inst->cfg.sccp_address_book); + addr->addr->ri = OSMO_SCCP_RI_SSN_PC; + } + + addr->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = addr; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address .NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_list *addr; + const char *name = argv[0]; + + addr = osmo_sccp_addr_by_name(name, inst); + if (addr) { + llist_del(&addr->list); + talloc_free(addr); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + switch (argv[0][0]) { + case 'G': + addr->addr->ri = OSMO_SCCP_RI_GT; + break; + case 'P': + addr->addr->ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + addr->addr->ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence |= OSMO_SCCP_ADDR_T_PC; + addr->addr->pc = osmo_ss7_pointcode_parse(addr->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_PC; + addr->addr->pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence |= OSMO_SCCP_ADDR_T_SSN; + addr->addr->ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_SSN; + addr->addr->ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + unsigned int rc; + OSMO_ASSERT(addr); + + addr->addr->presence |= OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + rc = inet_pton(AF_INET, argv[1], &addr->addr->ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + unsigned int rc; + OSMO_ASSERT(addr); + + addr->addr->presence |= OSMO_SCCP_ADDR_T_IPv6; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + rc = inet_pton(AF_INET6, argv[1], &addr->addr->ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv4; + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&addr->addr->ip, 0, sizeof(addr->addr->ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + addr->addr->presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->presence &= ~OSMO_SCCP_ADDR_T_GT; + memset(&addr->addr->gt, 0, sizeof(addr->addr->gt)); + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-255>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-4294967295>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-4294967295>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + addr->addr->gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits .DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_list *addr = + (struct osmo_sccp_addr_list *)vty->index; + OSMO_ASSERT(addr); + + if (strlen(argv[0]) > sizeof(addr->addr->gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(addr->addr->gt.digits, 0, sizeof(addr->addr->gt.digits)); + strcpy(addr->addr->gt.digits, argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1424,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1436,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_list *addr; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1460,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + addr = vty->index; + vty->node = L_CS7_NODE; + vty->index = addr->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1484,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1558,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 16 08:44:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 08:44:54 +0000 Subject: osmo-trx[master]: uhd: Fix Tx-RX timing offset setting In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 08:50:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 08:50:05 +0000 Subject: osmo-trx[master]: uhd: Fix USRP2/N200/N210 device detection In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 08:51:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 08:51:27 +0000 Subject: osmo-trx[master]: transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 10:52:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 16 Jun 2017 10:52:23 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Unuse resources after every test 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/2914 to look at the new patch set (#2). Unuse resources after every test Fix bug in put_all(). That method was unused before this commit. Clean the process list after the processes are stopped, otherwise the suite eventually fails with a 'process terminated prematurely' error. Before it was not necessary because it was not reused (a new suite run was created). Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 2 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/14/2914/2 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index dbfc4e0..8eec71e 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -508,11 +508,11 @@ my_item.pop(USED_KEY) def put_all(self): + if not self.reserved: + return for key, item_list in self.reserved.items(): - my_list = self.get(key) - for my_item in my_list: - if my_item.get(USED_KEY): - my_item.pop(USED_KEY) + for item in item_list: + item.pop(USED_KEY, None) def free(self): if self.reserved: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 73ce104..98ab4fe 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -237,6 +237,9 @@ test.set_skip() continue test.run() + self.stop_processes() + self.objects_cleanup() + self.reserved_resources.put_all() except Exception: log.log_exn() except BaseException as e: @@ -284,10 +287,8 @@ self._processes.insert(0, process) def stop_processes(self): - if not self._processes: - return - for process in self._processes: - process.terminate() + while self._processes: + self._processes.pop().terminate() def free_resources(self): if self.reserved_resources is None: -- To view, visit https://gerrit.osmocom.org/2914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 Gerrit-PatchSet: 2 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 Fri Jun 16 10:52:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 16 Jun 2017 10:52:23 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use a subdir of run_dir for each test 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/2915 to look at the new patch set (#2). Use a subdir of run_dir for each test Processes created have the scope of the test, so we should store everything in a per-suite_run/per-test directory, otherwise everything is stored in the same trial run_dir directory and it's really messy. Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/osmo_stp.py M src/osmo_gsm_tester/suite.py 9 files changed, 28 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/2915/2 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7d12c85..585647a 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -51,7 +51,7 @@ self.suite_run.poll() self.log('Starting to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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(OsmoBtsTrx.BIN_BTS_TRX))) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 30fff0e..eab0bdb 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -45,7 +45,7 @@ if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') log.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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(SysmoBts.BTS_SYSMO_BIN))) diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 5447118..efbda1f 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-bsc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() # NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 110faa5..19241cc 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-hlr') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-hlr'))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index b385274..db41dff 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -38,7 +38,7 @@ def start(self): self.log('Starting osmo-mgcpgw') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-msc'))) binary = inst.child('bin', 'osmo-bsc_mgcp') diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 24d8931..2c9b1e3 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -42,7 +42,7 @@ def start(self): self.log('Starting osmo-msc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-msc'))) binary = inst.child('bin', 'osmo-msc') diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 1830ced..3ef5276 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -41,7 +41,7 @@ def start(self): self.log('Starting osmo-nitb') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-nitb'))) binary = inst.child('bin', 'osmo-nitb') diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py index f1ad6fc..1aeb879 100644 --- a/src/osmo_gsm_tester/osmo_stp.py +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -36,7 +36,7 @@ def start(self): self.log('Starting osmo-stp') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 98ab4fe..5b24830 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -76,6 +76,8 @@ PASS = 'pass' FAIL = 'FAIL' + _run_dir = None + def __init__(self, suite_run, test_basename): self.basename = test_basename super().__init__(log.C_TST, self.basename) @@ -86,6 +88,11 @@ self.duration = 0 self.fail_type = None self.fail_message = None + + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name)) + return self._run_dir def run(self): try: @@ -165,6 +172,7 @@ _resource_requirements = None _config = None _processes = None + _run_dir = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): super().__init__(log.C_TST, suite_scenario_str) @@ -209,6 +217,17 @@ config.combine(combination, c) return combination + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.trial.get_run_dir().new_dir(self.name())) + return self._run_dir + + def get_test_run_dir(self): + if self.current_test: + return self.current_test.get_run_dir() + return self.get_run_dir() + + def resource_requirements(self): if self._resource_requirements is None: self._resource_requirements = self.combined('resources') @@ -236,6 +255,7 @@ if names and not test.name() in names: test.set_skip() continue + self.current_test = test test.run() self.stop_processes() self.objects_cleanup() -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 Gerrit-PatchSet: 2 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 Fri Jun 16 10:52:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 16 Jun 2017 10:52:23 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add support for SMPP testing 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/2884 to look at the new patch set (#4). Add support for SMPP testing As defined in [1], the different related actors are implemented in this commit: ESME and SMSC. SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or the MSC. A new Smsc abstract class is created to shared code between the NITB and the MSC, and also makes it easier for later when the SMSC is splitted. ESMEs can be dynamically added to its configuration in a similar way to how the BTSs are added. ESME: A new class Esme is created which can be used by tests to control an ESME to interact with the SMSC. The ESME functionalities are implemented using python-smpplib. Required version of this library is at least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support for python 3 and some required features to poll the socket. This commit already contains a few tests which checks different features and tests the API. Extending tested features or scenarios can be later done quite easily. The tests are not enabled by default right now, because there are several of them in a suite and the ip_address resources are not freed after every tests which ends up in the suite failing due to missing reserved resources. All the tests run alone work though. When the issue is fixed they can then be added to the default list of tests to be run. [1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da --- M selftest/template_test.ok M selftest/template_test.py M selftest/template_test/osmo-nitb.cfg.tmpl A src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/sms.py A src/osmo_gsm_tester/smsc.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/test.py A suites/aoip_smpp/esme_connect_policy_acceptall.py A suites/aoip_smpp/esme_connect_policy_closed.py A suites/aoip_smpp/esme_ms_sms.py A suites/aoip_smpp/suite.conf A suites/smpp/esme_connect_policy_acceptall.py A suites/smpp/esme_connect_policy_closed.py A suites/smpp/esme_ms_sms.py A suites/smpp/suite.conf 20 files changed, 574 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/2884/4 diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 1267dac..688361f 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -136,10 +136,13 @@ phys_chan_config val_phys_chan_config_3 smpp local-tcp-ip val_ip_address 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy val_smsc_policy + esme val_system_id_esme0 + password val_password_esme0 + default-route + esme val_system_id_esme1 + no password default-route ctrl bind val_ip_address diff --git a/selftest/template_test.py b/selftest/template_test.py index 45347b6..f8c32a5 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -35,6 +35,11 @@ ) } +mock_esme = { + 'system_id': 'val_system_id', + 'password': 'val_password' +} + def clone_mod(d, val_ext): c = dict(d) for name in c.keys(): @@ -47,6 +52,10 @@ mock_bts0 = clone_mod(mock_bts, '_bts0') mock_bts1 = clone_mod(mock_bts, '_bts1') +mock_esme0 = clone_mod(mock_esme, '_esme0') +mock_esme1 = clone_mod(mock_esme, '_esme1') +mock_esme1['password'] = '' + vals = dict(nitb=dict( net=dict( mcc='val_mcc', @@ -59,6 +68,10 @@ ), ip_address=dict(addr='val_ip_address'), ), + smsc=dict( + policy='val_smsc_policy', + esme_list=(mock_esme0, mock_esme1) + ), ) print(template.render('osmo-nitb.cfg', vals)) diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 3404b7f..7a76878 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -47,12 +47,18 @@ timer t3119 0 timer t3141 0 smpp - local-tcp-ip ${smpp_bind_ip} 2775 - system-id test - policy closed - esme test - password test - default-route + local-tcp-ip ${nitb.ip_address.addr} 2775 + system-id test-nitb + policy ${smsc.policy} + %for esme in esme_list: + esme ${esme.system_id} + % if esme.password == '': + no password + % else: + password ${esme.password} + % endif + default-route + %endfor ctrl bind ${ctrl_bind_ip} %for bts in bts_list: diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py new file mode 100644 index 0000000..f92863d --- /dev/null +++ b/src/osmo_gsm_tester/esme.py @@ -0,0 +1,138 @@ +# osmo_gsm_tester: SMPP ESME to talk to SMSC +# +# Copyright (C) 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 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 . + +import smpplib.gsm +import smpplib.client +import smpplib.consts +import smpplib.exceptions + +from . import log, util, event_loop, sms + +# if you want to know what's happening inside python-smpplib +#import logging +#logging.basicConfig(level='DEBUG') + +MAX_SYS_ID_LEN = 16 +MAX_PASSWD_LEN = 16 + +class Esme(log.Origin): + client = None + smsc = None + + def __init__(self, msisdn): + self.msisdn = msisdn + # Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator. + self.set_system_id('esme-' + self.msisdn[-11:]) + super().__init__(log.C_TST, self.system_id) + self.set_password('esme-pwd') + self.connected = False + self.bound = False + self.listening = False + + def __del__(self): + try: + self.disconnect() + except smpplib.exceptions.ConnectionError: + pass + + def set_smsc(self, smsc): + self.smsc = smsc + + def set_system_id(self, name): + if len(name) > MAX_SYS_ID_LEN: + raise log.Error('Esme system_id too long! %d vs %d', len(name), MAX_SYS_ID_LEN) + self.system_id = name + + def set_password(self, password): + if len(password) > MAX_PASSWD_LEN: + raise log.Error('Esme password too long! %d vs %d', len(password), MAX_PASSWD_LEN) + self.password = password + + def conf_for_smsc(self): + config = { 'system_id': self.system_id, 'password': self.password } + return config + + def poll(self): + self.client.poll() + + def start_listening(self): + self.listening = True + event_loop.register_poll_func(self.poll) + + def stop_listening(self): + if not self.listening: + return + self.listening = False + # Empty the queue before processing the unbind + disconnect PDUs + event_loop.unregister_poll_func(self.poll) + self.poll() + + def connect(self): + host, port = self.smsc.addr_port + if self.client: + self.disconnect() + self.client = smpplib.client.Client(host, port, timeout=None) + self.client.set_message_sent_handler( + lambda pdu: self.dbg('message sent:', repr(pdu)) ) + self.client.set_message_received_handler( + lambda pdu: self.dbg('message received:', repr(pdu)) ) + self.client.connect() + self.connected = True + self.client.bind_transceiver(system_id=self.system_id, password=self.password) + self.bound = True + self.log('Connected and bound successfully. Starting to listen') + self.start_listening() + + def disconnect(self): + self.stop_listening() + if self.bound: + self.client.unbind() + self.bound = False + if self.connected: + self.client.disconnect() + self.connected = False + + def run_method_expect_failure(self, errcode, method, *args): + try: + method(*args) + #it should not succeed, raise an exception: + raise log.Error('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) + except smpplib.exceptions.PDUError as e: + if e.args[1] != errcode: + raise e + + def sms_send(self, sms_obj): + parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) + + self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + for part in parts: + pdu = self.client.send_message( + source_addr_ton=smpplib.consts.SMPP_TON_INTL, + source_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + source_addr=sms_obj.src_msisdn(), + dest_addr_ton=smpplib.consts.SMPP_TON_INTL, + dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + destination_addr=sms_obj.dst_msisdn(), + short_message=part, + data_coding=encoding_flag, + esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, + registered_delivery=False, + ) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 443b254..24d8931 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -20,7 +20,7 @@ import os import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoMsc(log.Origin): suite_run = None @@ -30,6 +30,7 @@ process = None hlr = None config = None + smsc = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) @@ -37,6 +38,7 @@ self.ip_address = ip_address self.hlr = hlr self.mgcpgw = mgcpgw + self.smsc = smsc.Smsc((ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-msc') @@ -73,6 +75,7 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) + config.overlay(values, self.smsc.get_config()) self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3104842..1830ced 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -21,7 +21,7 @@ import re import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoNitb(log.Origin): suite_run = None @@ -30,12 +30,14 @@ config_file = None process = None bts = None + smsc = None def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address self.bts = [] + self.smsc = smsc.Smsc((ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-nitb') @@ -75,6 +77,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + config.overlay(values, self.smsc.get_config()) self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 570ef96..e264b66 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -21,14 +21,16 @@ _last_sms_idx = 0 msg = None - def __init__(self, from_msisdn=None, to_msisdn=None, *tokens): + def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): Sms._last_sms_idx += 1 + self._src_msisdn = src_msisdn + self._dst_msisdn = dst_msisdn msgs = ['message nr. %d' % Sms._last_sms_idx] msgs.extend(tokens) - if from_msisdn: - msgs.append('from %s' % from_msisdn) - if to_msisdn: - msgs.append('to %s' % to_msisdn) + if src_msisdn: + msgs.append('from %s' % src_msisdn) + if dst_msisdn: + msgs.append('to %s' % dst_msisdn) self.msg = ', '.join(msgs) def __str__(self): @@ -42,6 +44,12 @@ return self.msg == other.msg return self.msg == other + def src_msisdn(self): + return self._src_msisdn + + def dst_msisdn(self): + return self._dst_msisdn + def matches(self, msg): return self.msg == msg diff --git a/src/osmo_gsm_tester/smsc.py b/src/osmo_gsm_tester/smsc.py new file mode 100644 index 0000000..4837f37 --- /dev/null +++ b/src/osmo_gsm_tester/smsc.py @@ -0,0 +1,50 @@ +# osmo_gsm_tester: smsc interface +# +# 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 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 . + +from . import log, config, util, template, process + +class Smsc: + esmes = None + + SMSC_POLICY_CLOSED = 'closed' + SMSC_POLICY_ACCEPT_ALL = 'accept-all' + + def __init__(self, smpp_addr_port): + self.addr_port = smpp_addr_port + self.policy = self.SMSC_POLICY_CLOSED + self.esmes = [] + + def get_config(self): + values = { 'smsc': { 'policy': self.policy } } + esme_list = [] + for esme in self.esmes: + esme_list.append(esme.conf_for_smsc()) + config.overlay(values, dict(smsc=dict(esme_list=esme_list))) + return values + + def esme_add(self, esme): + if esme.system_id == '': + raise log.Error('esme system_id cannot be empty') + self.esmes.append(esme) + esme.set_smsc(self) + + def set_smsc_policy(self, smsc_policy): + self.policy = smsc_policy + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 5c567f8..73ce104 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import copy import traceback import pprint -from . import config, log, template, util, resource, schema, ofono_client, event_loop +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 test @@ -92,7 +92,7 @@ log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop, sms) with self.redirect_stdout(): util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) @@ -343,8 +343,12 @@ l.append(self.modem()) return l + def esme(self): + esme_obj = esme.Esme(self.msisdn()) + return esme_obj + def msisdn(self): - msisdn = self.resources_pool.next_msisdn(self.origin) + msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) return msisdn diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 247365e..89982e0 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -23,10 +23,16 @@ bind ${msc.ip_address.addr} smpp local-tcp-ip ${msc.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-msc + policy ${smsc.policy} +%for esme in smsc.esme_list: + esme ${esme.system_id} +% if esme.password == '': + no password +% else: + password ${esme.password} +% endif default-route +%endfor hlr remote-ip ${hlr.ip_address.addr} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index a47ac02..23cc225 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -76,10 +76,16 @@ %endfor smpp local-tcp-ip ${nitb.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy ${smsc.policy} +%for esme in smsc.esme_list: + esme ${esme.system_id} +% if esme.password == '': + no password +% else: + password ${esme.password} +% endif default-route +%endfor ctrl bind ${nitb.ip_address.addr} diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..49911b3 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,9 +33,10 @@ poll = None prompt = None Timeout = None +Sms = None -def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout +def setup(suite_run, _test, ofono_client, suite_module, event_module, sms_module): + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms trial = suite_run.trial suite = suite_run test = _test @@ -49,5 +50,6 @@ poll = event_module.poll prompt = suite_run.prompt Timeout = suite_module.Timeout + Sms = sms_module.Sms # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..2a954d5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on +# the config file + +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) +smsc = msc.smsc +esme = suite.esme() + +# Here we deliberately omit calling smsc.esme_add() to avoid having it included +# in the smsc config. +smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL) +esme.set_smsc(smsc) + +hlr.start() +msc.start() +mgcpgw.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. +log('Test connect with non-empty values in system_id and password') +esme.set_system_id('foo') +esme.set_password('bar') +esme.connect() +esme.disconnect() + +log('Test connect with empty values in system_id and password') +esme.set_system_id('') +esme.set_password('') +esme.connect() +esme.disconnect() diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..29b25d1 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_closed.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +smsc = msc.smsc + +esme = suite.esme() +esme_no_pwd = suite.esme() +esme_no_pwd.set_password('') + +smsc.set_smsc_policy(smsc.SMSC_POLICY_CLOSED) +smsc.esme_add(esme) +smsc.esme_add(esme_no_pwd) + +hlr.start() +msc.start() +mgcpgw.start() + +log('Test with correct credentials (no password)') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials (no password, non empty)') +esme_no_pwd.set_password('foobar') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials') +esme.connect() +esme.disconnect() + +log('Test with bad password, checking for failure') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +log('Test with bad system_id, checking for failure') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms.py new file mode 100755 index 0000000..7f9ef18 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +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() +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.smsc.esme_add(esme) + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) +ms.connect(msc.mcc_mnc()) + +ms.log_info() +print('waiting for modem to attach...') +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf new file mode 100644 index 0000000..46f8d09 --- /dev/null +++ b/suites/aoip_smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s diff --git a/suites/smpp/esme_connect_policy_acceptall.py b/suites/smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..d22703d --- /dev/null +++ b/suites/smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on +# the config file + +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +smsc = nitb.smsc +esme = suite.esme() + +# Here we deliberately omit calling smsc.esme_add() to avoid having it included +# in the smsc config. +smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL) +esme.set_smsc(smsc) + +nitb.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. +log('Test connect with non-empty values in system_id and password') +esme.set_system_id('foo') +esme.set_password('bar') +esme.connect() +esme.disconnect() + +log('Test connect with empty values in system_id and password') +esme.set_system_id('') +esme.set_password('') +esme.connect() +esme.disconnect() diff --git a/suites/smpp/esme_connect_policy_closed.py b/suites/smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..7fac276 --- /dev/null +++ b/suites/smpp/esme_connect_policy_closed.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +nitb = suite.nitb() +smsc = nitb.smsc +esme = suite.esme() +esme_no_pwd = suite.esme() +esme_no_pwd.set_password('') + +smsc.set_smsc_policy(smsc.SMSC_POLICY_CLOSED) +smsc.esme_add(esme) +smsc.esme_add(esme_no_pwd) + +nitb.start() + +log('Test with correct credentials (no password)') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials (no password, non empty)') +esme_no_pwd.set_password('foobar') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials') +esme.connect() +esme.disconnect() + +log('Test with bad password, checking for failure') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +log('Test with bad system_id, checking for failure') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py new file mode 100755 index 0000000..bc9d7d4 --- /dev/null +++ b/suites/smpp/esme_ms_sms.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.smsc.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) +ms.connect(nitb.mcc_mnc()) + +ms.log_info() +print('waiting for modem to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 4 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 Fri Jun 16 11:21:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 16 Jun 2017 11:21:29 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote 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/2747 to look at the new patch set (#4). OsmoBTS: Update osmotrx ip to diff between local and remote Change Id of the code implementation: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/47/2747/4 diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index 1c619d3..40a86e2 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -226,8 +226,14 @@ ===== `osmotrx ip HOST` -Set the IP address of the OsmoTRX transceiver to which we should connect -to. +Set the IP address for the OsmoTRX interface for both the local (OsmoBTS) and +remote (OsmoTRX) side of the UDP flows. This option has been deprecated by the +more detailed option `osmotrx ip (local|remote) A.B.C.D`. + +===== `osmotrx ip (local|remote) A.B.C.D` + +Set the IP address for the OsmoTRX interface for either the local (OsmoBTS) or +remote (OsmoTRX) side of the UDP flows. ===== `osmotrx base-port (local|remote) <0-65535>` -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals 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 Fri Jun 16 11:43:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 11:43:40 +0000 Subject: [PATCH] osmo-bts[master]: Move parameter file opening into separate function Message-ID: Review at https://gerrit.osmocom.org/2928 Move parameter file opening into separate function * use talloc for file path allocation * print detailed error on failures This simplifies troubleshooting of lc15bts-mgr failures. Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c Related: SYS#3686 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_util.c 5 files changed, 52 insertions(+), 61 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/28/2928/1 diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index 903c5fe..549c179 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -116,7 +116,7 @@ } /* fetch the serial number */ - lc15bts_par_get_int(LC15BTS_PAR_SERNR, &serno); + lc15bts_par_get_int(tall_mgr_ctx, LC15BTS_PAR_SERNR, &serno); snprintf(ser_str, sizeof(ser_str), "%d", serno); /* fetch the model and trx number */ diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index 5ff8e31..fa59b7c 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -114,12 +114,13 @@ for (i = 0; i < ARRAY_SIZE(temp_data); i++) { int ret; - rc = lc15bts_par_get_int(temp_data[i].ee_par, &ret); + rc = lc15bts_par_get_int(tall_mgr_ctx, temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); if (temp_cur[i] < 0 && temp_cur[i] > -1000) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d)\n", temp_data[i].sensor); + LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d): unexpected value %d\n", + temp_data[i].sensor, temp_cur[i]); continue; } @@ -132,8 +133,7 @@ temp_cur[i]/1000, temp_old[i]%1000); if (!no_rom_write) { - rc = lc15bts_par_set_int(temp_data[i].ee_par, - temp_cur[i]/1000); + rc = lc15bts_par_set_int(tall_mgr_ctx, temp_data[i].ee_par, temp_cur[i]/1000); if (rc < 0) LOGP(DTEMP, LOGL_ERROR, "error writing new %s " "max temp %d (%s)\n", temp_data[i].name, @@ -157,7 +157,7 @@ if (last_update == 0) { last_update = now; - rc = lc15bts_par_get_int(LC15BTS_PAR_HOURS, &op_hrs); + rc = lc15bts_par_get_int(tall_mgr_ctx, LC15BTS_PAR_HOURS, &op_hrs); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Unable to read " "operational hours: %d (%s)\n", rc, @@ -172,7 +172,7 @@ } if (now >= last_update + 3600) { - rc = lc15bts_par_get_int(LC15BTS_PAR_HOURS, &op_hrs); + rc = lc15bts_par_get_int(tall_mgr_ctx, LC15BTS_PAR_HOURS, &op_hrs); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Unable to read " "operational hours: %d (%s)\n", rc, @@ -187,7 +187,7 @@ op_hrs); if (!no_rom_write) { - rc = lc15bts_par_set_int(LC15BTS_PAR_HOURS, op_hrs); + rc = lc15bts_par_set_int(tall_mgr_ctx, LC15BTS_PAR_HOURS, op_hrs); if (rc < 0) return rc; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 3d80e67..ab3e96b 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -35,12 +35,9 @@ #include #include +#include #include "lc15bts_par.h" - - -#define FACTORY_ROM_PATH "/mnt/rom/factory" -#define USER_ROM_PATH "/mnt/rom/user" const struct value_string lc15bts_par_names[_NUM_LC15BTS_PAR+1] = { { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, @@ -80,19 +77,32 @@ } } -int lc15bts_par_get_int(enum lc15bts_par par, int *ret) +FILE *lc15bts_par_get_path(void *ctx, enum lc15bts_par par, const char* mode) { - char fpath[PATH_MAX]; + char *fpath; FILE *fp; - int rc; if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; + return NULL; - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; + fpath = talloc_asprintf(ctx, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); + if (!fpath) + return NULL; - fp = fopen(fpath, "r"); + fp = fopen(fpath, mode); + if (!fp) + fprintf(stderr, "Failed to open %s due to '%s' error\n", fpath, strerror(errno)); + + talloc_free(fpath); + + return fp; +} + +int lc15bts_par_get_int(void *ctx, enum lc15bts_par par, int *ret) +{ + FILE *fp = lc15bts_par_get_path(ctx, par, "r"); + int rc; + if (fp == NULL) { return -errno; } @@ -106,19 +116,11 @@ return 0; } -int lc15bts_par_set_int(enum lc15bts_par par, int val) +int lc15bts_par_set_int(void *ctx, enum lc15bts_par par, int val) { - char fpath[PATH_MAX]; - FILE *fp; + FILE *fp = lc15bts_par_get_path(ctx, par, "w"); int rc; - if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; - - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; - - fp = fopen(fpath, "w"); if (fp == NULL) { return -errno; } @@ -132,20 +134,11 @@ return 0; } -int lc15bts_par_get_buf(enum lc15bts_par par, uint8_t *buf, - unsigned int size) +int lc15bts_par_get_buf(void *ctx, enum lc15bts_par par, uint8_t *buf, unsigned int size) { - char fpath[PATH_MAX]; - FILE *fp; + FILE *fp = lc15bts_par_get_path(ctx, par, "rb"); int rc; - if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; - - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; - - fp = fopen(fpath, "rb"); if (fp == NULL) { return -errno; } @@ -157,20 +150,11 @@ return rc; } -int lc15bts_par_set_buf(enum lc15bts_par par, const uint8_t *buf, - unsigned int size) +int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size) { - char fpath[PATH_MAX]; - FILE *fp; + FILE *fp = lc15bts_par_get_path(ctx, par, "wb"); int rc; - if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; - - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; - - fp = fopen(fpath, "wb"); if (fp == NULL) { return -errno; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index c50a69f..b9fe740 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -3,6 +3,9 @@ #include +#define FACTORY_ROM_PATH "/mnt/rom/factory" +#define USER_ROM_PATH "/mnt/rom/user" + enum lc15bts_par { LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, @@ -22,12 +25,10 @@ extern const struct value_string lc15bts_par_names[_NUM_LC15BTS_PAR+1]; -int lc15bts_par_get_int(enum lc15bts_par par, int *ret); -int lc15bts_par_set_int(enum lc15bts_par par, int val); -int lc15bts_par_get_buf(enum lc15bts_par par, uint8_t *buf, - unsigned int size); -int lc15bts_par_set_buf(enum lc15bts_par par, const uint8_t *buf, - unsigned int size); +int lc15bts_par_get_int(void *ctx, enum lc15bts_par par, int *ret); +int lc15bts_par_set_int(void *ctx, enum lc15bts_par par, int val); +int lc15bts_par_get_buf(void *ctx, enum lc15bts_par par, uint8_t *buf, unsigned int size); +int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size); int lc15bts_par_is_int(enum lc15bts_par par); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_util.c b/src/osmo-bts-litecell15/misc/lc15bts_util.c index 33f9e4e..430ce0f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_util.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_util.c @@ -28,9 +28,12 @@ #include #include #include - +#include +#include #include "lc15bts_par.h" + +void *tall_util_ctx; enum act { ACT_GET, @@ -101,6 +104,9 @@ enum lc15bts_par par; int rc, val; + tall_util_ctx = talloc_named_const(NULL, 1, "lc15 utils"); + msgb_talloc_ctx_init(tall_util_ctx, 0); + rc = parse_options(argc, argv); if (rc < 0) exit(2); @@ -120,7 +126,7 @@ switch (action) { case ACT_GET: - rc = lc15bts_par_get_int(par, &val); + rc = lc15bts_par_get_int(tall_util_ctx, par, &val); if (rc < 0) { fprintf(stderr, "Error %d\n", rc); goto err; @@ -128,7 +134,7 @@ printf("%d\n", val); break; case ACT_SET: - rc = lc15bts_par_get_int(par, &val); + rc = lc15bts_par_get_int(tall_util_ctx, par, &val); if (rc < 0) { fprintf(stderr, "Error %d\n", rc); goto err; @@ -137,7 +143,7 @@ fprintf(stderr, "Parameter is already set!\r\n"); goto err; } - rc = lc15bts_par_set_int(par, atoi(write_arg)); + rc = lc15bts_par_set_int(tall_util_ctx, par, atoi(write_arg)); if (rc < 0) { fprintf(stderr, "Error %d\n", rc); goto err; -- To view, visit https://gerrit.osmocom.org/2928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 16 12:43:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 12:43:20 +0000 Subject: [PATCH] osmo-bts[master]: lc15bts-mgr: use extended config file example Message-ID: Review at https://gerrit.osmocom.org/2929 lc15bts-mgr: use extended config file example Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92 Related: SYS#3686 --- M doc/examples/litecell15/lc15bts-mgr.cfg 1 file changed, 41 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/2929/1 diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index 27ed326..e7c9926 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -1,15 +1,17 @@ ! -! SysmoMgr (0.3.0.141-33e5) configuration saved from vty +! lc15bts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty !! ! log stderr logging filter all 1 logging color 1 + logging print category 0 logging timestamp 0 logging level all everything logging level temp info logging level fw info logging level find info + logging level calib info logging level lglobal notice logging level llapd notice logging level linp notice @@ -17,8 +19,46 @@ logging level lmi notice logging level lmib notice logging level lsms notice + logging level lctrl notice + logging level lgtp notice ! line vty no login ! lc15bts-mgr + limits supply + threshold warning 60 + threshold critical 78 + limits soc + threshold warning 60 + threshold critical 78 + limits fpga + threshold warning 60 + threshold critical 78 + limits logrf + threshold warning 60 + threshold critical 78 + limits tx0 + threshold warning 60 + threshold critical 78 + limits tx1 + threshold warning 60 + threshold critical 78 + limits pa0 + threshold warning 60 + threshold critical 78 + limits pa1 + threshold warning 60 + threshold critical 78 + actions normal + pa0-on + pa1-on + bts-service-on + actions warn + no pa0-off + no pa1-off + no bts-service-off + actions critical + pa0-off + pa1-off + no bts-service-off -- To view, visit https://gerrit.osmocom.org/2929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 16 12:51:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 12:51:08 +0000 Subject: [PATCH] osmo-bts[master]: measurement: improve log output Message-ID: Review at https://gerrit.osmocom.org/2930 measurement: improve log output The code that receives the uplink measurement data from L1 does not print the number of already received uplink measurements. Since this is a valuable information when debugging the log output will now print this information as well. (Patch by Octasic Inc.) Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 --- M src/common/measurement.c 1 file changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/30/2930/1 diff --git a/src/common/measurement.c b/src/common/measurement.c index 6ddc05a..d494a59 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -146,13 +146,16 @@ gsm_lchan_name(lchan), lchan->meas.num_ul_meas); if (lchan->state != LCHAN_S_ACTIVE) { - LOGP(DMEAS, LOGL_NOTICE, "%s measurement during state: %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + LOGP(DMEAS, LOGL_NOTICE, + "%s measurement during state: %s, num_ul_meas=%d\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), + lchan->meas.num_ul_meas); } if (lchan->meas.num_ul_meas >= ARRAY_SIZE(lchan->meas.uplink)) { - LOGP(DMEAS, LOGL_NOTICE, "%s no space for uplink measurement\n", - gsm_lchan_name(lchan)); + LOGP(DMEAS, LOGL_NOTICE, + "%s no space for uplink measurement, num_ul_meas=%d\n", + gsm_lchan_name(lchan), lchan->meas.num_ul_meas); return -ENOSPC; } -- To view, visit https://gerrit.osmocom.org/2930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 12:51:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 12:51:08 +0000 Subject: [PATCH] osmo-bts[master]: measurement: initalize lchan properly Message-ID: Review at https://gerrit.osmocom.org/2931 measurement: initalize lchan properly When the TX channel is activated, the measurement related struct members are not properly reset. To ensure all flags are initalized properly we set the measurement related flags zu zero. (Patch by Octasic Inc.) Change-Id: I02edc4724f3d272905bee13384628aca18ea9781 --- M src/common/rsl.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/31/2931/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index bb05dec..4f24bbf 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -597,8 +597,13 @@ rsl_dch_push_hdr(msg, RSL_MT_CHAN_ACTIV_ACK, chan_nr); msg->trx = lchan->ts->trx; - /* since activation was successful, do some lchan initialization */ + /* since activation was successful, do some + * lchan initialization for measurement */ lchan->meas.res_nr = 0; + lchan->meas.flags = 0; + lchan->meas.num_ul_meas = 0; + lchan->meas.num_sacch_bfi = 0; + lchan->meas.num_tch_bfi = 0; return abis_bts_rsl_sendmsg(msg); } -- To view, visit https://gerrit.osmocom.org/2931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02edc4724f3d272905bee13384628aca18ea9781 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 12:51:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 12:51:08 +0000 Subject: [PATCH] osmo-bts[master]: octphy: improve log output Message-ID: Review at https://gerrit.osmocom.org/2932 octphy: improve log output Printing the RX payload size is strictly informative, so the loglevel LOGL_ERROR is wrong. This commit changes it to LOGL_DEBUG (Patch by Octasic Inc.) Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897 --- M src/osmo-bts-octphy/l1_tch.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/2932/1 diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 7393e73..5693313 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -194,7 +194,7 @@ &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; if (data_ind->Data.ulDataLength < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", + LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/2932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 12:51:08 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 12:51:08 +0000 Subject: [PATCH] osmo-bts[master]: octphy: complete value strings (octphy_cid_vals) Message-ID: Review at https://gerrit.osmocom.org/2933 octphy: complete value strings (octphy_cid_vals) The value string table octphy_cid_vals lacks the strings for cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID and cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID (Patch by Octasic Inc.) Change-Id: I9843137b55534a29938d5c2308244a6950de788f --- M src/osmo-bts-octphy/l1_utils.c M src/osmo-bts-octphy/l1_utils.h 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/2933/1 diff --git a/src/osmo-bts-octphy/l1_utils.c b/src/osmo-bts-octphy/l1_utils.c index ac5e217..8a8e155 100644 --- a/src/osmo-bts-octphy/l1_utils.c +++ b/src/osmo-bts-octphy/l1_utils.c @@ -22,6 +22,7 @@ #include "l1_utils.h" #include #include +#include #include const struct value_string octphy_l1sapi_names[23] = @@ -79,7 +80,7 @@ { 0, NULL } }; -const struct value_string octphy_cid_vals[35] = { +const struct value_string octphy_cid_vals[37] = { { cOCTVC1_GSM_MSG_TRX_OPEN_CID, "TRX-OPEN" }, { cOCTVC1_GSM_MSG_TRX_CLOSE_CID, "TRX-CLOSE" }, { cOCTVC1_GSM_MSG_TRX_STATUS_CID, "TRX-STATUS" }, @@ -116,6 +117,8 @@ { cOCTVC1_GSM_MSG_TAP_FILTER_INFO_CID, "TAP-FILTER-INFO" }, { cOCTVC1_GSM_MSG_TAP_FILTER_STATS_CID, "TAP-FILTER-STATS" }, { cOCTVC1_GSM_MSG_TAP_FILTER_MODIFY_CID, "TAP-FILTER-MODIFY" }, + { cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID, "MAIN_MSG_APP_INFO" }, + { cOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CID, "MAIN_MSG_APP_INFO_SYSTEM" }, { cOCTVC1_GSM_MSG_TRX_START_LOGICAL_CHANNEL_RAW_DATA_INDICATIONS_CID, "LCHAN-RAW-DATA-START" }, { cOCTVC1_GSM_MSG_TRX_STOP_LOGICAL_CHANNEL_RAW_DATA_INDICATIONS_CID, diff --git a/src/osmo-bts-octphy/l1_utils.h b/src/osmo-bts-octphy/l1_utils.h index cec9f75..d1a8717 100644 --- a/src/osmo-bts-octphy/l1_utils.h +++ b/src/osmo-bts-octphy/l1_utils.h @@ -5,5 +5,5 @@ const struct value_string octphy_l1sapi_names[23]; const struct value_string octphy_dir_names[5]; const struct value_string octphy_clkmgr_state_vals[8]; -const struct value_string octphy_cid_vals[35]; +const struct value_string octphy_cid_vals[37]; const struct value_string octphy_eid_vals[7]; -- To view, visit https://gerrit.osmocom.org/2933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9843137b55534a29938d5c2308244a6950de788f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 12:54:55 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 12:54:55 +0000 Subject: [PATCH] openbsc[master]: lchan: add members for BFI Message-ID: Review at https://gerrit.osmocom.org/2934 lchan: add members for BFI The lchan struct lacks structures to keep track of the BFI (Bad Frame Indication) counters. This commit adds the needed structures. (Patch by Octasic Inc.) Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/2934/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index d3fd757..6cecc78 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -314,6 +314,8 @@ uint8_t bts_tx_pwr; /* number of measurements stored in array below */ uint8_t num_ul_meas; + uint32_t num_sacch_bfi; + uint32_t num_tch_bfi; struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; /* last L1 header from the MS */ uint8_t l1_info[2]; -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 14:08:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 14:08:13 +0000 Subject: [PATCH] osmo-bts[master]: lc15: use directory instead of symlink Message-ID: Review at https://gerrit.osmocom.org/2935 lc15: use directory instead of symlink Use the directory populated by lc15-sysdev-remap directly instead of symlink to it to simplify OE builds and troubleshooting. Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 Related: SYS#3686 --- M src/osmo-bts-litecell15/hw_misc.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c M src/osmo-bts-litecell15/misc/lc15bts_clock.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_temp.c 6 files changed, 29 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/2935/1 diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index 49232b2..a2ec31b 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -63,7 +63,7 @@ return -EINVAL; } - fd = open("/var/lc15/leds/led0/brightness", O_WRONLY); + fd = open("/var/volatile/lc15/leds/led0/brightness", O_WRONLY); if (fd < 0) return -ENODEV; @@ -73,7 +73,7 @@ } close(fd); - fd = open("/var/lc15/leds/led1/brightness", O_WRONLY); + fd = open("/var/volatile/lc15/leds/led1/brightness", O_WRONLY); if (fd < 0) return -ENODEV; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 06a126a..bd88f7e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -27,8 +27,8 @@ #include "lc15bts_bid.h" -#define BOARD_REV_SYSFS "/var/lc15/platform/revision" -#define BOARD_OPT_SYSFS "/var/lc15/platform/option" +#define BOARD_REV_SYSFS "/var/volatile/lc15/platform/revision" +#define BOARD_OPT_SYSFS "/var/volatile/lc15/platform/option" static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index f4df5d3..0d62a35 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -27,15 +27,15 @@ #include "lc15bts_clock.h" -#define CLKERR_ERR_SYSFS "/var/lc15/clkerr/clkerr1_average" -#define CLKERR_ACC_SYSFS "/var/lc15/clkerr/clkerr1_average_accuracy" -#define CLKERR_INT_SYSFS "/var/lc15/clkerr/clkerr1_average_interval" -#define CLKERR_FLT_SYSFS "/var/lc15/clkerr/clkerr1_fault" -#define CLKERR_RFS_SYSFS "/var/lc15/clkerr/refresh" -#define CLKERR_RST_SYSFS "/var/lc15/clkerr/reset" +#define CLKERR_ERR_SYSFS "/var/volatile/lc15/clkerr/clkerr1_average" +#define CLKERR_ACC_SYSFS "/var/volatile/lc15/clkerr/clkerr1_average_accuracy" +#define CLKERR_INT_SYSFS "/var/volatile/lc15/clkerr/clkerr1_average_interval" +#define CLKERR_FLT_SYSFS "/var/volatile/lc15/clkerr/clkerr1_fault" +#define CLKERR_RFS_SYSFS "/var/volatile/lc15/clkerr/refresh" +#define CLKERR_RST_SYSFS "/var/volatile/lc15/clkerr/reset" -#define OCXODAC_VAL_SYSFS "/var/lc15/ocxo/voltage" -#define OCXODAC_ROM_SYSFS "/var/lc15/ocxo/eeprom" +#define OCXODAC_VAL_SYSFS "/var/volatile/lc15/ocxo/voltage" +#define OCXODAC_ROM_SYSFS "/var/volatile/lc15/ocxo/eeprom" /* clock error */ static int clkerr_fd_err = -1; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index 903c5fe..8fcd7e6 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -47,7 +47,7 @@ #include #include -#define ETH0_ADDR_SYSFS "/var/lc15/net/eth0/address" +#define ETH0_ADDR_SYSFS "/var/volatile/lc15/net/eth0/address" static struct osmo_fd nl_fd; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index 5b01d36..6d01608 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -30,18 +30,18 @@ #define LC15BTS_PA_VOLTAGE 24000000 -#define PA_SUPPLY_MIN_SYSFS "/var/lc15/pa-supply/min_microvolts" -#define PA_SUPPLY_MAX_SYSFS "/var/lc15/pa-supply/max_microvolts" +#define PA_SUPPLY_MIN_SYSFS "/var/volatile/lc15/pa-supply/min_microvolts" +#define PA_SUPPLY_MAX_SYSFS "/var/volatile/lc15/pa-supply/max_microvolts" static const char *power_enable_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_PA0] = "/var/lc15/pa-state/pa0/state", - [LC15BTS_POWER_PA1] = "/var/lc15/pa-state/pa1/state", + [LC15BTS_POWER_PA0] = "/var/volatile/lc15/pa-state/pa0/state", + [LC15BTS_POWER_PA1] = "/var/volatile/lc15/pa-state/pa1/state", }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", - [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", - [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", + [LC15BTS_POWER_SUPPLY] = "/var/volatile/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_PA0] = "/var/volatile/lc15/pwr-sense/pa0/", + [LC15BTS_POWER_PA1] = "/var/volatile/lc15/pwr-sense/pa1/", }; static const char *power_sensor_type_str[_NUM_POWER_TYPES] = { diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index aa35854..d62c037 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -31,15 +31,15 @@ static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", - [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", - [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", - [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", - [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", - [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", - [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", - [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", - [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", + [LC15BTS_TEMP_SUPPLY] = "/var/volatile/lc15/temp/pa-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/volatile/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/volatile/lc15/temp/fpga/temp", + [LC15BTS_TEMP_LOGRF] = "/var/volatile/lc15/temp/logrf/temp", + [LC15BTS_TEMP_OCXO] = "/var/volatile/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/volatile/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/volatile/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/volatile/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/volatile/lc15/temp/pa1/temp", }; int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:20:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 15:20:34 +0000 Subject: osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Patch Set 1: It would be even better to use RuntimeDirectory= option for script's oneshot service but this would require modifications to lc15-sysdev-remap to use /run paths. -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:23:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 15:23:49 +0000 Subject: osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 15:38:26 +0000 Subject: [PATCH] osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2935 to look at the new patch set (#2). lc15: use directory instead of symlink Use the runtime directory populated by lc15-sysdev-remap.service directly instead of symlink to it to simplify OE builds and troubleshooting. Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 Related: SYS#3686 --- M src/osmo-bts-litecell15/hw_misc.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c M src/osmo-bts-litecell15/misc/lc15bts_clock.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_temp.c 6 files changed, 29 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/2935/2 diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index 49232b2..ba6bd54 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -63,7 +63,7 @@ return -EINVAL; } - fd = open("/var/lc15/leds/led0/brightness", O_WRONLY); + fd = open("/run/lc15/leds/led0/brightness", O_WRONLY); if (fd < 0) return -ENODEV; @@ -73,7 +73,7 @@ } close(fd); - fd = open("/var/lc15/leds/led1/brightness", O_WRONLY); + fd = open("/run/lc15/leds/led1/brightness", O_WRONLY); if (fd < 0) return -ENODEV; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 06a126a..07f7e9e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -27,8 +27,8 @@ #include "lc15bts_bid.h" -#define BOARD_REV_SYSFS "/var/lc15/platform/revision" -#define BOARD_OPT_SYSFS "/var/lc15/platform/option" +#define BOARD_REV_SYSFS "/run/lc15/platform/revision" +#define BOARD_OPT_SYSFS "/run/lc15/platform/option" static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index f4df5d3..65f79b7 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -27,15 +27,15 @@ #include "lc15bts_clock.h" -#define CLKERR_ERR_SYSFS "/var/lc15/clkerr/clkerr1_average" -#define CLKERR_ACC_SYSFS "/var/lc15/clkerr/clkerr1_average_accuracy" -#define CLKERR_INT_SYSFS "/var/lc15/clkerr/clkerr1_average_interval" -#define CLKERR_FLT_SYSFS "/var/lc15/clkerr/clkerr1_fault" -#define CLKERR_RFS_SYSFS "/var/lc15/clkerr/refresh" -#define CLKERR_RST_SYSFS "/var/lc15/clkerr/reset" +#define CLKERR_ERR_SYSFS "/run/lc15/clkerr/clkerr1_average" +#define CLKERR_ACC_SYSFS "/run/lc15/clkerr/clkerr1_average_accuracy" +#define CLKERR_INT_SYSFS "/run/lc15/clkerr/clkerr1_average_interval" +#define CLKERR_FLT_SYSFS "/run/lc15/clkerr/clkerr1_fault" +#define CLKERR_RFS_SYSFS "/run/lc15/clkerr/refresh" +#define CLKERR_RST_SYSFS "/run/lc15/clkerr/reset" -#define OCXODAC_VAL_SYSFS "/var/lc15/ocxo/voltage" -#define OCXODAC_ROM_SYSFS "/var/lc15/ocxo/eeprom" +#define OCXODAC_VAL_SYSFS "/run/lc15/ocxo/voltage" +#define OCXODAC_ROM_SYSFS "/run/lc15/ocxo/eeprom" /* clock error */ static int clkerr_fd_err = -1; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index 903c5fe..9a1de6c 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -47,7 +47,7 @@ #include #include -#define ETH0_ADDR_SYSFS "/var/lc15/net/eth0/address" +#define ETH0_ADDR_SYSFS "/run/lc15/net/eth0/address" static struct osmo_fd nl_fd; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index 5b01d36..b20d374 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -30,18 +30,18 @@ #define LC15BTS_PA_VOLTAGE 24000000 -#define PA_SUPPLY_MIN_SYSFS "/var/lc15/pa-supply/min_microvolts" -#define PA_SUPPLY_MAX_SYSFS "/var/lc15/pa-supply/max_microvolts" +#define PA_SUPPLY_MIN_SYSFS "/run/lc15/pa-supply/min_microvolts" +#define PA_SUPPLY_MAX_SYSFS "/run/lc15/pa-supply/max_microvolts" static const char *power_enable_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_PA0] = "/var/lc15/pa-state/pa0/state", - [LC15BTS_POWER_PA1] = "/var/lc15/pa-state/pa1/state", + [LC15BTS_POWER_PA0] = "/run/lc15/pa-state/pa0/state", + [LC15BTS_POWER_PA1] = "/run/lc15/pa-state/pa1/state", }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", - [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", - [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", + [LC15BTS_POWER_SUPPLY] = "/run/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_PA0] = "/run/lc15/pwr-sense/pa0/", + [LC15BTS_POWER_PA1] = "/run/lc15/pwr-sense/pa1/", }; static const char *power_sensor_type_str[_NUM_POWER_TYPES] = { diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index aa35854..5ff5f4a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -31,15 +31,15 @@ static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", - [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", - [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", - [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", - [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", - [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", - [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", - [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", - [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", + [LC15BTS_TEMP_SUPPLY] = "/run/lc15/temp/pa-supply/temp", + [LC15BTS_TEMP_SOC] = "/run/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/run/lc15/temp/fpga/temp", + [LC15BTS_TEMP_LOGRF] = "/run/lc15/temp/logrf/temp", + [LC15BTS_TEMP_OCXO] = "/run/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/run/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/run/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/run/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/run/lc15/temp/pa1/temp", }; int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:28 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator 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/2820 to look at the new patch set (#3). gsm0808: fix AoIP speech codec element parser/generator The implementation of the parser/generator for the speech codec information element slightly wrong, making it impossible to use it properly. (See also: 3GPP TS 48.008, 3.2.2.103) Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 138 insertions(+), 79 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/2820/3 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index f1c8629..968bd46 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -447,8 +447,6 @@ bool tf; uint8_t type; uint16_t cfg; - bool type_extended; - bool cfg_present; }; /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index bdd02e5..d32edbe 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -151,6 +151,32 @@ /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; uint8_t *old_tail; + bool type_extended = false; + + /* Note: Extended codec types are codec types that require 8 instead + * of 4 bit to fully specify the selected codec. In the following, + * we check if we work with an extended type or not. We also check + * if the codec type is valid at all. */ + switch(sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_FR3: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR1: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR4: + case GSM0808_SCT_HR6: + type_extended = false; + break; + case GSM0808_SCT_CSD: + type_extended = true; + break; + default: + /* Invalid codec type specified */ + OSMO_ASSERT(false); + break; + } old_tail = msg->tail; @@ -162,20 +188,37 @@ header |= (1 << 5); if (sc->tf) header |= (1 << 4); - if (sc->type_extended) { + + if (type_extended) { header |= 0x0f; msgb_put_u8(msg, header); + msgb_put_u8(msg, sc->type); } else { OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); - return (uint8_t) (msg->tail - old_tail); } - msgb_put_u8(msg, sc->type); - - if (sc->cfg_present) + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one + * or two octets, depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + default: + OSMO_ASSERT(sc->cfg == 0); + break; + } return (uint8_t) (msg->tail - old_tail); } @@ -244,21 +287,44 @@ if ((header & 0x0F) != 0x0F) { sc->type = (header & 0x0F); - return (int)(elem - old_elem); + } else { + sc->type = *elem; + elem++; + len--; } - sc->type = *elem; - elem++; - len--; - - sc->type_extended = true; - - if (len < 2) - return (int)(elem - old_elem); - - sc->cfg = osmo_load16be(elem); - elem += 2; - sc->cfg_present = true; + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one or + * two octets depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR1: + break; + case GSM0808_SCT_FR2: + break; + case GSM0808_SCT_HR1: + break; + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: + if(len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + default: + /* Invalid codec type => malformed speech codec element! */ + return -EINVAL; + break; + } return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8304052..68771a4 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -49,19 +49,17 @@ scl->codec[0].pi = true; scl->codec[0].tf = true; - scl->codec[0].type = 0xab; - scl->codec[0].type_extended = true; - scl->codec[0].cfg_present = true; + scl->codec[0].type = GSM0808_SCT_FR3; scl->codec[0].cfg = 0xcdef; scl->codec[1].fi = true; scl->codec[1].pt = true; - scl->codec[1].type = 0x05; + scl->codec[1].type = GSM0808_SCT_FR2; scl->codec[2].fi = true; scl->codec[2].tf = true; - scl->codec[2].type = 0xf2; - scl->codec[2].type_extended = true; + scl->codec[2].type = GSM0808_SCT_CSD; + scl->codec[2].cfg = 0xc0; scl->len = 3; } @@ -89,8 +87,9 @@ static const uint8_t res[] = { 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, - 0xa5, 0x9f, 0xf2 + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, + 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg, *in_msg; @@ -282,9 +281,10 @@ static const uint8_t res2[] = { 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, 0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, - 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, - 0xef, 0xa5, 0x9f, 0xf2, GSM0808_IE_CALL_ID, 0xaa, 0xbb, 0xcc, - 0xdd }; + 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, + GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb, + 0xcc, 0xdd }; struct msgb *msg; struct gsm0808_channel_type ct; @@ -351,9 +351,9 @@ static const uint8_t res[] = { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04, - 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, 0x9a, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, - 0x9f, 0xf2 }; + 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90, + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg; memset(&sin, 0, sizeof(sin)); @@ -367,7 +367,7 @@ memset(&sc, 0, sizeof(sc)); sc.fi = true; sc.tf = true; - sc.type = 0x0a; + sc.type = GSM0808_SCT_HR1; setup_codec_list(&sc_list); @@ -400,11 +400,12 @@ { static const uint8_t res1[] = { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, - 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, + 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; static const uint8_t res2[] = { 0x00, 0x0f, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, - 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; uint8_t rr_res = 2; struct msgb *msg; struct gsm0808_speech_codec_list sc_list; @@ -574,7 +575,7 @@ memset(&enc_sc, 0, sizeof(enc_sc)); enc_sc.fi = true; enc_sc.pt = true; - enc_sc.type = 0x05; + enc_sc.type = GSM0808_SCT_FR2; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); @@ -589,6 +590,31 @@ } +static void test_gsm0808_enc_dec_speech_codec_with_cfg() +{ + struct gsm0808_speech_codec enc_sc; + struct gsm0808_speech_codec dec_sc; + struct msgb *msg; + uint8_t rc_enc; + int rc_dec; + + enc_sc.pi = true; + enc_sc.tf = true; + enc_sc.type = GSM0808_SCT_FR3; + enc_sc.cfg = 0xabcd; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); + OSMO_ASSERT(rc_enc == 5); + + rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + + OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() { struct gsm0808_speech_codec enc_sc; @@ -599,44 +625,15 @@ enc_sc.pi = true; enc_sc.tf = true; - enc_sc.type = 0xab; - enc_sc.type_extended = true; - enc_sc.cfg_present = true; - enc_sc.cfg = 0xcdef; + enc_sc.type = GSM0808_SCT_CSD; + enc_sc.cfg = 0xc0; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 6); + OSMO_ASSERT(rc_enc == 5); rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 4); - - OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); - - msgb_free(msg); -} - -static void test_gsm0808_enc_dec_speech_codec_ext() -{ - struct gsm0808_speech_codec enc_sc; - struct gsm0808_speech_codec dec_sc; - struct msgb *msg; - uint8_t rc_enc; - int rc_dec; - - enc_sc.fi = true; - enc_sc.tf = true; - enc_sc.type = 0xf2; - enc_sc.type_extended = true; - enc_sc.cfg_present = false; - enc_sc.cfg = 0x0000; - - msg = msgb_alloc(1024, "output buffer"); - rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 4); - - rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 2); + OSMO_ASSERT(rc_dec == 3); OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); @@ -655,19 +652,17 @@ enc_scl.codec[0].pi = true; enc_scl.codec[0].tf = true; - enc_scl.codec[0].type = 0xab; - enc_scl.codec[0].type_extended = true; - enc_scl.codec[0].cfg_present = true; + enc_scl.codec[0].type = GSM0808_SCT_FR3; enc_scl.codec[0].cfg = 0xcdef; enc_scl.codec[1].fi = true; enc_scl.codec[1].pt = true; - enc_scl.codec[1].type = 0x05; + enc_scl.codec[1].type = GSM0808_SCT_FR2; enc_scl.codec[2].fi = true; enc_scl.codec[2].tf = true; - enc_scl.codec[2].type = 0xf2; - enc_scl.codec[2].type_extended = true; + enc_scl.codec[2].type = GSM0808_SCT_CSD; + enc_scl.codec[2].cfg = 0xc0; enc_scl.len = 3; @@ -860,8 +855,8 @@ test_enc_dec_aoip_trasp_addr_v4(); test_enc_dec_aoip_trasp_addr_v6(); test_gsm0808_enc_dec_speech_codec(); - test_gsm0808_enc_dec_speech_codec_ext(); test_gsm0808_enc_dec_speech_codec_ext_with_cfg(); + test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_channel_type(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:28 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: update permitted speech constants 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/2811 to look at the new patch set (#5). gsm0808: update permitted speech constants 3GPP TS 48.008 specifies two new half rate speech modes and two new full rate speech modes. This patch adds the matching constants to enum gsm0808_permitted_speech Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/2811/5 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5552b1b 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,19 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/* GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { GSM0808_PERM_FR1 = 0x01, GSM0808_PERM_FR2 = 0x11, GSM0808_PERM_FR3 = 0x21, + GSM0808_PERM_FR4 = 0x41, /* OFR AMR-WB */ + GSM0808_PERM_FR5 = 0x42, /* FR AMR-WB */ GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_HR4 = 0x46, /* OHR AMR-WB */ + GSM0808_PERM_HR6 = 0x45, /* OHR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d 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 Fri Jun 16 15:38:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:28 +0000 Subject: [PATCH] libosmocore[master]: gsm0408: update bearer capability speech version 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/2812 to look at the new patch set (#5). gsm0408: update bearer capability speech version 3GPP TS 24.008 specifies two new speech versions for half rate and two new speech modes for full rate. This patch adds the relevant constants to enum gsm48_bcap_speech_ver in gsm_04_08.h Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/2812/5 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 124f8b7..5c4f362 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1620,13 +1620,18 @@ GSM48_BCAP_MT_AUTO_1 = 8, }; -/* GSM 04.08 Bearer Capability: Speech Version Indication */ +/* GSM 04.08 Bearer Capability: Speech Version Indication + * (See also 3GPP TS 24.008, Table 10.5.103) */ enum gsm48_bcap_speech_ver { GSM48_BCAP_SV_FR = 0, GSM48_BCAP_SV_HR = 1, GSM48_BCAP_SV_EFR = 2, GSM48_BCAP_SV_AMR_F = 4, GSM48_BCAP_SV_AMR_H = 5, + GSM48_BCAP_SV_AMR_OFW = 6, /* GSM FR V4 (OFR AMR-WB) */ + GSM48_BCAP_SV_AMR_OHW = 7, /* GSM HR V4 (OHR AMR-WB) */ + GSM48_BCAP_SV_AMR_FW = 8, /* GSM FR V5 (FR AMR-WB) */ + GSM48_BCAP_SV_AMR_OH = 11, /* GSM HR V6 (OHR AMR) */ }; #define GSM48_TMSI_LEN 5 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 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 Fri Jun 16 15:38:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:28 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... 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/2830 to look at the new patch set (#4). gsm0808: add function to translate perm speech to speech codec type The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 43 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/4 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..59f64ca 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,8 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +/* Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index d32edbe..5ff280a 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -647,4 +647,41 @@ return (int)(elem - old_elem); } +/*! \brief Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec + * \param[in] perm_spch to be converted + * \returns GSM speech codec type; negative on error */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) +{ + /* The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + } + + /* Invalid input */ + return -EINVAL; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9613c4e..ccc5b9a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:28 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() 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/2831 to look at the new patch set (#4). gsm0808: add function gsm0808_extrapolate_speech_codec() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 63 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/4 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 59f64ca..2a53508 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -76,3 +76,7 @@ * that is used in struct gsm0808_channel_type to the speech codec * representation we use in struct gsm0808_speech_codec */ int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); + +/* Extrapolate a speech codec field from a given permitted speech parameter */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 5ff280a..8282f02 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -684,4 +684,62 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted + * speech parameter + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value from where the speech codec is derived from + * \returns zero when successfull; negative on error */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + /*! Note: This function accepts the permitted speech configuration + * from the channel type information and computes an AoIP speech + * codec that field that consistently matches the channel type + * configuration. This reflects a a non-transcoding-situation. + * (In transcoding scenarios, the codec used in the RTP stream + * may be differ from the codec used on the air interface) */ + + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codc + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + default: + return -EINVAL; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:31 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:31 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: remove API documentation strings in header file Message-ID: Review at https://gerrit.osmocom.org/2936 cosmetic: remove API documentation strings in header file Typically we don't place comments with the function declarations in .h files. Not sure why this file has comments for each. The API doc belongs in the .c file as proper doxygen comments, and shouldn't be duplicated in the .h file. Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad --- M include/osmocom/gsm/gsm0808_utils.h 1 file changed, 0 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/2936/1 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 2a53508..3e59ab0 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -23,60 +23,31 @@ #include -/* Encode AoIP transport address element */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss); - -/* Decode AoIP transport address element */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec element */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc); - -/* Decode Speech Codec element */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec list */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl); - -/* Decode Speech Codec list */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len); - -/* Encode Channel Type element */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct); - -/* Decode Channel Type element */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len); - -/* Encode Encryption Information element */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei); - -/* Decode Encryption Information element */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len); - -/* Encode Cell Identifier List element */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil); - -/* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); - -/* Convert the representation of the permitted speech codec identifier - * that is used in struct gsm0808_channel_type to the speech codec - * representation we use in struct gsm0808_speech_codec */ int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); - -/* Extrapolate a speech codec field from a given permitted speech parameter */ int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:32 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:32 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add codec references to Speech Version Indication Message-ID: Review at https://gerrit.osmocom.org/2937 cosmetic: Add codec references to Speech Version Indication Add the information which GSM Speech codec version coresponds to which bearer capability speech version. Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/2937/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 5c4f362..4c33b35 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1623,11 +1623,11 @@ /* GSM 04.08 Bearer Capability: Speech Version Indication * (See also 3GPP TS 24.008, Table 10.5.103) */ enum gsm48_bcap_speech_ver { - GSM48_BCAP_SV_FR = 0, - GSM48_BCAP_SV_HR = 1, - GSM48_BCAP_SV_EFR = 2, - GSM48_BCAP_SV_AMR_F = 4, - GSM48_BCAP_SV_AMR_H = 5, + GSM48_BCAP_SV_FR = 0, /* GSM FR V1 (GSM FR) */ + GSM48_BCAP_SV_HR = 1, /* GSM HR V1 (GSM HR) */ + GSM48_BCAP_SV_EFR = 2, /* GSM FR V2 (GSM EFR) */ + GSM48_BCAP_SV_AMR_F = 4, /* GSM FR V3 (FR AMR) */ + GSM48_BCAP_SV_AMR_H = 5, /* GSM HR V3 (HR_AMR) */ GSM48_BCAP_SV_AMR_OFW = 6, /* GSM FR V4 (OFR AMR-WB) */ GSM48_BCAP_SV_AMR_OHW = 7, /* GSM HR V4 (OHR AMR-WB) */ GSM48_BCAP_SV_AMR_FW = 8, /* GSM FR V5 (FR AMR-WB) */ -- To view, visit https://gerrit.osmocom.org/2937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 15:38:32 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 16 Jun 2017 15:38:32 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add info about corespondig codecs to permittet speech Message-ID: Review at https://gerrit.osmocom.org/2938 cosmetic: Add info about corespondig codecs to permittet speech The constants in enum gsm0808_permitted_speech are not very expressive. This patch adds a comment which tells to which codec the constand is coresponding. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/2938/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 8aab9a9..ef55d49 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -394,14 +394,14 @@ /* GSM 08.08 3.2.2.11 Channel Type * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, + GSM0808_PERM_FR1 = 0x01, /* GSM FR */ + GSM0808_PERM_FR2 = 0x11, /* GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /* FR AMR */ GSM0808_PERM_FR4 = 0x41, /* OFR AMR-WB */ GSM0808_PERM_FR5 = 0x42, /* FR AMR-WB */ - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /* GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /* (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /* HR AMR */ GSM0808_PERM_HR4 = 0x46, /* OHR AMR-WB */ GSM0808_PERM_HR6 = 0x45, /* OHR AMR */ }; -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:01:52 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:01:52 +0000 Subject: osmo-trx[master]: uhd: Fix Tx-RX timing offset setting In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:02:05 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:02:05 +0000 Subject: osmo-trx[master]: uhd: Fix USRP2/N200/N210 device detection In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:02:17 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:02:17 +0000 Subject: osmo-trx[master]: transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:02:38 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:02:38 +0000 Subject: [MERGED] osmo-trx[master]: uhd: Fix Tx-RX timing offset setting In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: uhd: Fix Tx-RX timing offset setting ...................................................................... uhd: Fix Tx-RX timing offset setting Integer timestamp offset was set to zero due to bad cast-operator precedence. Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Max: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index ecf2c34..233d465 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -437,7 +437,7 @@ tx_rate = usrp_dev->get_tx_rate(); rx_rate = usrp_dev->get_rx_rate(); - ts_offset = (TIMESTAMP) desc.offset * rx_rate; + ts_offset = static_cast(desc.offset * rx_rate); LOG(INFO) << "Rates configured for " << desc.str; } -- To view, visit https://gerrit.osmocom.org/2926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1f524cc86416699b3c143e5faddb33d61380767 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:02:45 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:02:45 +0000 Subject: [MERGED] osmo-trx[master]: uhd: Fix USRP2/N200/N210 device detection In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: uhd: Fix USRP2/N200/N210 device detection ...................................................................... uhd: Fix USRP2/N200/N210 device detection Commit 1fb0ce67 "uhd: Use map container for for device parameter access" inadvertently removed the string identifier for the USRP2 and derived devices (N200/N210). Add the missing USRP2 string identifier. Also search for partial string matches in the UHD provided device and mboard stings. This is necessary to guarantee that strings such as "N200r3" instead of just "N200" are sucessfully found. Tested with N200, X310, B200mini and B210 devices. Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 12 insertions(+), 12 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Max: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 233d465..833f02f 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -526,25 +526,25 @@ { "E3XX", { E3XX, TX_WINDOW_FIXED } }, { "X300", { X3XX, TX_WINDOW_FIXED } }, { "X310", { X3XX, TX_WINDOW_FIXED } }, + { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, }; // Compare UHD motherboard and device strings */ - std::string found; - if (devStringMap.find(devString) != devStringMap.end()) - found = devString; - else if (devStringMap.find(mboardString) != devStringMap.end()) - found = mboardString; - - if (found.empty()) { - LOG(ALERT) << "Unsupported device " << devString; - return false; + auto mapIter = devStringMap.begin(); + while (mapIter != devStringMap.end()) { + if (devString.find(mapIter->first) != std::string::npos || + mboardString.find(mapIter->first) != std::string::npos) { + dev_type = std::get<0>(mapIter->second); + tx_window = std::get<1>(mapIter->second); + return true; + } + mapIter++; } - dev_type = devStringMap.at(found).first; - tx_window = devStringMap.at(found).second; - return true; + LOG(ALERT) << "Unsupported device " << devString; + return false; } /* -- To view, visit https://gerrit.osmocom.org/2925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ide4e22418e2cc469418cba018970cb0eb9906697 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:04:26 +0000 Subject: [MERGED] osmo-trx[master]: transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices ...................................................................... transceiver: Fix POWEROFF crash on USRP2/N200/X300 devices Upon issuing POWEROFF command to a running transceiver, UHD interfacing thread state may become undefined if the device is stopped with I/O threads still active. Bad behavior is device dependent with only network based USRP devices affected. USB based device thread behavior stops and shutdowns as expected. Tested with N200, X300, and B210. Tested solutions include the following: 1. Set pthread_setcanceltype() with PTHREAD_CANCEL_ASYNCHRONOUS 2. Add sleep delay to allow I/O threads to timeout before stopping the device 3. Wait for I/O threads to join after cancellation before stopping the device This patch resolves the issue by with the third approach. Number 1 is not guaranteed to always work with UHD internals as driver code may explicitly set thread parameters. Using sleep calls to fix order-of-operation issues is almost never a good idea. Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c --- M Transceiver52M/Transceiver.cpp 1 file changed, 4 insertions(+), 5 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Max: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 66eff7f..61da416 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -297,6 +297,10 @@ LOG(NOTICE) << "Stopping the transceiver"; mTxLowerLoopThread->cancel(); mRxLowerLoopThread->cancel(); + mTxLowerLoopThread->join(); + mRxLowerLoopThread->join(); + delete mTxLowerLoopThread; + delete mRxLowerLoopThread; for (size_t i = 0; i < mChans; i++) { mRxServiceLoopThreads[i]->cancel(); @@ -314,11 +318,6 @@ mTxPriorityQueues[i].clear(); } - - mTxLowerLoopThread->join(); - mRxLowerLoopThread->join(); - delete mTxLowerLoopThread; - delete mRxLowerLoopThread; mOn = false; LOG(NOTICE) << "Transceiver stopped"; -- To view, visit https://gerrit.osmocom.org/2927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib72ab98a27a02084b040319046c92d1c4157ae4c Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:09:07 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:09:07 +0000 Subject: osmo-trx[master]: sigProcLib: Fix complex/real vector flag in Laurent modulator In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03afc6a93a01fde7a9a02e4eb9d201d3ee37d21a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:09:09 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:09:09 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Fix complex/real vector flag in Laurent modulator In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Fix complex/real vector flag in Laurent modulator ...................................................................... sigProcLib: Fix complex/real vector flag in Laurent modulator The modulator vector to be shaped by Laurent C1 pulse is complex, but was set as real. The error does not affect behaviour because we only support complex-complex and complex-real calculations; real-real convolution is not supported. So in this case the data vector was already assumed to be complex despite the improper flag setting. Change-Id: I03afc6a93a01fde7a9a02e4eb9d201d3ee37d21a --- M Transceiver52M/sigProcLib.cpp 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 3a9a529..04391d6 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -643,7 +643,6 @@ c0_itr = c0_burst->begin(); c1_burst = new signalVector(burst_len, c1_pulse->size()); - c1_burst->isReal(true); c1_itr = c1_burst->begin(); /* Padded differential tail bits */ -- To view, visit https://gerrit.osmocom.org/2921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I03afc6a93a01fde7a9a02e4eb9d201d3ee37d21a Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:11:14 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:11:14 +0000 Subject: osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:32:49 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:32:49 +0000 Subject: [PATCH] osmo-trx[master]: common: Declare explicit Vector move constructor Message-ID: Review at https://gerrit.osmocom.org/2939 common: Declare explicit Vector move constructor Vector class already has a semantically odd non-const copy constructor that serves the same function as a C++11 move constructor. Make the move constructor semantics explicit and address Coverity at the same time. Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Fixes: Coverity CID 170738 --- M CommonLibs/Vector.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/39/2939/1 diff --git a/CommonLibs/Vector.h b/CommonLibs/Vector.h index eae674b..86183af 100644 --- a/CommonLibs/Vector.h +++ b/CommonLibs/Vector.h @@ -119,7 +119,7 @@ Vector(size_t wSize=0):mData(NULL) { resize(wSize); } /** Build a Vector by shifting the data block. */ - Vector(Vector& other) + Vector(Vector&& other) :mData(other.mData),mStart(other.mStart),mEnd(other.mEnd) { other.mData=NULL; } -- To view, visit https://gerrit.osmocom.org/2939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Fri Jun 16 17:34:13 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Fri, 16 Jun 2017 17:34:13 +0000 Subject: [PATCH] osmo-trx[master]: common: Declare explicit Vector move constructor In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2939 to look at the new patch set (#2). common: Declare explicit Vector move constructor Vector class already has a semantically odd non-const copy constructor that serves the same function as a C++11 move constructor. Make the move constructor semantics explicit and address Coverity at the same time. Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Fixes: Coverity CID 170738 --- M CommonLibs/Vector.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/39/2939/2 diff --git a/CommonLibs/Vector.h b/CommonLibs/Vector.h index eae674b..15d6710 100644 --- a/CommonLibs/Vector.h +++ b/CommonLibs/Vector.h @@ -118,8 +118,8 @@ /** Build an empty Vector of a given size. */ Vector(size_t wSize=0):mData(NULL) { resize(wSize); } - /** Build a Vector by shifting the data block. */ - Vector(Vector& other) + /** Build a Vector by moving another. */ + Vector(Vector&& other) :mData(other.mData),mStart(other.mStart),mEnd(other.mEnd) { other.mData=NULL; } -- To view, visit https://gerrit.osmocom.org/2939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 16 18:17:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 16 Jun 2017 18:17:53 +0000 Subject: [PATCH] osmo-bts[master]: RSL: check for abnormal SI2q values Message-ID: Review at https://gerrit.osmocom.org/2940 RSL: check for abnormal SI2q values Check for impossible index and count values of SI2q messages. The limit is defined in 3GPP TS 44.018 Table 10.5.2.33b.1 Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d Fixes: CID 170749 --- M src/common/rsl.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/2940/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index bb05dec..187a2e7 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -315,6 +315,12 @@ return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > SI2Q_MAX_NUM) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn impossible parameters: index %u, count %u" + "should be <= %u\n", bts->si2q_index, bts->si2q_count, SI2Q_MAX_NUM); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + 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); break; -- To view, visit https://gerrit.osmocom.org/2940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sat Jun 17 00:22:47 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Sat, 17 Jun 2017 00:22:47 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Remove heap based signal vector allocations In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Remove heap based signal vector allocations ...................................................................... sigProcLib: Remove heap based signal vector allocations The osmo-trx internals rely heavily on dynamic alloction of I/Q signal vectors. In a number of cases there is no reason to to use dynamic rather than stack based allocation. Convert these cases accordingly. Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede --- M Transceiver52M/sigProcLib.cpp 1 file changed, 51 insertions(+), 84 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 04391d6..a72ec43 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -585,7 +585,7 @@ int guardPeriodLength, int sps) { int burst_len; - signalVector *pulse, rotated, *shaped; + signalVector *pulse, rotated; signalVector::iterator itr; pulse = GSMPulse1->empty; @@ -602,11 +602,7 @@ rotated.isReal(false); /* Dummy filter operation */ - shaped = convolve(&rotated, pulse, NULL, START_ONLY); - if (!shaped) - return NULL; - - return shaped; + return convolve(&rotated, pulse, NULL, START_ONLY); } static void rotateBurst2(signalVector &burst, double phase) @@ -626,8 +622,7 @@ { int burst_len, sps = 4; float phase; - signalVector *c0_pulse, *c1_pulse, *c0_burst; - signalVector *c1_burst, *c0_shaped, *c1_shaped; + signalVector *c0_pulse, *c1_pulse, *c0_shaped, *c1_shaped; signalVector::iterator c0_itr, c1_itr; c0_pulse = GSMPulse4->c0; @@ -638,12 +633,12 @@ burst_len = 625; - c0_burst = new signalVector(burst_len, c0_pulse->size()); - c0_burst->isReal(true); - c0_itr = c0_burst->begin(); + signalVector c0_burst(burst_len, c0_pulse->size()); + c0_burst.isReal(true); + c0_itr = c0_burst.begin(); - c1_burst = new signalVector(burst_len, c1_pulse->size()); - c1_itr = c1_burst->begin(); + signalVector c1_burst(burst_len, c1_pulse->size()); + c1_itr = c1_burst.begin(); /* Padded differential tail bits */ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; @@ -659,10 +654,10 @@ *c0_itr = 2.0 * (0x00 & 0x01) - 1.0; /* Generate C0 phase coefficients */ - GMSKRotate(*c0_burst, sps); - c0_burst->isReal(false); + GMSKRotate(c0_burst, sps); + c0_burst.isReal(false); - c0_itr = c0_burst->begin(); + c0_itr = c0_burst.begin(); c0_itr += sps * 2; c1_itr += sps * 2; @@ -687,8 +682,8 @@ *c1_itr = *c0_itr * Complex(0, phase); /* Primary (C0) and secondary (C1) pulse shaping */ - c0_shaped = convolve(c0_burst, c0_pulse, NULL, START_ONLY); - c1_shaped = convolve(c1_burst, c1_pulse, NULL, START_ONLY); + c0_shaped = convolve(&c0_burst, c0_pulse, NULL, START_ONLY); + c1_shaped = convolve(&c1_burst, c1_pulse, NULL, START_ONLY); /* Sum shaped outputs into C0 */ c0_itr = c0_shaped->begin(); @@ -696,10 +691,7 @@ for (unsigned i = 0; i < c0_shaped->size(); i++ ) *c0_itr++ += *c1_itr++; - delete c0_burst; - delete c1_burst; delete c1_shaped; - return c0_shaped; } @@ -773,7 +765,6 @@ static signalVector *shapeEdgeBurst(const signalVector &symbols) { size_t nsyms, nsamps = 625, sps = 4; - signalVector *burst, *shape; signalVector::iterator burst_itr; nsyms = symbols.size(); @@ -781,10 +772,10 @@ if (nsyms * sps > nsamps) nsyms = 156; - burst = new signalVector(nsamps, GSMPulse4->c0->size()); + signalVector burst(nsamps, GSMPulse4->c0->size()); /* Delay burst by 1 symbol */ - burst_itr = burst->begin() + sps; + burst_itr = burst.begin() + sps; for (size_t i = 0; i < nsyms; i++) { float phase = i * 3.0f * M_PI / 8.0f; Complex rot = Complex(cos(phase), sin(phase)); @@ -794,10 +785,7 @@ } /* Single Gaussian pulse approximation shaping */ - shape = convolve(burst, GSMPulse4->c0, NULL, START_ONLY); - delete burst; - - return shape; + return convolve(&burst, GSMPulse4->c0, NULL, START_ONLY); } /* @@ -811,40 +799,36 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(148); - signalVector *burst; + BitVector bits(148); /* Tail bits */ for (; i < 3; i++) - (*bits)[i] = 0; + bits[i] = 0; /* Random bits */ for (; i < 60; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Training sequence */ for (int n = 0; i < 87; i++, n++) - (*bits)[i] = gTrainingSequence[tsc][n]; + bits[i] = gTrainingSequence[tsc][n]; /* Stealing bit */ - (*bits)[i++] = 0; + bits[i++] = 0; /* Random bits */ for (; i < 145; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 148; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 8 + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; - - return burst; + return modulateBurst(bits, guard, sps); } /* @@ -860,30 +844,26 @@ return NULL; int i = 0; - BitVector *bits = new BitVector(88+delay); - signalVector *burst; + BitVector bits(88 + delay); /* delay */ for (; i < delay; i++) - (*bits)[i] = 0; + bits[i] = 0; /* head and synch bits */ for (int n = 0; i < 49+delay; i++, n++) - (*bits)[i] = gRACHBurst[n]; + bits[i] = gRACHBurst[n]; /* Random bits */ for (; i < 85+delay; i++) - (*bits)[i] = rand() % 2; + bits[i] = rand() % 2; /* Tail bits */ for (; i < 88+delay; i++) - (*bits)[i] = 0; + bits[i] = 0; int guard = 68-delay + !(tn % 4); - burst = modulateBurst(*bits, guard, sps); - delete bits; - - return burst; + return modulateBurst(bits, guard, sps); } signalVector *generateEmptyBurst(int sps, int tn) @@ -920,17 +900,17 @@ if ((tsc < 0) || (tsc > 7)) return NULL; - signalVector *shape, *burst = new signalVector(148); + signalVector burst(148); const BitVector *midamble = &gEdgeTrainingSequence[tsc]; /* Tail */ int n, i = 0; for (; i < tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; /* Body */ for (; i < tail + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* TSC */ for (n = 0; i < tail + data + train; i++, n++) { @@ -938,21 +918,18 @@ (((unsigned) (*midamble)[3 * n + 1] & 0x01) << 1) | (((unsigned) (*midamble)[3 * n + 2] & 0x01) << 2); - (*burst)[i] = psk8_table[index]; + burst[i] = psk8_table[index]; } /* Body */ for (; i < tail + data + train + data; i++) - (*burst)[i] = psk8_table[rand() % 8]; + burst[i] = psk8_table[rand() % 8]; /* Tail */ for (; i < tail + data + train + data + tail; i++) - (*burst)[i] = psk8_table[7]; + burst[i] = psk8_table[7]; - shape = shapeEdgeBurst(*burst); - delete burst; - - return shape; + return shapeEdgeBurst(burst); } /* @@ -988,7 +965,7 @@ int guard_len, int sps) { int burst_len; - signalVector *pulse, *burst, *shaped; + signalVector *pulse; signalVector::iterator burst_itr; if (sps == 1) @@ -998,9 +975,9 @@ burst_len = sps * (bits.size() + guard_len); - burst = new signalVector(burst_len, pulse->size()); - burst->isReal(true); - burst_itr = burst->begin(); + signalVector burst(burst_len, pulse->size()); + burst.isReal(true); + burst_itr = burst.begin(); /* Raw bits are not differentially encoded */ for (unsigned i = 0; i < bits.size(); i++) { @@ -1008,15 +985,11 @@ burst_itr += sps; } - GMSKRotate(*burst, sps); - burst->isReal(false); + GMSKRotate(burst, sps); + burst.isReal(false); /* Single Gaussian pulse approximation shaping */ - shaped = convolve(burst, pulse, NULL, START_ONLY); - - delete burst; - - return shaped; + return convolve(&burst, pulse, NULL, START_ONLY); } /* Assume input bits are not differentially encoded */ @@ -1515,19 +1488,16 @@ static signalVector *downsampleBurst(const signalVector &burst) { - signalVector *in, *out; + signalVector in(DOWNSAMPLE_IN_LEN, dnsampler->len()); + signalVector *out = new signalVector(DOWNSAMPLE_OUT_LEN); + memcpy(in.begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len()); - out = new signalVector(DOWNSAMPLE_OUT_LEN); - memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float)); - - if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN, + if (dnsampler->rotate((float *) in.begin(), DOWNSAMPLE_IN_LEN, (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) { delete out; out = NULL; } - delete in; return out; }; @@ -1620,7 +1590,6 @@ { int rc, start, len; bool clipping = false; - signalVector *corr; if ((sps != 1) && (sps != 4)) return -SIGERR_UNSUPPORTED; @@ -1636,12 +1605,10 @@ start = target - head - 1; len = head + tail; - corr = new signalVector(len); + signalVector corr(len); - rc = detectBurst(rxBurst, *corr, sync, + rc = detectBurst(rxBurst, corr, sync, thresh, sps, &, &toa, start, len); - delete corr; - if (rc < 0) { return -SIGERR_INTERNAL; } else if (!rc) { -- To view, visit https://gerrit.osmocom.org/2920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If53da1bf77b5944b6117765fa98ce12e1ccdeede Gerrit-PatchSet: 4 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Sat Jun 17 00:25:57 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Sat, 17 Jun 2017 00:25:57 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Remove trigonometric tables Message-ID: Review at https://gerrit.osmocom.org/2941 sigProcLib: Remove trigonometric tables Trigonometric sin/cos tables are unused after initialization. There is no benefit to implementing lookup tables for run-once operations. Also perform initial calculations in double width because there is no penalty for doing so. Change-Id: I45bba5daf8610cbba6af95b92c2142f2256491ff --- M Transceiver52M/sigProcLib.cpp 1 file changed, 8 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/41/2941/1 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index a72ec43..c776501 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -46,14 +46,10 @@ #define CLIP_THRESH 30000.0f /** Lookup tables for trigonometric approximation */ -static float cosTable[TABLESIZE+1]; // add 1 element for wrap around -static float sinTable[TABLESIZE+1]; -static float sincTable[TABLESIZE+1]; +static float sincTable[TABLESIZE+1]; // add 1 element for wrap around /** Constants */ static const float M_PI_F = (float)M_PI; -static const float M_2PI_F = (float)(2.0*M_PI); -static const float M_1_2PI_F = 1/M_2PI_F; /* Precomputed rotation vectors */ static signalVector *GMSKRotation4 = NULL; @@ -182,29 +178,6 @@ return Energy; } -/** compute e^(-jx) via lookup table. */ -static complex expjLookup(float x) -{ - float arg = x*M_1_2PI_F; - while (arg > 1.0F) arg -= 1.0F; - while (arg < 0.0F) arg += 1.0F; - - const float argT = arg*((float)TABLESIZE); - const int argI = (int)argT; - const float delta = argT-argI; - const float iDelta = 1.0F-delta; - return complex(iDelta*cosTable[argI] + delta*cosTable[argI+1], - iDelta*sinTable[argI] + delta*sinTable[argI+1]); -} - -/** Library setup functions */ -static void initTrigTables() { - for (int i = 0; i < TABLESIZE+1; i++) { - cosTable[i] = cos(2.0*M_PI*i/TABLESIZE); - sinTable[i] = sin(2.0*M_PI*i/TABLESIZE); - } -} - /* * Initialize 4 sps and 1 sps rotation tables */ @@ -216,11 +189,11 @@ GMSKReverseRotation4 = new signalVector(len4); signalVector::iterator rotPtr = GMSKRotation4->begin(); signalVector::iterator revPtr = GMSKReverseRotation4->begin(); - float phase = 0.0; + auto phase = 0.0; while (rotPtr != GMSKRotation4->end()) { - *rotPtr++ = expjLookup(phase); - *revPtr++ = expjLookup(-phase); - phase += M_PI_F / 2.0F / 4.0; + *rotPtr++ = complex(cos(phase), sin(phase)); + *revPtr++ = complex(cos(-phase), sin(-phase)); + phase += M_PI / 2.0 / 4.0; } GMSKRotation1 = new signalVector(len1); @@ -229,9 +202,9 @@ revPtr = GMSKReverseRotation1->begin(); phase = 0.0; while (rotPtr != GMSKRotation1->end()) { - *rotPtr++ = expjLookup(phase); - *revPtr++ = expjLookup(-phase); - phase += M_PI_F / 2.0F; + *rotPtr++ = complex(cos(phase), sin(phase)); + *revPtr++ = complex(cos(-phase), sin(-phase)); + phase += M_PI / 2.0; } } @@ -1887,7 +1860,6 @@ bool sigProcLibSetup() { - initTrigTables(); generateSincTable(); initGMSKRotationTables(); -- To view, visit https://gerrit.osmocom.org/2941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45bba5daf8610cbba6af95b92c2142f2256491ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Sat Jun 17 00:25:58 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Sat, 17 Jun 2017 00:25:58 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Use explicit NaN check in sinc table generation Message-ID: Review at https://gerrit.osmocom.org/2942 sigProcLib: Use explicit NaN check in sinc table generation Using "x < 0.01" is a crude check for detecting NaN condition, which occurs in a sinc call when x = 0 due to divide-by-zero. Use stdlib isnan() call for this purpose. Also, as the table is created only once during initialization, use double floats for table value generation. Change-Id: I3a838fe3139fa977dfe906246020a14451185714 --- M Transceiver52M/sigProcLib.cpp 1 file changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/42/2942/1 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index c776501..9d1ef49 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -979,16 +979,10 @@ static void generateSincTable() { - float x; - for (int i = 0; i < TABLESIZE; i++) { - x = (float) i / TABLESIZE * 8 * M_PI; - if (fabs(x) < 0.01) { - sincTable[i] = 1.0f; - continue; - } - - sincTable[i] = sinf(x) / x; + auto x = (double) i / TABLESIZE * 8 * M_PI; + auto y = sin(x) / x; + sincTable[i] = isnan(y) ? 1.0 : y; } } -- To view, visit https://gerrit.osmocom.org/2942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a838fe3139fa977dfe906246020a14451185714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Sat Jun 17 12:02:22 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 17 Jun 2017 12:02:22 +0000 Subject: osmo-bts[master]: measurement: improve log output In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/2930/1/src/common/measurement.c File src/common/measurement.c: PS1, Line 150: "%s measurement during state: %s, num_ul_meas=%d\n", : gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), : lchan->meas.num_ul_meas); Let's don't mix tabs and spaces. PS1, Line 157: "%s no space for uplink measurement, num_ul_meas=%d\n", : gsm_lchan_name(lchan), lchan->meas.num_ul_meas); : return -ENOSPC; Same here... -- To view, visit https://gerrit.osmocom.org/2930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 17 15:49:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 15:49:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-bts-trx: wait some longer before starting osmo-bts-trx Message-ID: Review at https://gerrit.osmocom.org/2943 osmo-bts-trx: wait some longer before starting osmo-bts-trx We get sporadic clock skews when running osmo-bts-trx, causing the process to end and the test to fail. Try to give some seconds for the osmo-trx process to sort itself out, in the hope to avoid the clock skews. Related: OS#2325 Change-Id: I82d29358498e7ad9fef28d409808168926e2f876 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/43/2943/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7d12c85..c8fa594 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -64,6 +64,9 @@ self.log('Waiting for osmo-trx to start up...') event_loop.wait(self, self.trx_ready) self.proc_trx.log(self.proc_trx.get_stdout_tail(1)) + self.log('Give some grace time (hopefully to avoid clock skews)') + event_loop.sleep(self, 5) + self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1', '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) -- To view, visit https://gerrit.osmocom.org/2943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82d29358498e7ad9fef28d409808168926e2f876 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 17 15:50:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 15:50:56 +0000 Subject: osmo-gsm-tester[master]: osmo-bts-trx: wait some longer before starting osmo-bts-trx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I82d29358498e7ad9fef28d409808168926e2f876 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Jun 17 15:50:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 15:50:58 +0000 Subject: [MERGED] osmo-gsm-tester[master]: osmo-bts-trx: wait some longer before starting osmo-bts-trx In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-bts-trx: wait some longer before starting osmo-bts-trx ...................................................................... osmo-bts-trx: wait some longer before starting osmo-bts-trx We get sporadic clock skews when running osmo-bts-trx, causing the process to end and the test to fail. Try to give some seconds for the osmo-trx process to sort itself out, in the hope to avoid the clock skews. Related: OS#2325 Change-Id: I82d29358498e7ad9fef28d409808168926e2f876 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7d12c85..c8fa594 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -64,6 +64,9 @@ self.log('Waiting for osmo-trx to start up...') event_loop.wait(self, self.trx_ready) self.proc_trx.log(self.proc_trx.get_stdout_tail(1)) + self.log('Give some grace time (hopefully to avoid clock skews)') + event_loop.sleep(self, 5) + self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1', '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) -- To view, visit https://gerrit.osmocom.org/2943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82d29358498e7ad9fef28d409808168926e2f876 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 17 15:53:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 15:53:19 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Use a subdir of run_dir for each test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2915 to look at the new patch set (#3). Use a subdir of run_dir for each test Processes created have the scope of the test, so we should store everything in a per-suite_run/per-test directory, otherwise everything is stored in the same trial run_dir directory and it's really messy. Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/osmo_stp.py M src/osmo_gsm_tester/suite.py 9 files changed, 27 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/2915/3 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7d12c85..585647a 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -51,7 +51,7 @@ self.suite_run.poll() self.log('Starting to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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(OsmoBtsTrx.BIN_BTS_TRX))) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 30fff0e..eab0bdb 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -45,7 +45,7 @@ if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') log.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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(SysmoBts.BTS_SYSMO_BIN))) diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 5447118..efbda1f 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-bsc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() # NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 110faa5..19241cc 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-hlr') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-hlr'))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index b385274..db41dff 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -38,7 +38,7 @@ def start(self): self.log('Starting osmo-mgcpgw') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-msc'))) binary = inst.child('bin', 'osmo-bsc_mgcp') diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 24d8931..2c9b1e3 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -42,7 +42,7 @@ def start(self): self.log('Starting osmo-msc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-msc'))) binary = inst.child('bin', 'osmo-msc') diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 1830ced..3ef5276 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -41,7 +41,7 @@ def start(self): self.log('Starting osmo-nitb') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-nitb'))) binary = inst.child('bin', 'osmo-nitb') diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py index f1ad6fc..1aeb879 100644 --- a/src/osmo_gsm_tester/osmo_stp.py +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -36,7 +36,7 @@ def start(self): self.log('Starting osmo-stp') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 98ab4fe..71b8dc7 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -76,6 +76,8 @@ PASS = 'pass' FAIL = 'FAIL' + _run_dir = None + def __init__(self, suite_run, test_basename): self.basename = test_basename super().__init__(log.C_TST, self.basename) @@ -86,6 +88,11 @@ self.duration = 0 self.fail_type = None self.fail_message = None + + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name)) + return self._run_dir def run(self): try: @@ -165,6 +172,7 @@ _resource_requirements = None _config = None _processes = None + _run_dir = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): super().__init__(log.C_TST, suite_scenario_str) @@ -209,6 +217,16 @@ config.combine(combination, c) return combination + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.trial.get_run_dir().new_dir(self.name())) + return self._run_dir + + def get_test_run_dir(self): + if self.current_test: + return self.current_test.get_run_dir() + return self.get_run_dir() + def resource_requirements(self): if self._resource_requirements is None: self._resource_requirements = self.combined('resources') @@ -236,6 +254,7 @@ if names and not test.name() in names: test.set_skip() continue + self.current_test = test test.run() self.stop_processes() self.objects_cleanup() -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 Gerrit-PatchSet: 3 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 Sat Jun 17 15:53:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 15:53:49 +0000 Subject: osmo-gsm-tester[master]: Use a subdir of run_dir for each test In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 Gerrit-PatchSet: 3 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 Sat Jun 17 15:56:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 15:56:24 +0000 Subject: osmo-gsm-tester[master]: Unuse resources after every test In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 Gerrit-PatchSet: 2 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 Sat Jun 17 16:09:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 16:09:40 +0000 Subject: osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 (3 comments) https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/osmo_msc.py File src/osmo_gsm_tester/osmo_msc.py: Line 25: class OsmoMsc(log.Origin): > Ok, I can change that. Is there some specific syntax in python for that? Or yep https://gerrit.osmocom.org/#/c/2884/3/src/osmo_gsm_tester/sms.py File src/osmo_gsm_tester/sms.py: Line 24: def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): > It looks clearer to me, as in any packet you usually use src + dst terminol Well, ok then, in the sms.db we're using src_addr and dst_addr. Technically an unrelated cosmetic change but it's only changing the function's arg names. https://gerrit.osmocom.org/#/c/2884/3/suites/aoip_smpp/esme_connect_policy_closed.py File suites/aoip_smpp/esme_connect_policy_closed.py: Line 39: esme_no_pwd.disconnect() > it's not like adding a lot of code and this way we assert it won't be an is I don't know, looks like bloat to me. (btw, "paranoid") -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 4 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: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 17 17:01:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 17:01:10 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Use a subdir of run_dir for each test In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Use a subdir of run_dir for each test ...................................................................... Use a subdir of run_dir for each test Processes created have the scope of the test, so we should store everything in a per-suite_run/per-test directory, otherwise everything is stored in the same trial run_dir directory and it's really messy. Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/osmo_bsc.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_mgcpgw.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/osmo_stp.py M src/osmo_gsm_tester/suite.py 9 files changed, 27 insertions(+), 8 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index c8fa594..46daf71 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -51,7 +51,7 @@ self.suite_run.poll() self.log('Starting to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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(OsmoBtsTrx.BIN_BTS_TRX))) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index 30fff0e..eab0bdb 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -45,7 +45,7 @@ if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be started') log.log('Starting sysmoBTS to connect to', self.bsc) - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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(SysmoBts.BTS_SYSMO_BIN))) diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index 5447118..efbda1f 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-bsc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() # NOTE: While OsmoMSC and OsmoBSC live in the same git repository, the diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 110faa5..19241cc 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-hlr') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-hlr'))) diff --git a/src/osmo_gsm_tester/osmo_mgcpgw.py b/src/osmo_gsm_tester/osmo_mgcpgw.py index b385274..db41dff 100644 --- a/src/osmo_gsm_tester/osmo_mgcpgw.py +++ b/src/osmo_gsm_tester/osmo_mgcpgw.py @@ -38,7 +38,7 @@ def start(self): self.log('Starting osmo-mgcpgw') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-msc'))) binary = inst.child('bin', 'osmo-bsc_mgcp') diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 443b254..063b477 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -40,7 +40,7 @@ def start(self): self.log('Starting osmo-msc') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-msc'))) binary = inst.child('bin', 'osmo-msc') diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3104842..484358e 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -39,7 +39,7 @@ def start(self): self.log('Starting osmo-nitb') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + 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-nitb'))) binary = inst.child('bin', 'osmo-nitb') diff --git a/src/osmo_gsm_tester/osmo_stp.py b/src/osmo_gsm_tester/osmo_stp.py index f1ad6fc..1aeb879 100644 --- a/src/osmo_gsm_tester/osmo_stp.py +++ b/src/osmo_gsm_tester/osmo_stp.py @@ -36,7 +36,7 @@ def start(self): self.log('Starting osmo-stp') - self.run_dir = util.Dir(self.suite_run.trial.get_run_dir().new_dir(self.name())) + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() # NOTE: libosmo-sccp provides osmo-stp and is built as a dependency of diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 5c567f8..c78c9fc 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -76,6 +76,8 @@ PASS = 'pass' FAIL = 'FAIL' + _run_dir = None + def __init__(self, suite_run, test_basename): self.basename = test_basename super().__init__(log.C_TST, self.basename) @@ -86,6 +88,11 @@ self.duration = 0 self.fail_type = None self.fail_message = None + + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.suite_run.get_run_dir().new_dir(self._name)) + return self._run_dir def run(self): try: @@ -165,6 +172,7 @@ _resource_requirements = None _config = None _processes = None + _run_dir = None def __init__(self, trial, suite_scenario_str, suite_definition, scenarios=[]): super().__init__(log.C_TST, suite_scenario_str) @@ -209,6 +217,16 @@ config.combine(combination, c) return combination + def get_run_dir(self): + if self._run_dir is None: + self._run_dir = util.Dir(self.trial.get_run_dir().new_dir(self.name())) + return self._run_dir + + def get_test_run_dir(self): + if self.current_test: + return self.current_test.get_run_dir() + return self.get_run_dir() + def resource_requirements(self): if self._resource_requirements is None: self._resource_requirements = self.combined('resources') @@ -236,6 +254,7 @@ if names and not test.name() in names: test.set_skip() continue + self.current_test = test test.run() except Exception: log.log_exn() -- To view, visit https://gerrit.osmocom.org/2915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06be2dd21710e14c1337d13b1fe6c2f68f037957 Gerrit-PatchSet: 4 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 Sat Jun 17 17:01:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 17 Jun 2017 17:01:20 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Unuse resources after every test In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Unuse resources after every test ...................................................................... Unuse resources after every test Fix bug in put_all(). That method was unused before this commit. Clean the process list after the processes are stopped, otherwise the suite eventually fails with a 'process terminated prematurely' error. Before it was not necessary because it was not reused (a new suite run was created). Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 --- M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py 2 files changed, 9 insertions(+), 8 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index dbfc4e0..8eec71e 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -508,11 +508,11 @@ my_item.pop(USED_KEY) def put_all(self): + if not self.reserved: + return for key, item_list in self.reserved.items(): - my_list = self.get(key) - for my_item in my_list: - if my_item.get(USED_KEY): - my_item.pop(USED_KEY) + for item in item_list: + item.pop(USED_KEY, None) def free(self): if self.reserved: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index c78c9fc..f4b9260 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -256,6 +256,9 @@ continue self.current_test = test test.run() + self.stop_processes() + self.objects_cleanup() + self.reserved_resources.put_all() except Exception: log.log_exn() except BaseException as e: @@ -303,10 +306,8 @@ self._processes.insert(0, process) def stop_processes(self): - if not self._processes: - return - for process in self._processes: - process.terminate() + while self._processes: + self._processes.pop().terminate() def free_resources(self): if self.reserved_resources is None: -- To view, visit https://gerrit.osmocom.org/2914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee12866045145544076c6c18786e1a54f18fc293 Gerrit-PatchSet: 4 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 Sun Jun 18 00:06:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:06:18 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins-run: create separate run log and bin tgz Message-ID: Review at https://gerrit.osmocom.org/2944 jenkins-run: create separate run log and bin tgz The binary tars are fairly large, and usually one wants to investigate the run dir logs without any need to download the binaries. Archive the binary tars separately from the run logs. Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd --- M contrib/jenkins-run.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/44/2944/1 diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh index 3931ddb..8c24385 100755 --- a/contrib/jenkins-run.sh +++ b/contrib/jenkins-run.sh @@ -1,5 +1,6 @@ #!/bin/sh set -e -x +base="$PWD" # remove older trial dirs and *-run.tgz, if any trial_dir_prefix="trial-" @@ -26,6 +27,8 @@ rm -rf "$trial_dir/inst" || true # tar up all results for archiving (optional) -tar czf "$trial_dir"-run.tgz "$trial_dir" +cd "$trial_dir" +tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" +tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz exit $exit_code -- To view, visit https://gerrit.osmocom.org/2944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 00:15:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:15:31 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins-run: create bin.tgz separately from run.tgz In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2944 to look at the new patch set (#2). jenkins-run: create bin.tgz separately from run.tgz The binary tars are fairly large, and usually one wants to investigate the run dir logs without any need to download the binaries. Archive the binary tars separately from the run logs. Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd --- M contrib/jenkins-run.sh 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/44/2944/2 diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh index 3931ddb..8c24385 100755 --- a/contrib/jenkins-run.sh +++ b/contrib/jenkins-run.sh @@ -1,5 +1,6 @@ #!/bin/sh set -e -x +base="$PWD" # remove older trial dirs and *-run.tgz, if any trial_dir_prefix="trial-" @@ -26,6 +27,8 @@ rm -rf "$trial_dir/inst" || true # tar up all results for archiving (optional) -tar czf "$trial_dir"-run.tgz "$trial_dir" +cd "$trial_dir" +tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" +tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz exit $exit_code -- To view, visit https://gerrit.osmocom.org/2944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 18 00:16:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:16:18 +0000 Subject: osmo-gsm-tester[master]: jenkins-run: create bin.tgz separately from run.tgz In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Sun Jun 18 00:16:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:16:20 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins-run: create bin.tgz separately from run.tgz In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins-run: create bin.tgz separately from run.tgz ...................................................................... jenkins-run: create bin.tgz separately from run.tgz The binary tars are fairly large, and usually one wants to investigate the run dir logs without any need to download the binaries. Archive the binary tars separately from the run logs. Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd --- M contrib/jenkins-run.sh 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh index 3931ddb..8c24385 100755 --- a/contrib/jenkins-run.sh +++ b/contrib/jenkins-run.sh @@ -1,5 +1,6 @@ #!/bin/sh set -e -x +base="$PWD" # remove older trial dirs and *-run.tgz, if any trial_dir_prefix="trial-" @@ -26,6 +27,8 @@ rm -rf "$trial_dir/inst" || true # tar up all results for archiving (optional) -tar czf "$trial_dir"-run.tgz "$trial_dir" +cd "$trial_dir" +tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" +tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz exit $exit_code -- To view, visit https://gerrit.osmocom.org/2944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I23e6df0d30fc9ea7c5b48bb2364be075d910bfcd Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 00:32:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:32:29 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: update run-job post-build artifact archiving ... Message-ID: Review at https://gerrit.osmocom.org/2945 OsmoGSMTester: update run-job post-build artifact archiving rule Change-Id: I73c1a6793369604cbe494c83b595a4130a44adc9 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/45/2945/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index b2f0082..b703498 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -308,13 +308,13 @@ NITB nor BTS. * 'Post-build Actions' ** 'Archive the artifacts' -*** 'Files to archive': "*-run.tgz" + +*** 'Files to archive': "*-run.tgz, *-bin.tgz" + This stores the complete test report with config files, logs, stdout/stderr - output as well as pcaps in an artifact. This allows analysis of older - builds, instead of only the most recent build (which cleans up the jenkins - workspace every time). The 'trial-N-run.tgz' archive is produced by the - 'jenkins-run.sh' script, both for successful and failing runs. - + output, pcaps as well as the binaries used for the test run in artifacts. + This allows analysis of older builds, instead of only the most recent build + (which cleans up the jenkins workspace every time). The 'trial-N-run.tgz' + and 'trial-N-bin.tgz' archives are produced by the 'jenkins-run.sh' script, + both for successful and failing runs. === Install osmo-gsm-tester on Main Unit -- To view, visit https://gerrit.osmocom.org/2945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73c1a6793369604cbe494c83b595a4130a44adc9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 00:36:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:36:00 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: update run-job post-build artifact archiving ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73c1a6793369604cbe494c83b595a4130a44adc9 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 Sun Jun 18 00:36:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:36:03 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGSMTester: update run-job post-build artifact archiving ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: OsmoGSMTester: update run-job post-build artifact archiving rule ...................................................................... OsmoGSMTester: update run-job post-build artifact archiving rule Change-Id: I73c1a6793369604cbe494c83b595a4130a44adc9 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 6 insertions(+), 6 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 b2f0082..b703498 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -308,13 +308,13 @@ NITB nor BTS. * 'Post-build Actions' ** 'Archive the artifacts' -*** 'Files to archive': "*-run.tgz" + +*** 'Files to archive': "*-run.tgz, *-bin.tgz" + This stores the complete test report with config files, logs, stdout/stderr - output as well as pcaps in an artifact. This allows analysis of older - builds, instead of only the most recent build (which cleans up the jenkins - workspace every time). The 'trial-N-run.tgz' archive is produced by the - 'jenkins-run.sh' script, both for successful and failing runs. - + output, pcaps as well as the binaries used for the test run in artifacts. + This allows analysis of older builds, instead of only the most recent build + (which cleans up the jenkins workspace every time). The 'trial-N-run.tgz' + and 'trial-N-bin.tgz' archives are produced by the 'jenkins-run.sh' script, + both for successful and failing runs. === Install osmo-gsm-tester on Main Unit -- To view, visit https://gerrit.osmocom.org/2945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73c1a6793369604cbe494c83b595a4130a44adc9 Gerrit-PatchSet: 1 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 Sun Jun 18 00:55:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:55:52 +0000 Subject: libosmocore[master]: cosmetic: Add info about corespondig codecs to permittet speech In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) (fix typos if you like) https://gerrit.osmocom.org/#/c/2938/1//COMMIT_MSG Commit Message: Line 7: cosmetic: Add info about corespondig codecs to permittet speech corresponding, permitted Line 11: codec the constand is coresponding. constant -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Sun Jun 18 00:57:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 00:57:09 +0000 Subject: libosmocore[master]: cosmetic: Add codec references to Speech Version Indication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Sun Jun 18 01:00:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:00:04 +0000 Subject: libosmocore[master]: cosmetic: remove API documentation strings in header file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 +1 so far in case anyone else really wants to keep these comments for reasons I'm not aware of. -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Sun Jun 18 01:10:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:10:37 +0000 Subject: libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (4 comments) https://gerrit.osmocom.org/#/c/2831/4/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 688: * speech parameter (whitespace error) Line 690: * \param[in] perm_spch value from where the speech codec is derived from "value which the speech codec is derived from" and please also explicitly say which kind of value; the comment as it is leaves the reader guessing which constants or values might match this uint8_t. Line 691: * \returns zero when successfull; negative on error */ "successful" Line 695: /*! Note: This function accepts the permitted speech configuration doxygen comment in the C block? Rather include this entire paragraph in above API doc for the function, e.g. separated by "blank" line below the param description (or between brief and params if you prefer that). Also best to stick to the imperative form, dropping things like "this function does". /*! \brief summary bla. * \param ... * * Accept the permitted speech configuration from the channel type * information and compute an ... */ -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Sun Jun 18 01:18:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:18:04 +0000 Subject: libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (4 comments) (better to not make reviewers post the same comments again. Either change the patch or explain why you don't.) https://gerrit.osmocom.org/#/c/2830/4/include/osmocom/gsm/gsm0808_utils.h File include/osmocom/gsm/gsm0808_utils.h: Line 77: * representation we use in struct gsm0808_speech_codec */ could make sense to not commit obsolete comments that are removed in a later patch of this series ... OTOH if someone still wants to keep these we can keep all or remove all at once by rejecting / merging the other commit. https://gerrit.osmocom.org/#/c/2830/4/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 652: * representation we use in struct gsm0808_speech_codec Please end the \brief with a '.' at the end of the sentence. Line 660: * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ this still belongs in above API doc, just like I said last time. Line 680: return GSM0808_SCT_HR6; still an open question here, see PS3 comment -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Sun Jun 18 01:21:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:21:18 +0000 Subject: libosmocore[master]: gsm0808: add default speech codec configuration In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/2829/3/include/osmocom/gsm/protocol/gsm_08_08.h File include/osmocom/gsm/protocol/gsm_08_08.h: Line 452: /* Default speech codec configurations: Some codecs specified with use doxygen API doc format Line 459: * for the Adaptive Multi-Rate Codec Types */ this and... Line 466: * Adaptive Multi-Rate ? Wideband Codec Types */ ...this should also go in above to-be API doc. There are doxygen inline comments available, but you'd have to repeat for each enum member. Since the comments name the values explicitly, let's just put this above as-is. -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Sun Jun 18 01:28:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:28:46 +0000 Subject: libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2820/3/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 154: bool type_extended = false; each of below cases will set this variable (or assert). Hence, as I said before, do not initialize it here. Line 304: case GSM0808_SCT_HR1: combine this and two cases above! Always do so when the case body is identical. -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Sun Jun 18 01:33:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:33:28 +0000 Subject: libosmocore[master]: gsm0808: add speech codec type constants In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/2818/4/include/osmocom/gsm/protocol/gsm_08_08.h File include/osmocom/gsm/protocol/gsm_08_08.h: Line 409: /* 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ I guess this should be a /*! ... */ and all of the below should be /*!< ... */ comments (to appear in the doxygen API docs) Line 420: GSM0808_SCT_CSD = 0xfd, /* CSData (see also TS 26.103) */ whitespace differs: tab above, here a single space before '=' -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Sun Jun 18 01:36:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:36:32 +0000 Subject: libosmocore[master]: gsm0808: update permitted speech constants In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/2811/5/include/osmocom/gsm/protocol/gsm_08_08.h File include/osmocom/gsm/protocol/gsm_08_08.h: Line 394: /* GSM 08.08 3.2.2.11 Channel Type doxygen? Line 400: GSM0808_PERM_FR4 = 0x41, /* OFR AMR-WB */ doxygen? -- To view, visit https://gerrit.osmocom.org/2811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id426f7dbffe46450d0cf6df20236a9e68f065f8d Gerrit-PatchSet: 5 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 Sun Jun 18 01:37:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:37:07 +0000 Subject: libosmocore[master]: cosmetic: Add codec references to Speech Version Indication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2937/1/include/osmocom/gsm/protocol/gsm_04_08.h File include/osmocom/gsm/protocol/gsm_04_08.h: Line 1626: GSM48_BCAP_SV_FR = 0, /* GSM FR V1 (GSM FR) */ doxygen? -- To view, visit https://gerrit.osmocom.org/2937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Sun Jun 18 01:42:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:42:36 +0000 Subject: osmo-bts[master]: measurement: improve log output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2930/1/src/common/measurement.c File src/common/measurement.c: PS1, Line 150: "%s measurement during state: %s, num_ul_meas=%d\n", : gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), : lchan->meas.num_ul_meas); > Let's don't mix tabs and spaces. we have spaces following tabs throughout the Osmocom code base, often for multi-line param lists, also in this file, in order to align args with '('. Or am I missing something? -- To view, visit https://gerrit.osmocom.org/2930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 18 01:43:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:43:08 +0000 Subject: libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/2812/5/include/osmocom/gsm/protocol/gsm_04_08.h File include/osmocom/gsm/protocol/gsm_04_08.h: Line 1623: /* GSM 04.08 Bearer Capability: Speech Version Indication doxygen? Line 1631: GSM48_BCAP_SV_AMR_OFW = 6, /* GSM FR V4 (OFR AMR-WB) */ doxygen? /*!< text */ -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 5 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 Sun Jun 18 01:55:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:55:03 +0000 Subject: osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (3 comments) https://gerrit.osmocom.org/#/c/2813/4//COMMIT_MSG Commit Message: Line 9: The layer 1 interface (l1_if.c) for osmo-trx does not include osmo-bts-trx? https://gerrit.osmocom.org/#/c/2813/3/src/osmo-bts-trx/l1_if.h File src/osmo-bts-trx/l1_if.h: Line 71: void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, struct gsm_lchan *lchan, > Why do you need chan_nr and *lchan in parameters at the same time? Why can' chan_nr isn't always necessarily just a clean array index; on RSL there are bit masks and magic going on. Not sure if that's the case here, but I see the caller doing l1sap_chan2ss(chan_nr) to obtain the array index from the chan_nr, so I assume rather keep this separate. Is that right, dexter? https://gerrit.osmocom.org/#/c/2813/4/src/osmo-bts-trx/l1_if.h File src/osmo-bts-trx/l1_if.h: Line 72: uint32_t fn, float ber, float rssi, float toa); have you explained all of these in the commit log? it's lchan, fn, and changint 'ta' to 'toa'? (just asking because I don't know the code well) -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Sun Jun 18 01:57:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 01:57:09 +0000 Subject: openbsc[master]: lchan: add members for BFI In-Reply-To: References: Message-ID: Patch Set 1: usually when we add data members, the same commit introduces use thereof. In this case this seems to be for use in a different repos, so it would be good to indicate the user in the commit log. -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Sun Jun 18 02:00:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:00:35 +0000 Subject: libosmocore[master]: vty: additional nodes for sccp-address configuration In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2922/1//COMMIT_MSG Commit Message: Line 10: requires to additional VTY nodes. two? As always, please include the change-id of the corresponding libosmo-sccp change. https://gerrit.osmocom.org/#/c/2922/1/TODO-RELEASE File TODO-RELEASE: Line 14: libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space you are removing two enum items and use reserved space, so _LAST_OSMOVTY_NODE is actually staying identical! -- To view, visit https://gerrit.osmocom.org/2922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Sun Jun 18 02:01:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:01:52 +0000 Subject: libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 this depends on a libosmocore commit, right? In such cases always include the change-id in the commit log. -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Sun Jun 18 02:03:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:03:30 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: fix typo in osmo_ss7_vty.c VTY doc In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2923 to look at the new patch set (#2). cosmetic: fix typo in osmo_ss7_vty.c VTY doc Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c --- M src/osmo_ss7_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/23/2923/2 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 0ff9e76..97b5cf0 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -262,7 +262,7 @@ "Point Code Length\n" "Specify Destination Linkset\n" "Linkset Name\n" - "Specity Priority\n" + "Specify Priority\n" "Priority\n" "Specify QoS Class\n" "QoS Class\n" -- To view, visit https://gerrit.osmocom.org/2923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 18 02:03:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:03:35 +0000 Subject: libosmo-sccp[master]: cosmetic: fix typo in osmo_ss7_vty.c VTY doc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Sun Jun 18 02:03:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:03:48 +0000 Subject: [MERGED] libosmo-sccp[master]: cosmetic: fix typo in osmo_ss7_vty.c VTY doc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: fix typo in osmo_ss7_vty.c VTY doc ...................................................................... cosmetic: fix typo in osmo_ss7_vty.c VTY doc Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c --- M src/osmo_ss7_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 0ff9e76..97b5cf0 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -262,7 +262,7 @@ "Point Code Length\n" "Specify Destination Linkset\n" "Linkset Name\n" - "Specity Priority\n" + "Specify Priority\n" "Priority\n" "Specify QoS Class\n" "QoS Class\n" -- To view, visit https://gerrit.osmocom.org/2923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 02:05:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:05:02 +0000 Subject: openbsc[master]: lchan: add members for BFI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (and add the change-id of the corresponding change in that other repos) -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Sun Jun 18 02:08:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:08:36 +0000 Subject: osmo-bts[master]: osmo-bts-octphy: normalize frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2867/2//COMMIT_MSG Commit Message: Line 9: The higher layers will no longer care for the alignment of the frame number "no longer" -- does that mean this is a fix needed after another commit? If yes, which commit? -- To view, visit https://gerrit.osmocom.org/2867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d369ff9e6da34f4bd98afd3c5d030cac73e54c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Sun Jun 18 02:09:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 02:09:56 +0000 Subject: libosmo-sccp[master]: cosmetic: Fix typo in sccp_types.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 it's not entirely clear whether that breaks users of this constant. If accurate, you could say "no known code uses this constant yet" or something? -- To view, visit https://gerrit.osmocom.org/2845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I34f767234f677307bb04891b40f03109901c0f1b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Sun Jun 18 05:58:42 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 18 Jun 2017 05:58:42 +0000 Subject: osmo-bts[master]: measurement: improve log output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 > (1 comment) Ah, sorry, I didn't pay my attention on tabs before spaces... -- To view, visit https://gerrit.osmocom.org/2930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:11:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:11:56 +0000 Subject: [PATCH] osmo-bts[master]: OML Add osmocom-specific way to deactivate radio link timeout Message-ID: Review at https://gerrit.osmocom.org/2946 OML Add osmocom-specific way to deactivate radio link timeout In some situations (e.g. when trying to do measurements/testing on the BTS receiver / uplink) it is useful to have a way to disable the radio link timeout and keep any channel open until deactivated, irrespective of whether (valid) data is received or not. This adds a related feature that can be activated by using an osmocom-specific value of 0xff for the TS 12.21 Connection Failure Criterion (9.4.14). Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5 --- M include/osmo-bts/gsm_data.h M src/common/l1sap.c M src/common/oml.c 3 files changed, 22 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/2946/1 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 772a705..c513b27 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -94,7 +94,9 @@ uint8_t tc4_ctr; } si; struct gsm_time gsm_time; - uint8_t radio_link_timeout; + /* Radio Link Timeout counter. -1 disables timeout for + * lab/measurement purpose */ + int radio_link_timeout; int ul_power_target; /* Uplink Rx power target */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index fd8c54e..b9104b7 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -809,6 +809,10 @@ { struct gsm_bts_role_bts *btsb = lchan->ts->trx->bts->role; + /* Bypass radio link timeout if set to -1 */ + if (btsb->radio_link_timeout < 0) + return; + /* if link loss criterion already reached */ if (lchan->s == 0) { DEBUGP(DMEAS, "%s radio link counter S already 0.\n", diff --git a/src/common/oml.c b/src/common/oml.c index 982713e..fe35e85 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -627,17 +627,27 @@ if (TLVP_PRES_LEN(&tp, NM_ATT_CONN_FAIL_CRIT, 1)) { const uint8_t *val = TLVP_VAL(&tp, NM_ATT_CONN_FAIL_CRIT); - if (TLVP_LEN(&tp, NM_ATT_CONN_FAIL_CRIT) < 2 - || val[0] != 0x01 || val[1] < 4 || val[1] > 64) { + switch (val[0]) { + case 0xFF: /* Osmocom specific Extension of TS 12.21 */ + LOGP(DOML, LOGL_NOTICE, "WARNING: Radio Link Timeout " + "explicitly disabled, only use this for lab testing!\n"); + btsb->radio_link_timeout = -1; + break; + case 0x01: /* Based on uplink SACCH (radio link timeout) */ + if (TLVP_LEN(&tp, NM_ATT_CONN_FAIL_CRIT) >= 2 && + val[1] >= 4 && val[1] <= 64) { + btsb->radio_link_timeout = val[1]; + break; + } + /* fall-through */ + case 0x02: /* Based on RXLEV/RXQUAL measurements */ + default: LOGP(DOML, LOGL_NOTICE, "Given Conn. Failure Criterion " "not supported. Please use critetion 0x01 with " "RADIO_LINK_TIMEOUT value of 4..64\n"); return oml_fom_ack_nack(msg, NM_NACK_PARAM_RANGE); } - btsb->radio_link_timeout = val[1]; } - /* if val[0] != 0x01: can be 'operator dependent' and needs to - * be parsed by bts driver */ /* 9.4.53 T200 */ if (TLVP_PRES_LEN(&tp, NM_ATT_T200, ARRAY_SIZE(btsb->t200_ms))) { -- To view, visit https://gerrit.osmocom.org/2946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:16:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:16:20 +0000 Subject: [PATCH] openbsc[master]: Add vty command "radio-link-timeout infinite" for uplink rx ... Message-ID: Review at https://gerrit.osmocom.org/2947 Add vty command "radio-link-timeout infinite" for uplink rx testing When we are performing Rx sensitivity testing on a BTS, we want to deactivate the connection failure criterion / radio link timeout, i.e. no matter how many SACCH frames in uplink are failed to decode, the BTS should never close the channel. OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way how this behavior can be requested from the BTS via an OML attribute. This patch adds support to the BSC to actually set that attribute. Do not use this in production networks, as the BTS will keep open radio channels indefinitely even if the phone is gone and no longer transmitting anything. This is a pure testing feature. Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 --- M openbsc/include/openbsc/gsm_04_08.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c M openbsc/src/libcommon/gsm_data.c M openbsc/src/libcommon/gsm_data_shared.c 6 files changed, 79 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/47/2947/1 diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h index fe19ff4..a8b2de9 100644 --- a/openbsc/include/openbsc/gsm_04_08.h +++ b/openbsc/include/openbsc/gsm_04_08.h @@ -26,20 +26,6 @@ name); } -static inline int get_radio_link_timeout(struct gsm48_cell_options *cell_options) -{ - return (cell_options->radio_link_timeout + 1) << 2; -} - -static inline void set_radio_link_timeout(struct gsm48_cell_options *cell_options, int value) -{ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; -} - /* config options controlling the behaviour of the lower leves */ void gsm0408_allow_everyone(int allow); void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index d3fd757..3b01bc9 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -872,6 +872,8 @@ } 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; @@ -943,6 +945,9 @@ return bitvec_get_bit_pos(&bts->features, feat); } +int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts); +void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); + void gsm_abis_mo_reset(struct gsm_abis_mo *mo); struct gsm_abis_mo * diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 2fc39ab..9fc2895 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -604,9 +604,11 @@ vty_out(vty, " periodic location update %u%s", bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - vty_out(vty, " radio-link-timeout %d%s", - get_radio_link_timeout(&bts->si_common.cell_options), - VTY_NEWLINE); + if (gsm_bts_get_radio_link_timeout(bts) < 0) + vty_out(vty, " radio-link-timeout infinite%s", VTY_NEWLINE); + 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); @@ -2299,7 +2301,25 @@ { struct gsm_bts *bts = vty->index; - set_radio_link_timeout(&bts->si_common.cell_options, atoi(argv[0])); + gsm_bts_set_radio_link_timeout(bts, atoi(argv[0])); + + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_radio_link_timeout_inf, cfg_bts_radio_link_timeout_inf_cmd, + "radio-link-timeout infinite", + "Radio link timeout criterion (BTS side)\n" + "Infinite Radio link timeout value (use only for BTS RF testing)\n") +{ + struct gsm_bts *bts = vty->index; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + vty_out(vty, "%% infinite radio link timeout not supported by this BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% INFINITE RADIO LINK TIMEOUT, USE ONLY FOR BTS RF TESTING%s", VTY_NEWLINE); + gsm_bts_set_radio_link_timeout(bts, -1); return CMD_SUCCESS; } @@ -4180,6 +4200,7 @@ install_element(BTS_NODE, &cfg_bts_penalty_time_cmd); install_element(BTS_NODE, &cfg_bts_penalty_time_rsvd_cmd); install_element(BTS_NODE, &cfg_bts_radio_link_timeout_cmd); + install_element(BTS_NODE, &cfg_bts_radio_link_timeout_inf_cmd); install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); install_element(BTS_NODE, &cfg_bts_gprs_11bit_rach_support_for_egprs_cmd); install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 0291129..473e1ca 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -38,6 +38,7 @@ { struct msgb *msgb; uint8_t buf[256]; + int rlt; msgb = msgb_alloc(1024, "nanobts_attr_bts"); memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6); @@ -46,9 +47,16 @@ /* interference avg. period in numbers of SACCH multifr */ msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, 0x06); - /* conn fail based on SACCH error rate */ - buf[0] = 0x01; - buf[1] = get_radio_link_timeout(&bts->si_common.cell_options); + rlt = gsm_bts_get_radio_link_timeout(bts); + if (rlt == -1) { + /* Osmocom extension: Use infinite radio link timeout */ + buf[0] = 0xFF; + buf[1] = 0x00; + } else { + /* conn fail based on SACCH error rate */ + buf[0] = 0x01; + buf[1] = rlt; + } msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf); memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 8830ce1..93d34bf 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -323,8 +323,7 @@ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ - set_radio_link_timeout(&bts->si_common.cell_options, 32); - /* Use RADIO LINK TIMEOUT of 32 seconds */ + gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..35e99c3 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -847,3 +847,40 @@ { return pchan_is_tch(ts_pchan(ts)); } + +/* get the radio link timeout (based on SACCH decode errors, according + * to algorithm specified in TS 05.08 section 5.2. A value of -1 + * indicates we should use an infinitely long timeout, which only works + * with OsmoBTS as the BTS implementation */ +int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) +{ + const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; + + if (bts->infinite_radio_link_timeout) + return -1; + else { + /* Encoding as per Table 10.5.21 of TS 04.08 */ + return (cell_options->radio_link_timeout + 1) << 2; + } +} + +/* set the radio link timeout (based on SACCH decode errors, according + * to algorithm specified in TS 05.08 Section 5.2. A value of -1 + * indicates we should use an infinitely long timeout, which only works + * with OsmoBTS as the BTS implementation */ +void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) +{ + struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; + + if (value < 0) + bts->infinite_radio_link_timeout = true; + else { + bts->infinite_radio_link_timeout = false; + /* Encoding as per Table 10.5.21 of TS 04.08 */ + if (value < 4) + value = 4; + if (value > 64) + value = 64; + cell_options->radio_link_timeout = (value >> 2) - 1; + } +} -- To view, visit https://gerrit.osmocom.org/2947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:43:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 08:43:27 +0000 Subject: [PATCH] libosmocore[master]: Fix compilation warning on deprecated macro Message-ID: Review at https://gerrit.osmocom.org/2948 Fix compilation warning on deprecated macro A warning was printed even if the deprecation didn't apply to libosmocore because it is still allowed to use it internally. This patch fixes this case while still printing a warning if external projects build using libosmocore headers. Change-Id: I32212f20756f828af1017482a71e29e4b3adbad4 --- M configure.ac M include/osmocom/core/defs.h M include/osmocom/core/logging.h 3 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/2948/1 diff --git a/configure.ac b/configure.ac index 04d126e..340a896 100644 --- a/configure.ac +++ b/configure.ac @@ -235,6 +235,9 @@ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" fi +CFLAGS+=" -DBUILDING_LIBOSMOCORE" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE" + AC_ARG_ENABLE(simd, [AS_HELP_STRING( [--disable-simd], diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index aebe925..51ac4e5 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -41,6 +41,12 @@ # define OSMO_DEPRECATED(text) #endif +#if BUILDING_LIBOSMOCORE +# define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE +#else +# define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE OSMO_DEPRECATED("For internal use inside libosmocore only.") +#endif + #undef _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE #undef _OSMO_HAS_ATTRIBUTE_DEPRECATED diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 77343e9..7af0ad2 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -332,8 +332,8 @@ void log_del_target(struct log_target *target); /* Generate command string for VTY use */ -const char *log_vty_command_string() OSMO_DEPRECATED("For internal use inside libosmocore only."); -const char *log_vty_command_description() OSMO_DEPRECATED("For internal use inside libosmocore only."); +const char *log_vty_command_string() OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; +const char *log_vty_command_description() OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; struct log_target *log_target_find(int type, const char *fname); extern struct llist_head osmo_log_target_list; -- To view, visit https://gerrit.osmocom.org/2948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32212f20756f828af1017482a71e29e4b3adbad4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 08:43:28 +0000 Subject: [PATCH] libosmocore[master]: card_fs_uicc.c: Fix unused compilation warning Message-ID: Review at https://gerrit.osmocom.org/2949 card_fs_uicc.c: Fix unused compilation warning This array of bytes is not yet used but is referring to some specs. They may be used in the future, so leave it there but mark it explicitly as unused. Change-Id: I0a61d17f9989ecddafbc68d4b9446853e4c15159 --- M src/sim/card_fs_uicc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/2949/1 diff --git a/src/sim/card_fs_uicc.c b/src/sim/card_fs_uicc.c index 70737b6..27afe34 100644 --- a/src/sim/card_fs_uicc.c +++ b/src/sim/card_fs_uicc.c @@ -205,4 +205,4 @@ }; /* Annex E - TS 101 220 */ -static const uint8_t adf_uicc_aid[] = { 0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x01 }; +static const uint8_t __attribute__((__unused__)) adf_uicc_aid[] = { 0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x01 }; -- To view, visit https://gerrit.osmocom.org/2949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a61d17f9989ecddafbc68d4b9446853e4c15159 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 08:43:28 +0000 Subject: [PATCH] libosmocore[master]: sms_test.c: Remove test of deprecated wrapper function Message-ID: Review at https://gerrit.osmocom.org/2950 sms_test.c: Remove test of deprecated wrapper function The deprecated function is just a wrapper, and it triggers a compilation warning. Change-Id: Iaac701bdf0c0e66c343f68cc31d82550a024ef57 --- M tests/sms/sms_test.c M tests/sms/sms_test.ok 2 files changed, 0 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/50/2950/1 diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 776c45a..efbdf7e 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -288,16 +288,6 @@ /* test 7-bit encoding */ for (i = 0; i < ARRAY_SIZE(test_encode); ++i) { - /* Test legacy function (return value only) */ - septet_length = gsm_7bit_encode(coded, - (const char *) test_encode[i].input); - printf("Legacy encode case %d: " - "septet length %d (expected %d)\n" - , i - , septet_length, test_encode[i].expected_septet_length - ); - OSMO_ASSERT (septet_length == test_encode[i].expected_septet_length); - /* Test new function */ memset(coded, 0x42, sizeof(coded)); septet_length = gsm_7bit_encode_n(coded, sizeof(coded), @@ -377,15 +367,6 @@ /* test 7-bit decoding */ for (i = 0; i < ARRAY_SIZE(test_decode); ++i) { - /* Test legacy function (return value only) */ - if (!test_decode[i].ud_hdr_ind) { - nchars = gsm_7bit_decode(result, test_decode[i].input, - test_decode[i].expected_septet_length); - printf("Legacy decode case %d: " - "return value %d (expected %d)\n", - i, nchars, test_decode[i].expected_septet_length); - } - /* Test new function */ memset(result, 0x42, sizeof(result)); nchars = gsm_7bit_decode_n_hdr(result, sizeof(result), test_decode[i].input, diff --git a/tests/sms/sms_test.ok b/tests/sms/sms_test.ok index fa536ea..a71567d 100644 --- a/tests/sms/sms_test.ok +++ b/tests/sms/sms_test.ok @@ -1,19 +1,11 @@ SMS testing -Legacy encode case 0: septet length 9 (expected 9) Encode case 0: Octet length 8 (expected 8, computed 8), septet length 9 (expected 9) -Legacy encode case 1: septet length 41 (expected 41) Encode case 1: Octet length 36 (expected 36, computed 36), septet length 41 (expected 41) -Legacy encode case 2: septet length 39 (expected 39) Encode case 2: Octet length 35 (expected 35, computed 35), septet length 39 (expected 39) -Legacy encode case 3: septet length 40 (expected 40) Encode case 3: Octet length 35 (expected 35, computed 35), septet length 40 (expected 40) -Legacy decode case 0: return value 9 (expected 9) Decode case 0: return value 9 (expected 9) -Legacy decode case 1: return value 41 (expected 41) Decode case 1: return value 40 (expected 40) -Legacy decode case 2: return value 39 (expected 39) Decode case 2: return value 31 (expected 31) -Legacy decode case 3: return value 40 (expected 40) Decode case 3: return value 32 (expected 32) Decode case 4: return value 153 (expected 153) Decode case 5: return value 40 (expected 40) -- To view, visit https://gerrit.osmocom.org/2950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaac701bdf0c0e66c343f68cc31d82550a024ef57 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 08:43:28 +0000 Subject: [PATCH] libosmocore[master]: gprs_ns_test.c: Remove unused byte arrays Message-ID: Review at https://gerrit.osmocom.org/2951 gprs_ns_test.c: Remove unused byte arrays Commit 0d4e949e229a649ffd0503d8e930dba8be7dd34d changed the code to use functions with local variables holding the bytes, but forgot to remove the old global variables. This test fixes compilation warnings. Change-Id: I140de30038222b0419423d8c4f9da1946651a4e7 --- M tests/gb/gprs_ns_test.c 1 file changed, 0 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/2951/1 diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 4c6fd39..456d8e3 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -178,61 +178,12 @@ send_bssgp_reset(nsi, src_addr, bvci); } -/* GPRS Network Service, PDU type: NS_RESET, - * Cause: O&M intervention, NS VCI: 0x1122, NSEI 0x1122 - */ -static const unsigned char gprs_ns_reset[12] = { - 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x11, 0x22, - 0x04, 0x82, 0x11, 0x22 -}; - -/* GPRS Network Service, PDU type: NS_RESET, - * Cause: O&M intervention, NS VCI: 0x3344, NSEI 0x1122 - */ -static const unsigned char gprs_ns_reset_vci2[12] = { - 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x33, 0x44, - 0x04, 0x82, 0x11, 0x22 -}; - -/* GPRS Network Service, PDU type: NS_RESET, - * Cause: O&M intervention, NS VCI: 0x1122, NSEI 0x3344 - */ -static const unsigned char gprs_ns_reset_nsei2[12] = { - 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x11, 0x22, - 0x04, 0x82, 0x33, 0x44 -}; - -/* GPRS Network Service, PDU type: NS_ALIVE */ -static const unsigned char gprs_ns_alive[1] = { - 0x0a -}; - /* GPRS Network Service, PDU type: NS_STATUS, * Cause: PDU not compatible with the protocol state * PDU: NS_ALIVE */ static const unsigned char gprs_ns_status_invalid_alive[7] = { 0x08, 0x00, 0x81, 0x0a, 0x02, 0x81, 0x0a -}; - -/* GPRS Network Service, PDU type: NS_ALIVE_ACK */ -static const unsigned char gprs_ns_alive_ack[1] = { - 0x0b -}; - -/* GPRS Network Service, PDU type: NS_UNBLOCK */ -static const unsigned char gprs_ns_unblock[1] = { - 0x06 -}; - - -/* GPRS Network Service, PDU type: NS_STATUS, - * Cause: PDU not compatible with the protocol state - * PDU: NS_RESET_ACK, NS VCI: 0x1122, NSEI 0x1122 - */ -static const unsigned char gprs_ns_status_invalid_reset_ack[15] = { - 0x08, 0x00, 0x81, 0x0a, 0x02, 0x89, 0x03, 0x01, - 0x82, 0x11, 0x22, 0x04, 0x82, 0x11, 0x22 }; /* GPRS Network Service, PDU type: NS_UNITDATA, BVCI 0 */ -- To view, visit https://gerrit.osmocom.org/2951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I140de30038222b0419423d8c4f9da1946651a4e7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 08:43:28 +0000 Subject: [PATCH] libosmocore[master]: tlv_test.c: Fix compilation warnings Message-ID: Review at https://gerrit.osmocom.org/2952 tlv_test.c: Fix compilation warnings Several warnings like the one below are fixed: warning: array subscript is below array bounds [-Warray-bounds] uint8_t *unchanged_ptr = buf - 1; Change-Id: I35d7d926939c14700cbca732bd64e588c75424b4 --- M tests/tlv/tlv_test.c 1 file changed, 25 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/2952/1 diff --git a/tests/tlv/tlv_test.c b/tests/tlv/tlv_test.c index c571c3b..87b002f 100644 --- a/tests/tlv/tlv_test.c +++ b/tests/tlv/tlv_test.c @@ -70,23 +70,24 @@ static void check_tlv_match_data_len(size_t data_len, uint8_t tag, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t unchanged_len = 0xdead; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; size_t value_len = unchanged_len; - uint8_t *data = buf; + uint8_t *data = buf + 1; - OSMO_ASSERT(data_len <= sizeof(buf)); + OSMO_ASSERT(data_len <= sizeof(buf) - 1); tlv_put(data, tag, len, test_data); if (data_len < len + 2) { OSMO_ASSERT(-1 == osmo_match_shift_tlv(&data, &tmp_data_len, tag, &value, &value_len)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); OSMO_ASSERT(value_len == unchanged_len); } else { @@ -101,14 +102,15 @@ uint8_t tag, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; - uint8_t *data = buf; + uint8_t *data = buf + 1; - OSMO_ASSERT(data_len <= sizeof(buf)); + OSMO_ASSERT(data_len <= sizeof(buf) - 1); tv_fixed_put(data, tag, len, test_data); @@ -116,7 +118,7 @@ OSMO_ASSERT(-1 == osmo_match_shift_tv_fixed(&data, &tmp_data_len, tag, len, &value)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); } else { OSMO_ASSERT(0 <= osmo_match_shift_tv_fixed(&data, &tmp_data_len, @@ -128,14 +130,15 @@ static void check_v_fixed_shift_data_len(size_t data_len, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; - uint8_t *data = buf; + uint8_t *data = buf + 1; - OSMO_ASSERT(data_len <= sizeof(buf)); + OSMO_ASSERT(data_len <= sizeof(buf) - 1); memcpy(data, test_data, len); @@ -143,7 +146,7 @@ OSMO_ASSERT(-1 == osmo_shift_v_fixed(&data, &tmp_data_len, len, &value)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); } else { OSMO_ASSERT(0 <= osmo_shift_v_fixed(&data, &tmp_data_len, @@ -155,21 +158,24 @@ static void check_lv_shift_data_len(size_t data_len, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t unchanged_len = 0xdead; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; size_t value_len = unchanged_len; - uint8_t *data = buf; + uint8_t *data = buf + 1; + + OSMO_ASSERT(data_len <= sizeof(buf) - 1); lv_put(data, len, test_data); if (data_len < len + 1) { OSMO_ASSERT(-1 == osmo_shift_lv(&data, &tmp_data_len, &value, &value_len)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); OSMO_ASSERT(value_len == unchanged_len); } else { -- To view, visit https://gerrit.osmocom.org/2952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35d7d926939c14700cbca732bd64e588c75424b4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:46:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:46:20 +0000 Subject: libosmo-sccp[master]: cosmetic: Fix typo in sccp_types.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I34f767234f677307bb04891b40f03109901c0f1b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Jun 18 08:46:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:46:23 +0000 Subject: [MERGED] libosmo-sccp[master]: cosmetic: Fix typo in sccp_types.h In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: Fix typo in sccp_types.h ...................................................................... cosmetic: Fix typo in sccp_types.h change SCCP_RETURN_CAUSE_SEGMENTATION_FAOLURE to SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE Change-Id: I34f767234f677307bb04891b40f03109901c0f1b --- M include/sccp/sccp_types.h 1 file changed, 1 insertion(+), 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/include/sccp/sccp_types.h b/include/sccp/sccp_types.h index e1dcfe7..4e99723 100644 --- a/include/sccp/sccp_types.h +++ b/include/sccp/sccp_types.h @@ -219,7 +219,7 @@ SCCP_RETURN_CAUSE_SCCP_FAILURE = 11, SCCP_RETURN_CAUSE_HOP_COUNTER_VIOLATION = 12, SCCP_RETURN_CAUSE_SEGMENTATION_NOT_SUPPORTED= 13, - SCCP_RETURN_CAUSE_SEGMENTATION_FAOLURE = 14 + SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE = 14 }; enum sccp_reset_cause { -- To view, visit https://gerrit.osmocom.org/2845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34f767234f677307bb04891b40f03109901c0f1b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Sun Jun 18 08:48:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:48:00 +0000 Subject: openbsc[master]: lchan: add members for BFI In-Reply-To: References: Message-ID: Patch Set 1: what I'm missing here is *why* we are adding those fields, and what they will be used for. The radio link timeout / connection failure criterion also has some way of counting bad SACCHs, so I want to make sure we're not adding redundant information here. -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Jun 18 08:48:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 08:48:10 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add support for SMPP testing In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Add support for SMPP testing ...................................................................... Add support for SMPP testing As defined in [1], the different related actors are implemented in this commit: ESME and SMSC. SMSC: In Osmocom, the SMSC is currently implemented inside the NITB or the MSC. A new Smsc abstract class is created to shared code between the NITB and the MSC, and also makes it easier for later when the SMSC is splitted. ESMEs can be dynamically added to its configuration in a similar way to how the BTSs are added. ESME: A new class Esme is created which can be used by tests to control an ESME to interact with the SMSC. The ESME functionalities are implemented using python-smpplib. Required version of this library is at least 43cc6f819ec76b2c0a9d36d1d439308634716227, which contains support for python 3 and some required features to poll the socket. This commit already contains a few tests which checks different features and tests the API. Extending tested features or scenarios can be later done quite easily. The tests are not enabled by default right now, because there are several of them in a suite and the ip_address resources are not freed after every tests which ends up in the suite failing due to missing reserved resources. All the tests run alone work though. When the issue is fixed they can then be added to the default list of tests to be run. [1] http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da --- M selftest/template_test.ok M selftest/template_test.py M selftest/template_test/osmo-nitb.cfg.tmpl A src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/sms.py A src/osmo_gsm_tester/smsc.py M src/osmo_gsm_tester/suite.py M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl M src/osmo_gsm_tester/test.py A suites/aoip_smpp/esme_connect_policy_acceptall.py A suites/aoip_smpp/esme_connect_policy_closed.py A suites/aoip_smpp/esme_ms_sms.py A suites/aoip_smpp/suite.conf A suites/smpp/esme_connect_policy_acceptall.py A suites/smpp/esme_connect_policy_closed.py A suites/smpp/esme_ms_sms.py A suites/smpp/suite.conf 20 files changed, 574 insertions(+), 30 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/selftest/template_test.ok b/selftest/template_test.ok index 1267dac..688361f 100644 --- a/selftest/template_test.ok +++ b/selftest/template_test.ok @@ -136,10 +136,13 @@ phys_chan_config val_phys_chan_config_3 smpp local-tcp-ip val_ip_address 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy val_smsc_policy + esme val_system_id_esme0 + password val_password_esme0 + default-route + esme val_system_id_esme1 + no password default-route ctrl bind val_ip_address diff --git a/selftest/template_test.py b/selftest/template_test.py index 45347b6..f8c32a5 100755 --- a/selftest/template_test.py +++ b/selftest/template_test.py @@ -35,6 +35,11 @@ ) } +mock_esme = { + 'system_id': 'val_system_id', + 'password': 'val_password' +} + def clone_mod(d, val_ext): c = dict(d) for name in c.keys(): @@ -47,6 +52,10 @@ mock_bts0 = clone_mod(mock_bts, '_bts0') mock_bts1 = clone_mod(mock_bts, '_bts1') +mock_esme0 = clone_mod(mock_esme, '_esme0') +mock_esme1 = clone_mod(mock_esme, '_esme1') +mock_esme1['password'] = '' + vals = dict(nitb=dict( net=dict( mcc='val_mcc', @@ -59,6 +68,10 @@ ), ip_address=dict(addr='val_ip_address'), ), + smsc=dict( + policy='val_smsc_policy', + esme_list=(mock_esme0, mock_esme1) + ), ) print(template.render('osmo-nitb.cfg', vals)) diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl b/selftest/template_test/osmo-nitb.cfg.tmpl index 3404b7f..7a76878 100644 --- a/selftest/template_test/osmo-nitb.cfg.tmpl +++ b/selftest/template_test/osmo-nitb.cfg.tmpl @@ -47,12 +47,18 @@ timer t3119 0 timer t3141 0 smpp - local-tcp-ip ${smpp_bind_ip} 2775 - system-id test - policy closed - esme test - password test - default-route + local-tcp-ip ${nitb.ip_address.addr} 2775 + system-id test-nitb + policy ${smsc.policy} + %for esme in esme_list: + esme ${esme.system_id} + % if esme.password == '': + no password + % else: + password ${esme.password} + % endif + default-route + %endfor ctrl bind ${ctrl_bind_ip} %for bts in bts_list: diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py new file mode 100644 index 0000000..f92863d --- /dev/null +++ b/src/osmo_gsm_tester/esme.py @@ -0,0 +1,138 @@ +# osmo_gsm_tester: SMPP ESME to talk to SMSC +# +# Copyright (C) 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 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 . + +import smpplib.gsm +import smpplib.client +import smpplib.consts +import smpplib.exceptions + +from . import log, util, event_loop, sms + +# if you want to know what's happening inside python-smpplib +#import logging +#logging.basicConfig(level='DEBUG') + +MAX_SYS_ID_LEN = 16 +MAX_PASSWD_LEN = 16 + +class Esme(log.Origin): + client = None + smsc = None + + def __init__(self, msisdn): + self.msisdn = msisdn + # Get last characters of msisdn to stay inside MAX_SYS_ID_LEN. Similar to modulus operator. + self.set_system_id('esme-' + self.msisdn[-11:]) + super().__init__(log.C_TST, self.system_id) + self.set_password('esme-pwd') + self.connected = False + self.bound = False + self.listening = False + + def __del__(self): + try: + self.disconnect() + except smpplib.exceptions.ConnectionError: + pass + + def set_smsc(self, smsc): + self.smsc = smsc + + def set_system_id(self, name): + if len(name) > MAX_SYS_ID_LEN: + raise log.Error('Esme system_id too long! %d vs %d', len(name), MAX_SYS_ID_LEN) + self.system_id = name + + def set_password(self, password): + if len(password) > MAX_PASSWD_LEN: + raise log.Error('Esme password too long! %d vs %d', len(password), MAX_PASSWD_LEN) + self.password = password + + def conf_for_smsc(self): + config = { 'system_id': self.system_id, 'password': self.password } + return config + + def poll(self): + self.client.poll() + + def start_listening(self): + self.listening = True + event_loop.register_poll_func(self.poll) + + def stop_listening(self): + if not self.listening: + return + self.listening = False + # Empty the queue before processing the unbind + disconnect PDUs + event_loop.unregister_poll_func(self.poll) + self.poll() + + def connect(self): + host, port = self.smsc.addr_port + if self.client: + self.disconnect() + self.client = smpplib.client.Client(host, port, timeout=None) + self.client.set_message_sent_handler( + lambda pdu: self.dbg('message sent:', repr(pdu)) ) + self.client.set_message_received_handler( + lambda pdu: self.dbg('message received:', repr(pdu)) ) + self.client.connect() + self.connected = True + self.client.bind_transceiver(system_id=self.system_id, password=self.password) + self.bound = True + self.log('Connected and bound successfully. Starting to listen') + self.start_listening() + + def disconnect(self): + self.stop_listening() + if self.bound: + self.client.unbind() + self.bound = False + if self.connected: + self.client.disconnect() + self.connected = False + + def run_method_expect_failure(self, errcode, method, *args): + try: + method(*args) + #it should not succeed, raise an exception: + raise log.Error('SMPP Failure: %s should have failed with SMPP error %d (%s) but succeeded.' % (method, errcode, smpplib.consts.DESCRIPTIONS[errcode])) + except smpplib.exceptions.PDUError as e: + if e.args[1] != errcode: + raise e + + def sms_send(self, sms_obj): + parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(str(sms_obj)) + + self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) + for part in parts: + pdu = self.client.send_message( + source_addr_ton=smpplib.consts.SMPP_TON_INTL, + source_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + source_addr=sms_obj.src_msisdn(), + dest_addr_ton=smpplib.consts.SMPP_TON_INTL, + dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN, + destination_addr=sms_obj.dst_msisdn(), + short_message=part, + data_coding=encoding_flag, + esm_class=smpplib.consts.SMPP_MSGMODE_FORWARD, + registered_delivery=False, + ) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 063b477..2c9b1e3 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -20,7 +20,7 @@ import os import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoMsc(log.Origin): suite_run = None @@ -30,6 +30,7 @@ process = None hlr = None config = None + smsc = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) @@ -37,6 +38,7 @@ self.ip_address = ip_address self.hlr = hlr self.mgcpgw = mgcpgw + self.smsc = smsc.Smsc((ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-msc') @@ -73,6 +75,7 @@ config.overlay(values, dict(msc=dict(ip_address=self.ip_address))) config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) + config.overlay(values, self.smsc.get_config()) self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 484358e..3ef5276 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -21,7 +21,7 @@ import re import pprint -from . import log, util, config, template, process, osmo_ctrl, pcap_recorder +from . import log, util, config, template, process, osmo_ctrl, pcap_recorder, smsc class OsmoNitb(log.Origin): suite_run = None @@ -30,12 +30,14 @@ config_file = None process = None bts = None + smsc = None def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) self.suite_run = suite_run self.ip_address = ip_address self.bts = [] + self.smsc = smsc.Smsc((ip_address.get('addr'), 2775)) def start(self): self.log('Starting osmo-nitb') @@ -75,6 +77,7 @@ for bts in self.bts: bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) + config.overlay(values, self.smsc.get_config()) self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py index 570ef96..e264b66 100644 --- a/src/osmo_gsm_tester/sms.py +++ b/src/osmo_gsm_tester/sms.py @@ -21,14 +21,16 @@ _last_sms_idx = 0 msg = None - def __init__(self, from_msisdn=None, to_msisdn=None, *tokens): + def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens): Sms._last_sms_idx += 1 + self._src_msisdn = src_msisdn + self._dst_msisdn = dst_msisdn msgs = ['message nr. %d' % Sms._last_sms_idx] msgs.extend(tokens) - if from_msisdn: - msgs.append('from %s' % from_msisdn) - if to_msisdn: - msgs.append('to %s' % to_msisdn) + if src_msisdn: + msgs.append('from %s' % src_msisdn) + if dst_msisdn: + msgs.append('to %s' % dst_msisdn) self.msg = ', '.join(msgs) def __str__(self): @@ -42,6 +44,12 @@ return self.msg == other.msg return self.msg == other + def src_msisdn(self): + return self._src_msisdn + + def dst_msisdn(self): + return self._dst_msisdn + def matches(self, msg): return self.msg == msg diff --git a/src/osmo_gsm_tester/smsc.py b/src/osmo_gsm_tester/smsc.py new file mode 100644 index 0000000..4837f37 --- /dev/null +++ b/src/osmo_gsm_tester/smsc.py @@ -0,0 +1,50 @@ +# osmo_gsm_tester: smsc interface +# +# 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 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 . + +from . import log, config, util, template, process + +class Smsc: + esmes = None + + SMSC_POLICY_CLOSED = 'closed' + SMSC_POLICY_ACCEPT_ALL = 'accept-all' + + def __init__(self, smpp_addr_port): + self.addr_port = smpp_addr_port + self.policy = self.SMSC_POLICY_CLOSED + self.esmes = [] + + def get_config(self): + values = { 'smsc': { 'policy': self.policy } } + esme_list = [] + for esme in self.esmes: + esme_list.append(esme.conf_for_smsc()) + config.overlay(values, dict(smsc=dict(esme_list=esme_list))) + return values + + def esme_add(self, esme): + if esme.system_id == '': + raise log.Error('esme system_id cannot be empty') + self.esmes.append(esme) + esme.set_smsc(self) + + def set_smsc_policy(self, smsc_policy): + self.policy = smsc_policy + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index f4b9260..71b8dc7 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import copy import traceback import pprint -from . import config, log, template, util, resource, schema, ofono_client, event_loop +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 test @@ -99,7 +99,7 @@ log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3) self.status = Test.UNKNOWN self.start_timestamp = time.time() - test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop) + test.setup(self.suite_run, self, ofono_client, sys.modules[__name__], event_loop, sms) with self.redirect_stdout(): util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename), self.path) @@ -363,8 +363,12 @@ l.append(self.modem()) return l + def esme(self): + esme_obj = esme.Esme(self.msisdn()) + return esme_obj + def msisdn(self): - msisdn = self.resources_pool.next_msisdn(self.origin) + msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) return msisdn diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 247365e..89982e0 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -23,10 +23,16 @@ bind ${msc.ip_address.addr} smpp local-tcp-ip ${msc.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-msc + policy ${smsc.policy} +%for esme in smsc.esme_list: + esme ${esme.system_id} +% if esme.password == '': + no password +% else: + password ${esme.password} +% endif default-route +%endfor hlr remote-ip ${hlr.ip_address.addr} diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl index a47ac02..23cc225 100644 --- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl @@ -76,10 +76,16 @@ %endfor smpp local-tcp-ip ${nitb.ip_address.addr} 2775 - system-id test - policy closed - esme test - password test + system-id test-nitb + policy ${smsc.policy} +%for esme in smsc.esme_list: + esme ${esme.system_id} +% if esme.password == '': + no password +% else: + password ${esme.password} +% endif default-route +%endfor ctrl bind ${nitb.ip_address.addr} diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py index 2958501..49911b3 100644 --- a/src/osmo_gsm_tester/test.py +++ b/src/osmo_gsm_tester/test.py @@ -33,9 +33,10 @@ poll = None prompt = None Timeout = None +Sms = None -def setup(suite_run, _test, ofono_client, suite_module, event_module): - global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout +def setup(suite_run, _test, ofono_client, suite_module, event_module, sms_module): + global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms trial = suite_run.trial suite = suite_run test = _test @@ -49,5 +50,6 @@ poll = event_module.poll prompt = suite_run.prompt Timeout = suite_module.Timeout + Sms = sms_module.Sms # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/aoip_smpp/esme_connect_policy_acceptall.py b/suites/aoip_smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..2a954d5 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on +# the config file + +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) +smsc = msc.smsc +esme = suite.esme() + +# Here we deliberately omit calling smsc.esme_add() to avoid having it included +# in the smsc config. +smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL) +esme.set_smsc(smsc) + +hlr.start() +msc.start() +mgcpgw.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. +log('Test connect with non-empty values in system_id and password') +esme.set_system_id('foo') +esme.set_password('bar') +esme.connect() +esme.disconnect() + +log('Test connect with empty values in system_id and password') +esme.set_system_id('') +esme.set_password('') +esme.connect() +esme.disconnect() diff --git a/suites/aoip_smpp/esme_connect_policy_closed.py b/suites/aoip_smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..29b25d1 --- /dev/null +++ b/suites/aoip_smpp/esme_connect_policy_closed.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +smsc = msc.smsc + +esme = suite.esme() +esme_no_pwd = suite.esme() +esme_no_pwd.set_password('') + +smsc.set_smsc_policy(smsc.SMSC_POLICY_CLOSED) +smsc.esme_add(esme) +smsc.esme_add(esme_no_pwd) + +hlr.start() +msc.start() +mgcpgw.start() + +log('Test with correct credentials (no password)') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials (no password, non empty)') +esme_no_pwd.set_password('foobar') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials') +esme.connect() +esme.disconnect() + +log('Test with bad password, checking for failure') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +log('Test with bad system_id, checking for failure') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/aoip_smpp/esme_ms_sms.py b/suites/aoip_smpp/esme_ms_sms.py new file mode 100755 index 0000000..7f9ef18 --- /dev/null +++ b/suites/aoip_smpp/esme_ms_sms.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +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() +bsc.bts_add(bts) + +ms = suite.modem() +esme = suite.esme() +msc.smsc.esme_add(esme) + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.start() +bts.start() + +esme.connect() +hlr.subscriber_add(ms) +ms.connect(msc.mcc_mnc()) + +ms.log_info() +print('waiting for modem to attach...') +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/aoip_smpp/suite.conf b/suites/aoip_smpp/suite.conf new file mode 100644 index 0000000..46f8d09 --- /dev/null +++ b/suites/aoip_smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s diff --git a/suites/smpp/esme_connect_policy_acceptall.py b/suites/smpp/esme_connect_policy_acceptall.py new file mode 100755 index 0000000..d22703d --- /dev/null +++ b/suites/smpp/esme_connect_policy_acceptall.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'accept-all' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) which do not appear on +# the config file + +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +smsc = nitb.smsc +esme = suite.esme() + +# Here we deliberately omit calling smsc.esme_add() to avoid having it included +# in the smsc config. +smsc.set_smsc_policy(smsc.SMSC_POLICY_ACCEPT_ALL) +esme.set_smsc(smsc) + +nitb.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. +log('Test connect with non-empty values in system_id and password') +esme.set_system_id('foo') +esme.set_password('bar') +esme.connect() +esme.disconnect() + +log('Test connect with empty values in system_id and password') +esme.set_system_id('') +esme.set_password('') +esme.connect() +esme.disconnect() diff --git a/suites/smpp/esme_connect_policy_closed.py b/suites/smpp/esme_connect_policy_closed.py new file mode 100755 index 0000000..7fac276 --- /dev/null +++ b/suites/smpp/esme_connect_policy_closed.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases while in 'closed' policy: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * SMPP interface of SMSC rejects ESMEs with known system id but wrong password. +# * SMPP interface of SMSC rejects ESEMs with unknown system id + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVPASWD = 0x0000000E +SMPP_ESME_RINVSYSID = 0x0000000F + +nitb = suite.nitb() +smsc = nitb.smsc +esme = suite.esme() +esme_no_pwd = suite.esme() +esme_no_pwd.set_password('') + +smsc.set_smsc_policy(smsc.SMSC_POLICY_CLOSED) +smsc.esme_add(esme) +smsc.esme_add(esme_no_pwd) + +nitb.start() + +log('Test with correct credentials (no password)') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials (no password, non empty)') +esme_no_pwd.set_password('foobar') +esme_no_pwd.connect() +esme_no_pwd.disconnect() + +log('Test with correct credentials') +esme.connect() +esme.disconnect() + +log('Test with bad password, checking for failure') +correct_password = esme.password +new_password = 'barfoo' if correct_password == 'foobar' else 'foobar' +esme.set_password(new_password) +esme.run_method_expect_failure(SMPP_ESME_RINVPASWD, esme.connect) +esme.set_password(correct_password) + +log('Test with bad system_id, checking for failure') +correct_system_id = esme.system_id +new_system_id = 'barfoo' if correct_system_id == 'foobar' else 'foobar' +esme.set_system_id(new_system_id) +esme.run_method_expect_failure(SMPP_ESME_RINVSYSID, esme.connect) +esme.set_system_id(correct_system_id) diff --git a/suites/smpp/esme_ms_sms.py b/suites/smpp/esme_ms_sms.py new file mode 100755 index 0000000..bc9d7d4 --- /dev/null +++ b/suites/smpp/esme_ms_sms.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +# This test checks following use-cases: +# * SMPP interface of SMSC accepts SMPP clients (ESMEs) with password previously +# defined in its configuration file. +# * ESME can send an SMS to an already registered MS when SMSC is in 'forward' mode. + +from osmo_gsm_tester.test import * + +SMPP_ESME_RINVDSTADR = 0x0000000B + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() +esme = suite.esme() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.smsc.esme_add(esme) +nitb.start() +bts.start() + +esme.connect() +nitb.subscriber_add(ms) +ms.connect(nitb.mcc_mnc()) + +ms.log_info() +print('waiting for modem to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) + +print('sending first sms...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send message') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + +print('sending second sms (unicode chars not in gsm aplhabet)...') +msg = Sms(esme.msisdn, ms.msisdn, 'chars:[???????]') +esme.sms_send(msg) +wait(ms.sms_was_received, msg) + + +# FIXME: This test is not failing with error but succeeds, need to check why: (forward vs store policy?) +# wrong_msisdn = ms.msisdn + esme.msisdn +# print('sending third sms (with wrong msisdn %s)' % wrong_msisdn) +# msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send, msg) + +esme.disconnect() diff --git a/suites/smpp/suite.conf b/suites/smpp/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/smpp/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/2884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I14ca3cb009d6d646a449ca99b0200da12085c0da Gerrit-PatchSet: 5 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 Sun Jun 18 08:48:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:48:32 +0000 Subject: osmo-bts[master]: octphy: improve log output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Sun Jun 18 08:49:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:49:25 +0000 Subject: osmo-bts[master]: measurement: improve log output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:49:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:49:47 +0000 Subject: osmo-bts[master]: octphy: complete value strings (octphy_cid_vals) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9843137b55534a29938d5c2308244a6950de788f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Sun Jun 18 08:50:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:50:18 +0000 Subject: libosmocore[master]: tlv_test.c: Fix compilation warnings In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d7d926939c14700cbca732bd64e588c75424b4 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 Sun Jun 18 08:50:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:50:29 +0000 Subject: libosmocore[master]: card_fs_uicc.c: Fix unused compilation warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a61d17f9989ecddafbc68d4b9446853e4c15159 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 Sun Jun 18 08:50:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:50:48 +0000 Subject: libosmocore[master]: Fix compilation warning on deprecated macro In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32212f20756f828af1017482a71e29e4b3adbad4 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 Sun Jun 18 08:51:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:51:19 +0000 Subject: libosmocore[master]: gprs_ns_test.c: Remove unused byte arrays In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I140de30038222b0419423d8c4f9da1946651a4e7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 08:51:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 08:51:45 +0000 Subject: libosmocore[master]: sms_test.c: Remove test of deprecated wrapper function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaac701bdf0c0e66c343f68cc31d82550a024ef57 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:00:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:00:19 +0000 Subject: libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Patch Set 2: (5 comments) https://gerrit.osmocom.org/#/c/2924/2/include/osmocom/sigtran/sccp_sap.h File include/osmocom/sigtran/sccp_sap.h: Line 252: struct osmo_sccp_addr_list * i wouldn't call the structure sccp_addr_list but something like sccp_addr_entry. Calling it 'list' implies that you're returning a list of (matching) addresses, when in reality you are looking up a single address https://gerrit.osmocom.org/#/c/2924/2/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 904: struct osmo_sccp_addr *addr; is there a good reason to dynamically allocate osmo_sccp_addr here, and not simply have it a regular member variable? Line 1099: "sccp-address .NAME", I think the '.' in front of NAME means that the name may contain spaces (i.e. any number of additional tokens will be matched, as opposed to one token). I don't think this is desirable,so let's just have NAME witout the . Line 1308: "global-title-indicator <0-255>", "Set Global Title Indicator\n" "GTI\n") Please check the SCCP specs for the actual permitted range. ITU-T Q.711 to Q.714 are the relevant specs. I think it's muhc less bits than 8. same for translation-type and numbering plan below. Line 1354: "digits .DIGITS", "Set Global Title Digits\n" "Number digits\n") we cannot represent spaces in the digit list, so please remove the '.' -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 18 09:01:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:01:25 +0000 Subject: libosmocore[master]: vty: additional nodes for sccp-address configuration In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2922/1/TODO-RELEASE File TODO-RELEASE: Line 14: libosmovty ABI change redefine _LAST_OSMOVTY_NODE as a high number to increase node space > you are removing two enum items and use reserved space, so _LAST_OSMOVTY_NO the point is we need to introduce new library-reserved codes at some point, as we're running out of them. -- To view, visit https://gerrit.osmocom.org/2922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Jun 18 09:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:01:29 +0000 Subject: [PATCH] libosmocore[master]: lapd_test.c: Convert compilation warning to level message Message-ID: Review at https://gerrit.osmocom.org/2953 lapd_test.c: Convert compilation warning to level message This way we clean the build of warnings completely and we can enable -Werror but we still see this FIXME message while compiling. Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd --- M tests/lapd/lapd_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/2953/1 diff --git a/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.c index e322314..0dccaa4 100644 --- a/tests/lapd/lapd_test.c +++ b/tests/lapd/lapd_test.c @@ -358,7 +358,7 @@ /* Verify the added RSL_IE_L3_INFO but we have a bug here */ OSMO_ASSERT(msg->data[6] == RSL_IE_L3_INFO); - #warning "RSL_IE_L3_INFO 16 bit length is wrong" + #pragma message ("RSL_IE_L3_INFO 16 bit length is wrong") /* This should be okay but it is actually 0x0, 0x9c on ia-32 */ /* OSMO_ASSERT(msg->data[7] == 0x0 && msg->data[8] == 0x0); */ } else if (state->ms_read == 1) { -- To view, visit https://gerrit.osmocom.org/2953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:03:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:03:09 +0000 Subject: osmo-trx[master]: sigProcLib: Remove trigonometric tables In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I45bba5daf8610cbba6af95b92c2142f2256491ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:03:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:03:24 +0000 Subject: osmo-trx[master]: sigProcLib: Use explicit NaN check in sinc table generation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a838fe3139fa977dfe906246020a14451185714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:04:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:04:15 +0000 Subject: [PATCH] libosmocore[master]: configure.ac: Enable -Werror by default Message-ID: Review at https://gerrit.osmocom.org/2954 configure.ac: Enable -Werror by default Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/2954/1 diff --git a/configure.ac b/configure.ac index 340a896..531544a 100644 --- a/configure.ac +++ b/configure.ac @@ -235,8 +235,8 @@ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" fi -CFLAGS+=" -DBUILDING_LIBOSMOCORE" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE" +CFLAGS+=" -DBUILDING_LIBOSMOCORE -Werror" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Werror" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:04:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:04:44 +0000 Subject: libosmocore[master]: cosmetic: remove API documentation strings in header file In-Reply-To: References: Message-ID: Patch Set 1: do we have that API documentation in the C files for the speciifc functions for which you remove the comments in the header? If yes, we can merge this. If no, then the patch should rather move the comments from .h to .c and doxygen-ize them. -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 1 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 Sun Jun 18 09:05:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:05:12 +0000 Subject: osmo-bts[master]: RSL: check for abnormal SI2q values In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d 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 Sun Jun 18 09:05:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:05:25 +0000 Subject: [MERGED] osmo-bts[master]: RSL: check for abnormal SI2q values In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL: check for abnormal SI2q values ...................................................................... RSL: check for abnormal SI2q values Check for impossible index and count values of SI2q messages. The limit is defined in 3GPP TS 44.018 Table 10.5.2.33b.1 Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d Fixes: CID 170749 --- M src/common/rsl.c 1 file changed, 6 insertions(+), 0 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 bb05dec..187a2e7 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -315,6 +315,12 @@ return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > SI2Q_MAX_NUM) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn impossible parameters: index %u, count %u" + "should be <= %u\n", bts->si2q_index, bts->si2q_count, SI2Q_MAX_NUM); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + 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); break; -- To view, visit https://gerrit.osmocom.org/2940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:06:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:06:21 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:07:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:07:12 +0000 Subject: osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-manuals 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 Sun Jun 18 09:07:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:07:33 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OsmoBTS: Update osmotrx ip to diff between local and remote ...................................................................... OsmoBTS: Update osmotrx ip to diff between local and remote Change Id of the code implementation: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5 Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index 1c619d3..40a86e2 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -226,8 +226,14 @@ ===== `osmotrx ip HOST` -Set the IP address of the OsmoTRX transceiver to which we should connect -to. +Set the IP address for the OsmoTRX interface for both the local (OsmoBTS) and +remote (OsmoTRX) side of the UDP flows. This option has been deprecated by the +more detailed option `osmotrx ip (local|remote) A.B.C.D`. + +===== `osmotrx ip (local|remote) A.B.C.D` + +Set the IP address for the OsmoTRX interface for either the local (OsmoBTS) or +remote (OsmoTRX) side of the UDP flows. ===== `osmotrx base-port (local|remote) <0-65535>` -- To view, visit https://gerrit.osmocom.org/2747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals 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 Sun Jun 18 09:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:08:16 +0000 Subject: osmo-bts[master]: Move parameter file opening into separate function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c 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 Sun Jun 18 09:08:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:08:30 +0000 Subject: osmo-bts[master]: lc15bts-mgr: use extended config file example In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92 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 Sun Jun 18 09:10:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:10:37 +0000 Subject: osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Patch Set 2: I think this is something that we can only do in close coordination with Nutaq, i.e. if they had some specific reason to not use the real path but rather go via the symlink. Minh, can you comment on that? -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 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-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:11:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:11:10 +0000 Subject: osmo-trx[master]: common: Declare explicit Vector move constructor In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:13:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:13:07 +0000 Subject: openggsn[master]: IPv6 support In-Reply-To: References: Message-ID: Patch Set 1: Hi Gerrie, do you have any questions related to the feedback I provided in my review a week ago? Would be really great to see this patch move ahead. Thanks! -- To view, visit https://gerrit.osmocom.org/2870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8ce8b4b8cd2ba97f7ba122de4703983111046e4 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: groos at xiplink.com Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:13:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:13:57 +0000 Subject: libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Patch Set 2: I would argue to call it OSMO_BYTES_FOR_BITS() or something like that to make the name more expressive. -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:26:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:26:41 +0000 Subject: [PATCH] libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions Message-ID: Review at https://gerrit.osmocom.org/2955 abis_test.c: Fix warning appearing on some buggy gcc versions Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 --- M tests/abis/abis_test.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/2955/1 diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c index a303c91..cb88b01 100644 --- a/tests/abis/abis_test.c +++ b/tests/abis/abis_test.c @@ -122,7 +122,8 @@ static inline void chk_raw(const char *what, const uint8_t *data, uint16_t len) { - struct abis_nm_sw_desc sw = { 0 }; + /* = { 0 } triggers a warning in some gcc versions due to a bug: gcc issue #53119 */ + struct abis_nm_sw_desc sw = { {0} }; int res = abis_nm_get_sw_conf(data, len, &sw, 1); uint16_t xlen = abis_nm_get_sw_desc_len(data, len); @@ -144,7 +145,8 @@ { int res; uint16_t len; - struct abis_nm_sw_desc sw = { 0 }, put = { + /* = { 0 } triggers a warning in some gcc versions due to a bug: gcc issue #53119 */ + struct abis_nm_sw_desc sw = { {0} }, put = { .file_id_len = strlen(f_id), .file_version_len = strlen(f_ver), }; -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:26:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:26:41 +0000 Subject: [PATCH] libosmocore[master]: sercomm_test.c: return correctly in main Message-ID: Review at https://gerrit.osmocom.org/2956 sercomm_test.c: return correctly in main Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a --- M tests/sercomm/sercomm_test.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/2956/1 diff --git a/tests/sercomm/sercomm_test.c b/tests/sercomm/sercomm_test.c index 8b1ffdf..f4f1c22 100644 --- a/tests/sercomm/sercomm_test.c +++ b/tests/sercomm/sercomm_test.c @@ -133,4 +133,5 @@ int main(int argc, char **argv) { test_sercomm(); + return 0; } -- To view, visit https://gerrit.osmocom.org/2956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:26:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:26:42 +0000 Subject: [PATCH] libosmocore[master]: osmo-sim-test.c: Remove unused functions Message-ID: Review at https://gerrit.osmocom.org/2957 osmo-sim-test.c: Remove unused functions Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b --- M utils/osmo-sim-test.c 1 file changed, 0 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/2957/1 diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index d5e932e..ea24120 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -91,22 +91,6 @@ return msg; } -/* 11.1.6 */ -static struct msgb *update_record_nr(struct osim_chan_hdl *st, uint8_t rec_nr, - const uint8_t *data, uint16_t rec_size) -{ - struct msgb *msg; - uint8_t *cur; - - msg = osim_new_apdumsg(0x00, 0xDC, rec_nr, 0x04, rec_size, 0); - cur = msgb_put(msg, rec_size); - memcpy(cur, data, rec_size); - - osim_transceive_apdu(st, msg); - - return msg; -} - /* 11.1.3 */ static struct msgb *read_binary(struct osim_chan_hdl *st, uint16_t offset, uint16_t len) { @@ -121,27 +105,6 @@ return msg; } - -/* 11.1.4 */ -static struct msgb *update_binary(struct osim_chan_hdl *st, uint16_t offset, - const uint8_t *data, uint16_t len) -{ - struct msgb *msg; - uint8_t *cur; - - if (offset > 0x7fff || len > 256) - return NULL; - - msg = osim_new_apdumsg(0x00, 0xD6, offset >> 8, offset & 0xff, len & 0xff, 0); - cur = msgb_put(msg, len); - memcpy(cur, data, len); - - osim_transceive_apdu(st, msg); - - return msg; -} - - static int dump_fcp_template(struct tlv_parsed *tp) { -- To view, visit https://gerrit.osmocom.org/2957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:26:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:26:42 +0000 Subject: [PATCH] libosmocore[master]: configure.ac: Enable -Wall by default Message-ID: Review at https://gerrit.osmocom.org/2958 configure.ac: Enable -Wall by default Change-Id: I70f917e05ad46049487710d1752aad2505c96696 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/2958/1 diff --git a/configure.ac b/configure.ac index 531544a..59872f6 100644 --- a/configure.ac +++ b/configure.ac @@ -236,7 +236,7 @@ fi CFLAGS+=" -DBUILDING_LIBOSMOCORE -Werror" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Werror" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Werror -Wall" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:44:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 09:44:41 +0000 Subject: [PATCH] libosmocore[master]: timer_gettimeofday.c: Fix implicit use of timeradd Message-ID: Review at https://gerrit.osmocom.org/2959 timer_gettimeofday.c: Fix implicit use of timeradd timer_gettimeofday.c: In function 'osmo_gettimeofday_override_add': timer_gettimeofday.c:54:2: error: implicit declaration of function 'timeradd' [-Werror=implicit-function-declaration] timeradd(&osmo_gettimeofday_override_time, &val, ^ Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 --- M src/timer_gettimeofday.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/59/2959/1 diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index 81a1598..3573051 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -29,6 +29,7 @@ #include #include +#include bool osmo_gettimeofday_override = false; struct timeval osmo_gettimeofday_override_time = { 23, 424242 }; -- To view, visit https://gerrit.osmocom.org/2959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 09:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 09:58:48 +0000 Subject: [PATCH] openbsc[master]: Add vty command "radio-link-timeout infinite" for uplink rx ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2947 to look at the new patch set (#2). Add vty command "radio-link-timeout infinite" for uplink rx testing When we are performing Rx sensitivity testing on a BTS, we want to deactivate the connection failure criterion / radio link timeout, i.e. no matter how many SACCH frames in uplink are failed to decode, the BTS should never close the channel. OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way how this behavior can be requested from the BTS via an OML attribute. This patch adds support to the BSC to actually set that attribute. Do not use this in production networks, as the BTS will keep open radio channels indefinitely even if the phone is gone and no longer transmitting anything. This is a pure testing feature. Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 --- M openbsc/include/openbsc/gsm_04_08.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c M openbsc/src/libcommon/gsm_data.c 6 files changed, 79 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/47/2947/2 diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h index fe19ff4..a8b2de9 100644 --- a/openbsc/include/openbsc/gsm_04_08.h +++ b/openbsc/include/openbsc/gsm_04_08.h @@ -26,20 +26,6 @@ name); } -static inline int get_radio_link_timeout(struct gsm48_cell_options *cell_options) -{ - return (cell_options->radio_link_timeout + 1) << 2; -} - -static inline void set_radio_link_timeout(struct gsm48_cell_options *cell_options, int value) -{ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; -} - /* config options controlling the behaviour of the lower leves */ void gsm0408_allow_everyone(int allow); void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 5ab7c3f..a974051 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -590,4 +590,7 @@ int bts_depend_check(struct gsm_bts *bts); int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); +int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts); +void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); + #endif /* _GSM_DATA_H */ diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index d3fd757..4c71a07 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -872,6 +872,8 @@ } 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; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 2fc39ab..9fc2895 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -604,9 +604,11 @@ vty_out(vty, " periodic location update %u%s", bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - vty_out(vty, " radio-link-timeout %d%s", - get_radio_link_timeout(&bts->si_common.cell_options), - VTY_NEWLINE); + if (gsm_bts_get_radio_link_timeout(bts) < 0) + vty_out(vty, " radio-link-timeout infinite%s", VTY_NEWLINE); + 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); @@ -2299,7 +2301,25 @@ { struct gsm_bts *bts = vty->index; - set_radio_link_timeout(&bts->si_common.cell_options, atoi(argv[0])); + gsm_bts_set_radio_link_timeout(bts, atoi(argv[0])); + + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_radio_link_timeout_inf, cfg_bts_radio_link_timeout_inf_cmd, + "radio-link-timeout infinite", + "Radio link timeout criterion (BTS side)\n" + "Infinite Radio link timeout value (use only for BTS RF testing)\n") +{ + struct gsm_bts *bts = vty->index; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + vty_out(vty, "%% infinite radio link timeout not supported by this BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% INFINITE RADIO LINK TIMEOUT, USE ONLY FOR BTS RF TESTING%s", VTY_NEWLINE); + gsm_bts_set_radio_link_timeout(bts, -1); return CMD_SUCCESS; } @@ -4180,6 +4200,7 @@ install_element(BTS_NODE, &cfg_bts_penalty_time_cmd); install_element(BTS_NODE, &cfg_bts_penalty_time_rsvd_cmd); install_element(BTS_NODE, &cfg_bts_radio_link_timeout_cmd); + install_element(BTS_NODE, &cfg_bts_radio_link_timeout_inf_cmd); install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); install_element(BTS_NODE, &cfg_bts_gprs_11bit_rach_support_for_egprs_cmd); install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 0291129..473e1ca 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -38,6 +38,7 @@ { struct msgb *msgb; uint8_t buf[256]; + int rlt; msgb = msgb_alloc(1024, "nanobts_attr_bts"); memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6); @@ -46,9 +47,16 @@ /* interference avg. period in numbers of SACCH multifr */ msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, 0x06); - /* conn fail based on SACCH error rate */ - buf[0] = 0x01; - buf[1] = get_radio_link_timeout(&bts->si_common.cell_options); + rlt = gsm_bts_get_radio_link_timeout(bts); + if (rlt == -1) { + /* Osmocom extension: Use infinite radio link timeout */ + buf[0] = 0xFF; + buf[1] = 0x00; + } else { + /* conn fail based on SACCH error rate */ + buf[0] = 0x01; + buf[1] = rlt; + } msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf); memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 8830ce1..db7de08 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -323,8 +323,7 @@ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ - set_radio_link_timeout(&bts->si_common.cell_options, 32); - /* Use RADIO LINK TIMEOUT of 32 seconds */ + gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); @@ -435,3 +434,40 @@ } return 1; } + +/* get the radio link timeout (based on SACCH decode errors, according + * to algorithm specified in TS 05.08 section 5.2. A value of -1 + * indicates we should use an infinitely long timeout, which only works + * with OsmoBTS as the BTS implementation */ +int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) +{ + const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; + + if (bts->infinite_radio_link_timeout) + return -1; + else { + /* Encoding as per Table 10.5.21 of TS 04.08 */ + return (cell_options->radio_link_timeout + 1) << 2; + } +} + +/* set the radio link timeout (based on SACCH decode errors, according + * to algorithm specified in TS 05.08 Section 5.2. A value of -1 + * indicates we should use an infinitely long timeout, which only works + * with OsmoBTS as the BTS implementation */ +void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) +{ + struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; + + if (value < 0) + bts->infinite_radio_link_timeout = true; + else { + bts->infinite_radio_link_timeout = false; + /* Encoding as per Table 10.5.21 of TS 04.08 */ + if (value < 4) + value = 4; + if (value > 64) + value = 64; + cell_options->radio_link_timeout = (value >> 2) - 1; + } +} -- To view, visit https://gerrit.osmocom.org/2947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 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 Sun Jun 18 10:00:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 10:00:40 +0000 Subject: osmo-bts[master]: OML Add osmocom-specific way to deactivate radio link timeout In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5 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 Sun Jun 18 10:00:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 10:00:43 +0000 Subject: [MERGED] osmo-bts[master]: OML Add osmocom-specific way to deactivate radio link timeout In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OML Add osmocom-specific way to deactivate radio link timeout ...................................................................... OML Add osmocom-specific way to deactivate radio link timeout In some situations (e.g. when trying to do measurements/testing on the BTS receiver / uplink) it is useful to have a way to disable the radio link timeout and keep any channel open until deactivated, irrespective of whether (valid) data is received or not. This adds a related feature that can be activated by using an osmocom-specific value of 0xff for the TS 12.21 Connection Failure Criterion (9.4.14). Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5 --- M include/osmo-bts/gsm_data.h M src/common/l1sap.c M src/common/oml.c 3 files changed, 22 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 772a705..c513b27 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -94,7 +94,9 @@ uint8_t tc4_ctr; } si; struct gsm_time gsm_time; - uint8_t radio_link_timeout; + /* Radio Link Timeout counter. -1 disables timeout for + * lab/measurement purpose */ + int radio_link_timeout; int ul_power_target; /* Uplink Rx power target */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index fd8c54e..b9104b7 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -809,6 +809,10 @@ { struct gsm_bts_role_bts *btsb = lchan->ts->trx->bts->role; + /* Bypass radio link timeout if set to -1 */ + if (btsb->radio_link_timeout < 0) + return; + /* if link loss criterion already reached */ if (lchan->s == 0) { DEBUGP(DMEAS, "%s radio link counter S already 0.\n", diff --git a/src/common/oml.c b/src/common/oml.c index 982713e..fe35e85 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -627,17 +627,27 @@ if (TLVP_PRES_LEN(&tp, NM_ATT_CONN_FAIL_CRIT, 1)) { const uint8_t *val = TLVP_VAL(&tp, NM_ATT_CONN_FAIL_CRIT); - if (TLVP_LEN(&tp, NM_ATT_CONN_FAIL_CRIT) < 2 - || val[0] != 0x01 || val[1] < 4 || val[1] > 64) { + switch (val[0]) { + case 0xFF: /* Osmocom specific Extension of TS 12.21 */ + LOGP(DOML, LOGL_NOTICE, "WARNING: Radio Link Timeout " + "explicitly disabled, only use this for lab testing!\n"); + btsb->radio_link_timeout = -1; + break; + case 0x01: /* Based on uplink SACCH (radio link timeout) */ + if (TLVP_LEN(&tp, NM_ATT_CONN_FAIL_CRIT) >= 2 && + val[1] >= 4 && val[1] <= 64) { + btsb->radio_link_timeout = val[1]; + break; + } + /* fall-through */ + case 0x02: /* Based on RXLEV/RXQUAL measurements */ + default: LOGP(DOML, LOGL_NOTICE, "Given Conn. Failure Criterion " "not supported. Please use critetion 0x01 with " "RADIO_LINK_TIMEOUT value of 4..64\n"); return oml_fom_ack_nack(msg, NM_NACK_PARAM_RANGE); } - btsb->radio_link_timeout = val[1]; } - /* if val[0] != 0x01: can be 'operator dependent' and needs to - * be parsed by bts driver */ /* 9.4.53 T200 */ if (TLVP_PRES_LEN(&tp, NM_ATT_T200, ARRAY_SIZE(btsb->t200_ms))) { -- To view, visit https://gerrit.osmocom.org/2946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5 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 Sun Jun 18 10:01:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 10:01:55 +0000 Subject: openbsc[master]: Add vty command "radio-link-timeout infinite" for uplink rx ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 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 Sun Jun 18 10:08:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 10:08:52 +0000 Subject: [MERGED] openbsc[master]: Add vty command "radio-link-timeout infinite" for uplink rx ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add vty command "radio-link-timeout infinite" for uplink rx testing ...................................................................... Add vty command "radio-link-timeout infinite" for uplink rx testing When we are performing Rx sensitivity testing on a BTS, we want to deactivate the connection failure criterion / radio link timeout, i.e. no matter how many SACCH frames in uplink are failed to decode, the BTS should never close the channel. OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way how this behavior can be requested from the BTS via an OML attribute. This patch adds support to the BSC to actually set that attribute. Do not use this in production networks, as the BTS will keep open radio channels indefinitely even if the phone is gone and no longer transmitting anything. This is a pure testing feature. Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 --- M openbsc/include/openbsc/gsm_04_08.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c M openbsc/src/libcommon/gsm_data.c 6 files changed, 79 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h index fe19ff4..a8b2de9 100644 --- a/openbsc/include/openbsc/gsm_04_08.h +++ b/openbsc/include/openbsc/gsm_04_08.h @@ -26,20 +26,6 @@ name); } -static inline int get_radio_link_timeout(struct gsm48_cell_options *cell_options) -{ - return (cell_options->radio_link_timeout + 1) << 2; -} - -static inline void set_radio_link_timeout(struct gsm48_cell_options *cell_options, int value) -{ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; -} - /* config options controlling the behaviour of the lower leves */ void gsm0408_allow_everyone(int allow); void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 5ab7c3f..a974051 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -590,4 +590,7 @@ int bts_depend_check(struct gsm_bts *bts); int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other); +int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts); +void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value); + #endif /* _GSM_DATA_H */ diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index d3fd757..4c71a07 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -872,6 +872,8 @@ } 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; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 2fc39ab..9fc2895 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -604,9 +604,11 @@ vty_out(vty, " periodic location update %u%s", bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - vty_out(vty, " radio-link-timeout %d%s", - get_radio_link_timeout(&bts->si_common.cell_options), - VTY_NEWLINE); + if (gsm_bts_get_radio_link_timeout(bts) < 0) + vty_out(vty, " radio-link-timeout infinite%s", VTY_NEWLINE); + 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); @@ -2299,7 +2301,25 @@ { struct gsm_bts *bts = vty->index; - set_radio_link_timeout(&bts->si_common.cell_options, atoi(argv[0])); + gsm_bts_set_radio_link_timeout(bts, atoi(argv[0])); + + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_radio_link_timeout_inf, cfg_bts_radio_link_timeout_inf_cmd, + "radio-link-timeout infinite", + "Radio link timeout criterion (BTS side)\n" + "Infinite Radio link timeout value (use only for BTS RF testing)\n") +{ + struct gsm_bts *bts = vty->index; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + vty_out(vty, "%% infinite radio link timeout not supported by this BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% INFINITE RADIO LINK TIMEOUT, USE ONLY FOR BTS RF TESTING%s", VTY_NEWLINE); + gsm_bts_set_radio_link_timeout(bts, -1); return CMD_SUCCESS; } @@ -4180,6 +4200,7 @@ install_element(BTS_NODE, &cfg_bts_penalty_time_cmd); install_element(BTS_NODE, &cfg_bts_penalty_time_rsvd_cmd); install_element(BTS_NODE, &cfg_bts_radio_link_timeout_cmd); + install_element(BTS_NODE, &cfg_bts_radio_link_timeout_inf_cmd); install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); install_element(BTS_NODE, &cfg_bts_gprs_11bit_rach_support_for_egprs_cmd); install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 0291129..473e1ca 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -38,6 +38,7 @@ { struct msgb *msgb; uint8_t buf[256]; + int rlt; msgb = msgb_alloc(1024, "nanobts_attr_bts"); memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6); @@ -46,9 +47,16 @@ /* interference avg. period in numbers of SACCH multifr */ msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, 0x06); - /* conn fail based on SACCH error rate */ - buf[0] = 0x01; - buf[1] = get_radio_link_timeout(&bts->si_common.cell_options); + rlt = gsm_bts_get_radio_link_timeout(bts); + if (rlt == -1) { + /* Osmocom extension: Use infinite radio link timeout */ + buf[0] = 0xFF; + buf[1] = 0x00; + } else { + /* conn fail based on SACCH error rate */ + buf[0] = 0x01; + buf[1] = rlt; + } msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf); memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 8830ce1..db7de08 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -323,8 +323,7 @@ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ - set_radio_link_timeout(&bts->si_common.cell_options, 32); - /* Use RADIO LINK TIMEOUT of 32 seconds */ + gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); @@ -435,3 +434,40 @@ } return 1; } + +/* get the radio link timeout (based on SACCH decode errors, according + * to algorithm specified in TS 05.08 section 5.2. A value of -1 + * indicates we should use an infinitely long timeout, which only works + * with OsmoBTS as the BTS implementation */ +int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) +{ + const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; + + if (bts->infinite_radio_link_timeout) + return -1; + else { + /* Encoding as per Table 10.5.21 of TS 04.08 */ + return (cell_options->radio_link_timeout + 1) << 2; + } +} + +/* set the radio link timeout (based on SACCH decode errors, according + * to algorithm specified in TS 05.08 Section 5.2. A value of -1 + * indicates we should use an infinitely long timeout, which only works + * with OsmoBTS as the BTS implementation */ +void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) +{ + struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; + + if (value < 0) + bts->infinite_radio_link_timeout = true; + else { + bts->infinite_radio_link_timeout = false; + /* Encoding as per Table 10.5.21 of TS 04.08 */ + if (value < 4) + value = 4; + if (value > 64) + value = 64; + cell_options->radio_link_timeout = (value >> 2) - 1; + } +} -- To view, visit https://gerrit.osmocom.org/2947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2 Gerrit-PatchSet: 2 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 Jun 18 11:31:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 11:31:00 +0000 Subject: [PATCH] libosmocore[master]: configure.ac: Enable -Werror by default In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2954 to look at the new patch set (#4). configure.ac: Enable -Werror by default Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/2954/4 diff --git a/configure.ac b/configure.ac index 29b7b52..c892f5e 100644 --- a/configure.ac +++ b/configure.ac @@ -235,8 +235,8 @@ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" fi -CFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" +CFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall -Werror" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall -Werror" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 18 11:31:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 11:31:00 +0000 Subject: [PATCH] libosmocore[master]: configure.ac: Enable -Wall by default In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2958 to look at the new patch set (#3). configure.ac: Enable -Wall by default Change-Id: I70f917e05ad46049487710d1752aad2505c96696 --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/2958/3 diff --git a/configure.ac b/configure.ac index 340a896..29b7b52 100644 --- a/configure.ac +++ b/configure.ac @@ -235,8 +235,8 @@ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" fi -CFLAGS+=" -DBUILDING_LIBOSMOCORE" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE" +CFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 18 11:31:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 11:31:01 +0000 Subject: [PATCH] libosmocore[master]: fsm.c: Fix compilation warning: Use PRIu32 for uint32_t Message-ID: Review at https://gerrit.osmocom.org/2960 fsm.c: Fix compilation warning: Use PRIu32 for uint32_t Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423 --- M src/fsm.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/2960/1 diff --git a/src/fsm.c b/src/fsm.c index fbe22d7..16f5d65 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -284,7 +285,7 @@ { static char buf[32]; if (!fsm->event_names) { - snprintf(buf, sizeof(buf), "%u", event); + snprintf(buf, sizeof(buf), "%"PRIu32, event); return buf; } else return get_value_string(fsm->event_names, event); @@ -314,7 +315,7 @@ { static char buf[32]; if (state >= fsm->num_states) { - snprintf(buf, sizeof(buf), "unknown %u", state); + snprintf(buf, sizeof(buf), "unknown %"PRIu32, state); return buf; } else return fsm->states[state].name; @@ -408,7 +409,7 @@ if (!fi) { LOGPSRC(DLGLOBAL, LOGL_ERROR, file, line, - "Trying to dispatch event %u to non-existent" + "Trying to dispatch event %"PRIu32" to non-existent" " FSM instance!\n", event); osmo_log_backtrace(DLGLOBAL, LOGL_ERROR); return -ENODEV; -- To view, visit https://gerrit.osmocom.org/2960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 11:31:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 11:31:01 +0000 Subject: [PATCH] libosmocore[master]: pseudotalloc: Add poor implementation of talloc_asprintf Message-ID: Review at https://gerrit.osmocom.org/2961 pseudotalloc: Add poor implementation of talloc_asprintf fsm.c uses this function. When compiled with --enable-embedded, it triggers a warning: fsm.c: In function 'osmo_fsm_inst_alloc': fsm.c:213:4: warning: implicit declaration of function 'talloc_asprintf' [-Wimplicit-function-declaration] fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id); Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 --- M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h 2 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/2961/1 diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index fe7f1ed..5c9c498 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -5,6 +5,7 @@ #include "talloc.h" #include +#include void *_talloc_zero(const void *ctx, size_t size, const char *name) { @@ -61,3 +62,21 @@ { return talloc_zero_size(ctx, el_size * count); } + +char *talloc_asprintf(const void *ctx, const char *fmt, ...) { + char *buf; + size_t len = 512; + va_list args; + va_start(args, fmt); + + while (1) { + buf = talloc_size(ctx, len); + if (len < vsprintf(buf, fmt, args)) + break; + talloc_free(buf); + len *= 2; + } + + va_end(args); + return buf; +} diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index c7127de..f4c0a74 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -39,4 +39,4 @@ size_t el_size, unsigned count, const char *name); - +char *talloc_asprintf(const void *ctx, const char *fmt, ...); -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 11:36:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 11:36:15 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 needs very careful testing in terms of #2329 -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Sun Jun 18 11:36:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 11:36:27 +0000 Subject: osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 needs very careful testing in terms of #2329 -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Jun 18 11:36:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 18 Jun 2017 11:36:35 +0000 Subject: osmo-bts[master]: osmo-bts-octphy: normalize frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 needs very careful testing in terms of #2329 -- To view, visit https://gerrit.osmocom.org/2867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d369ff9e6da34f4bd98afd3c5d030cac73e54c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 18 12:17:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 12:17:20 +0000 Subject: [PATCH] libosmocore[master]: Fix compilation warnings: use correct log type for uint32_t Message-ID: Review at https://gerrit.osmocom.org/2962 Fix compilation warnings: use correct log type for uint32_t Change-Id: Ic1e3255800999669ca9619bfceb4124c773eff2d --- M src/gsm/gsm48.c M src/utils.c 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/2962/1 diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 405c904..996c70e 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -636,7 +637,7 @@ /* Table 10.5.4.3, reverse generate_mid_from_tmsi */ if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) { tmsi = osmo_load32be(&mi[1]); - return snprintf(string, str_len, "%u", tmsi); + return snprintf(string, str_len, "%"PRIu32, tmsi); } break; case GSM_MI_TYPE_IMSI: diff --git a/src/utils.c b/src/utils.c index e7c6bcf..6392918 100644 --- a/src/utils.c +++ b/src/utils.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -55,7 +56,7 @@ if (str) return str; - snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); + snprintf(namebuf, sizeof(namebuf), "unknown 0x%"PRIx32, val); namebuf[sizeof(namebuf) - 1] = '\0'; return namebuf; } -- To view, visit https://gerrit.osmocom.org/2962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1e3255800999669ca9619bfceb4124c773eff2d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 12:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 12:17:21 +0000 Subject: [PATCH] libosmocore[master]: Fix warnings: tolower() and similar require uchar Message-ID: Review at https://gerrit.osmocom.org/2963 Fix warnings: tolower() and similar require uchar utils.c: In function 'osmo_str2lower': utils.c:277:3: warning: array subscript has type 'char' [-Wchar-subscripts] out[i] = tolower(in[i]); And according to man: If c is neither an unsigned char value nor EOF, the behavior of these func? tions is undefined. Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f --- M src/gsm/gsm_utils.c M src/logging.c M src/utils.c 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/2963/1 diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 9cb5df6..ab7defa 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -595,7 +595,7 @@ /*! \brief Parse string name of a GSM band */ enum gsm_band gsm_band_parse(const char* mhz) { - while (*mhz && !isdigit(*mhz)) + while (*mhz && !isdigit((unsigned char)*mhz)) mhz++; if (*mhz == '\0') diff --git a/src/logging.c b/src/logging.c index 3b3dd05..b01d747 100644 --- a/src/logging.c +++ b/src/logging.c @@ -847,7 +847,7 @@ char name[name_len]; for (j = 0; j < name_len; j++) - name[j] = tolower(info->cat[i].name[j]); + name[j] = tolower((unsigned char) info->cat[i].name[j]); name[name_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", name+1); @@ -869,7 +869,7 @@ char loglevel_str[loglevel_str_len]; for (j = 0; j < loglevel_str_len; j++) - loglevel_str[j] = tolower(loglevel_strs[i].str[j]); + loglevel_str[j] = tolower((unsigned char) loglevel_strs[i].str[j]); loglevel_str[loglevel_str_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", loglevel_str); diff --git a/src/utils.c b/src/utils.c index 6392918..bc879b4 100644 --- a/src/utils.c +++ b/src/utils.c @@ -275,7 +275,7 @@ unsigned int i; for (i = 0; i < strlen(in); i++) - out[i] = tolower(in[i]); + out[i] = tolower((const unsigned char) in[i]); out[strlen(in)] = '\0'; } @@ -288,7 +288,7 @@ unsigned int i; for (i = 0; i < strlen(in); i++) - out[i] = toupper(in[i]); + out[i] = toupper((const unsigned char) in[i]); out[strlen(in)] = '\0'; } #endif /* HAVE_CTYPE_H */ -- To view, visit https://gerrit.osmocom.org/2963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 12:17:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 12:17:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0411_utils.c: Fix compilation warnings Message-ID: Review at https://gerrit.osmocom.org/2964 gsm0411_utils.c: Fix compilation warnings gsm0411_utils.c:102:2: warning: #warning find a portable way to obtain timezone offset [-Wcpp] #warning find a portable way to obtain timezone offset gsm0411_utils.c: In function 'gsm338_get_sms_alphabet': gsm0411_utils.c:260:4: warning: large integer implicitly truncated to unsigned type [-Woverflow] return 0xffffffff; Change-Id: I1d6cb31f38721f79e2cf93f9b8e4776f3720aa07 --- M src/gsm/gsm0411_utils.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/64/2964/1 diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index 543775c..089df17 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -99,7 +99,7 @@ #ifdef HAVE_TM_GMTOFF_IN_TM *scts++ = gsm411_bcdify(tm->tm_gmtoff/(60*15)); #else -#warning find a portable way to obtain timezone offset +#pragma message ("find a portable way to obtain timezone offset") *scts++ = 0; #endif } @@ -257,7 +257,7 @@ if (cgbits & 2) { LOGP(DLSMS, LOGL_NOTICE, "Compressed SMS not supported yet\n"); - return 0xffffffff; + return -1; } switch ((dcs >> 2)&0x03) { -- To view, visit https://gerrit.osmocom.org/2964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d6cb31f38721f79e2cf93f9b8e4776f3720aa07 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Jun 18 16:49:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 16:49:54 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Revert "osmo-bts-trx: wait some longer before starting osmo-... Message-ID: Review at https://gerrit.osmocom.org/2965 Revert "osmo-bts-trx: wait some longer before starting osmo-bts-trx" With this patch, the same errors are still happening. This is not a solution, so drop this again. This reverts commit 6c8d9497f246dc6513b7d15fbbfa5d8cf59dd8dc. Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/65/2965/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index c8fa594..7d12c85 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -64,9 +64,6 @@ self.log('Waiting for osmo-trx to start up...') event_loop.wait(self, self.trx_ready) self.proc_trx.log(self.proc_trx.get_stdout_tail(1)) - self.log('Give some grace time (hopefully to avoid clock skews)') - event_loop.sleep(self, 5) - self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1', '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) -- To view, visit https://gerrit.osmocom.org/2965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 16:49:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 16:49:52 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx: wait some longer before starting osmo-... In-Reply-To: References: Message-ID: Neels Hofmeyr has reverted this change. Change subject: Revert "osmo-bts-trx: wait some longer before starting osmo-bts-trx" ...................................................................... Uploaded patch set 1. -- To view, visit https://gerrit.osmocom.org/2965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: revert Gerrit-Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 16:50:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 16:50:10 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx: wait some longer before starting osmo-... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Sun Jun 18 16:50:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 16:50:13 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Revert "osmo-bts-trx: wait some longer before starting osmo-... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Revert "osmo-bts-trx: wait some longer before starting osmo-bts-trx" ...................................................................... Revert "osmo-bts-trx: wait some longer before starting osmo-bts-trx" With this patch, the same errors are still happening. This is not a solution, so drop this again. This reverts commit 6c8d9497f246dc6513b7d15fbbfa5d8cf59dd8dc. Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 46daf71..585647a 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -64,9 +64,6 @@ self.log('Waiting for osmo-trx to start up...') event_loop.wait(self, self.trx_ready) self.proc_trx.log(self.proc_trx.get_stdout_tail(1)) - self.log('Give some grace time (hopefully to avoid clock skews)') - event_loop.sleep(self, 5) - self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1', '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) -- To view, visit https://gerrit.osmocom.org/2965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 18 18:57:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 18:57:21 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx: wait some longer before starting osmo-... In-Reply-To: References: Message-ID: Patch Set 2: Please next time better create a branch + a new jenkins job to use that branch to test this kind of stuff rather than pushing something for a few hours then reverting, in order to have a cleaner history. -- To view, visit https://gerrit.osmocom.org/2965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 Gerrit-PatchSet: 2 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 18:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 18:59:38 +0000 Subject: [MERGED] libosmocore[master]: gprs_ns_test.c: Remove unused byte arrays In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: gprs_ns_test.c: Remove unused byte arrays ...................................................................... gprs_ns_test.c: Remove unused byte arrays Commit 0d4e949e229a649ffd0503d8e930dba8be7dd34d changed the code to use functions with local variables holding the bytes, but forgot to remove the old global variables. This test fixes compilation warnings. Change-Id: I140de30038222b0419423d8c4f9da1946651a4e7 --- M tests/gb/gprs_ns_test.c 1 file changed, 0 insertions(+), 49 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c index 4c6fd39..456d8e3 100644 --- a/tests/gb/gprs_ns_test.c +++ b/tests/gb/gprs_ns_test.c @@ -178,61 +178,12 @@ send_bssgp_reset(nsi, src_addr, bvci); } -/* GPRS Network Service, PDU type: NS_RESET, - * Cause: O&M intervention, NS VCI: 0x1122, NSEI 0x1122 - */ -static const unsigned char gprs_ns_reset[12] = { - 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x11, 0x22, - 0x04, 0x82, 0x11, 0x22 -}; - -/* GPRS Network Service, PDU type: NS_RESET, - * Cause: O&M intervention, NS VCI: 0x3344, NSEI 0x1122 - */ -static const unsigned char gprs_ns_reset_vci2[12] = { - 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x33, 0x44, - 0x04, 0x82, 0x11, 0x22 -}; - -/* GPRS Network Service, PDU type: NS_RESET, - * Cause: O&M intervention, NS VCI: 0x1122, NSEI 0x3344 - */ -static const unsigned char gprs_ns_reset_nsei2[12] = { - 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x11, 0x22, - 0x04, 0x82, 0x33, 0x44 -}; - -/* GPRS Network Service, PDU type: NS_ALIVE */ -static const unsigned char gprs_ns_alive[1] = { - 0x0a -}; - /* GPRS Network Service, PDU type: NS_STATUS, * Cause: PDU not compatible with the protocol state * PDU: NS_ALIVE */ static const unsigned char gprs_ns_status_invalid_alive[7] = { 0x08, 0x00, 0x81, 0x0a, 0x02, 0x81, 0x0a -}; - -/* GPRS Network Service, PDU type: NS_ALIVE_ACK */ -static const unsigned char gprs_ns_alive_ack[1] = { - 0x0b -}; - -/* GPRS Network Service, PDU type: NS_UNBLOCK */ -static const unsigned char gprs_ns_unblock[1] = { - 0x06 -}; - - -/* GPRS Network Service, PDU type: NS_STATUS, - * Cause: PDU not compatible with the protocol state - * PDU: NS_RESET_ACK, NS VCI: 0x1122, NSEI 0x1122 - */ -static const unsigned char gprs_ns_status_invalid_reset_ack[15] = { - 0x08, 0x00, 0x81, 0x0a, 0x02, 0x89, 0x03, 0x01, - 0x82, 0x11, 0x22, 0x04, 0x82, 0x11, 0x22 }; /* GPRS Network Service, PDU type: NS_UNITDATA, BVCI 0 */ -- To view, visit https://gerrit.osmocom.org/2951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I140de30038222b0419423d8c4f9da1946651a4e7 Gerrit-PatchSet: 1 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 Sun Jun 18 18:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 18:59:38 +0000 Subject: [MERGED] libosmocore[master]: sms_test.c: Remove test of deprecated wrapper function In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: sms_test.c: Remove test of deprecated wrapper function ...................................................................... sms_test.c: Remove test of deprecated wrapper function The deprecated function is just a wrapper, and it triggers a compilation warning. Change-Id: Iaac701bdf0c0e66c343f68cc31d82550a024ef57 --- M tests/sms/sms_test.c M tests/sms/sms_test.ok 2 files changed, 0 insertions(+), 27 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 776c45a..efbdf7e 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -288,16 +288,6 @@ /* test 7-bit encoding */ for (i = 0; i < ARRAY_SIZE(test_encode); ++i) { - /* Test legacy function (return value only) */ - septet_length = gsm_7bit_encode(coded, - (const char *) test_encode[i].input); - printf("Legacy encode case %d: " - "septet length %d (expected %d)\n" - , i - , septet_length, test_encode[i].expected_septet_length - ); - OSMO_ASSERT (septet_length == test_encode[i].expected_septet_length); - /* Test new function */ memset(coded, 0x42, sizeof(coded)); septet_length = gsm_7bit_encode_n(coded, sizeof(coded), @@ -377,15 +367,6 @@ /* test 7-bit decoding */ for (i = 0; i < ARRAY_SIZE(test_decode); ++i) { - /* Test legacy function (return value only) */ - if (!test_decode[i].ud_hdr_ind) { - nchars = gsm_7bit_decode(result, test_decode[i].input, - test_decode[i].expected_septet_length); - printf("Legacy decode case %d: " - "return value %d (expected %d)\n", - i, nchars, test_decode[i].expected_septet_length); - } - /* Test new function */ memset(result, 0x42, sizeof(result)); nchars = gsm_7bit_decode_n_hdr(result, sizeof(result), test_decode[i].input, diff --git a/tests/sms/sms_test.ok b/tests/sms/sms_test.ok index fa536ea..a71567d 100644 --- a/tests/sms/sms_test.ok +++ b/tests/sms/sms_test.ok @@ -1,19 +1,11 @@ SMS testing -Legacy encode case 0: septet length 9 (expected 9) Encode case 0: Octet length 8 (expected 8, computed 8), septet length 9 (expected 9) -Legacy encode case 1: septet length 41 (expected 41) Encode case 1: Octet length 36 (expected 36, computed 36), septet length 41 (expected 41) -Legacy encode case 2: septet length 39 (expected 39) Encode case 2: Octet length 35 (expected 35, computed 35), septet length 39 (expected 39) -Legacy encode case 3: septet length 40 (expected 40) Encode case 3: Octet length 35 (expected 35, computed 35), septet length 40 (expected 40) -Legacy decode case 0: return value 9 (expected 9) Decode case 0: return value 9 (expected 9) -Legacy decode case 1: return value 41 (expected 41) Decode case 1: return value 40 (expected 40) -Legacy decode case 2: return value 39 (expected 39) Decode case 2: return value 31 (expected 31) -Legacy decode case 3: return value 40 (expected 40) Decode case 3: return value 32 (expected 32) Decode case 4: return value 153 (expected 153) Decode case 5: return value 40 (expected 40) -- To view, visit https://gerrit.osmocom.org/2950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaac701bdf0c0e66c343f68cc31d82550a024ef57 Gerrit-PatchSet: 1 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 Sun Jun 18 18:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 18:59:39 +0000 Subject: [MERGED] libosmocore[master]: Fix compilation warning on deprecated macro In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Fix compilation warning on deprecated macro ...................................................................... Fix compilation warning on deprecated macro A warning was printed even if the deprecation didn't apply to libosmocore because it is still allowed to use it internally. This patch fixes this case while still printing a warning if external projects build using libosmocore headers. Change-Id: I32212f20756f828af1017482a71e29e4b3adbad4 --- M configure.ac M include/osmocom/core/defs.h M include/osmocom/core/logging.h 3 files changed, 11 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 04d126e..340a896 100644 --- a/configure.ac +++ b/configure.ac @@ -235,6 +235,9 @@ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" fi +CFLAGS+=" -DBUILDING_LIBOSMOCORE" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE" + AC_ARG_ENABLE(simd, [AS_HELP_STRING( [--disable-simd], diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index aebe925..51ac4e5 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -41,6 +41,12 @@ # define OSMO_DEPRECATED(text) #endif +#if BUILDING_LIBOSMOCORE +# define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE +#else +# define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE OSMO_DEPRECATED("For internal use inside libosmocore only.") +#endif + #undef _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE #undef _OSMO_HAS_ATTRIBUTE_DEPRECATED diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 77343e9..7af0ad2 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -332,8 +332,8 @@ void log_del_target(struct log_target *target); /* Generate command string for VTY use */ -const char *log_vty_command_string() OSMO_DEPRECATED("For internal use inside libosmocore only."); -const char *log_vty_command_description() OSMO_DEPRECATED("For internal use inside libosmocore only."); +const char *log_vty_command_string() OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; +const char *log_vty_command_description() OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; struct log_target *log_target_find(int type, const char *fname); extern struct llist_head osmo_log_target_list; -- To view, visit https://gerrit.osmocom.org/2948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32212f20756f828af1017482a71e29e4b3adbad4 Gerrit-PatchSet: 1 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 Sun Jun 18 18:59:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 18:59:40 +0000 Subject: [MERGED] libosmocore[master]: card_fs_uicc.c: Fix unused compilation warning In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: card_fs_uicc.c: Fix unused compilation warning ...................................................................... card_fs_uicc.c: Fix unused compilation warning This array of bytes is not yet used but is referring to some specs. They may be used in the future, so leave it there but mark it explicitly as unused. Change-Id: I0a61d17f9989ecddafbc68d4b9446853e4c15159 --- M src/sim/card_fs_uicc.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sim/card_fs_uicc.c b/src/sim/card_fs_uicc.c index 70737b6..27afe34 100644 --- a/src/sim/card_fs_uicc.c +++ b/src/sim/card_fs_uicc.c @@ -205,4 +205,4 @@ }; /* Annex E - TS 101 220 */ -static const uint8_t adf_uicc_aid[] = { 0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x01 }; +static const uint8_t __attribute__((__unused__)) adf_uicc_aid[] = { 0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x01 }; -- To view, visit https://gerrit.osmocom.org/2949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a61d17f9989ecddafbc68d4b9446853e4c15159 Gerrit-PatchSet: 1 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 Sun Jun 18 19:00:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 18 Jun 2017 19:00:47 +0000 Subject: [MERGED] libosmocore[master]: tlv_test.c: Fix compilation warnings In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: tlv_test.c: Fix compilation warnings ...................................................................... tlv_test.c: Fix compilation warnings Several warnings like the one below are fixed: warning: array subscript is below array bounds [-Warray-bounds] uint8_t *unchanged_ptr = buf - 1; Change-Id: I35d7d926939c14700cbca732bd64e588c75424b4 --- M tests/tlv/tlv_test.c 1 file changed, 25 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/tlv/tlv_test.c b/tests/tlv/tlv_test.c index c571c3b..87b002f 100644 --- a/tests/tlv/tlv_test.c +++ b/tests/tlv/tlv_test.c @@ -70,23 +70,24 @@ static void check_tlv_match_data_len(size_t data_len, uint8_t tag, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t unchanged_len = 0xdead; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; size_t value_len = unchanged_len; - uint8_t *data = buf; + uint8_t *data = buf + 1; - OSMO_ASSERT(data_len <= sizeof(buf)); + OSMO_ASSERT(data_len <= sizeof(buf) - 1); tlv_put(data, tag, len, test_data); if (data_len < len + 2) { OSMO_ASSERT(-1 == osmo_match_shift_tlv(&data, &tmp_data_len, tag, &value, &value_len)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); OSMO_ASSERT(value_len == unchanged_len); } else { @@ -101,14 +102,15 @@ uint8_t tag, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; - uint8_t *data = buf; + uint8_t *data = buf + 1; - OSMO_ASSERT(data_len <= sizeof(buf)); + OSMO_ASSERT(data_len <= sizeof(buf) - 1); tv_fixed_put(data, tag, len, test_data); @@ -116,7 +118,7 @@ OSMO_ASSERT(-1 == osmo_match_shift_tv_fixed(&data, &tmp_data_len, tag, len, &value)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); } else { OSMO_ASSERT(0 <= osmo_match_shift_tv_fixed(&data, &tmp_data_len, @@ -128,14 +130,15 @@ static void check_v_fixed_shift_data_len(size_t data_len, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; - uint8_t *data = buf; + uint8_t *data = buf + 1; - OSMO_ASSERT(data_len <= sizeof(buf)); + OSMO_ASSERT(data_len <= sizeof(buf) - 1); memcpy(data, test_data, len); @@ -143,7 +146,7 @@ OSMO_ASSERT(-1 == osmo_shift_v_fixed(&data, &tmp_data_len, len, &value)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); } else { OSMO_ASSERT(0 <= osmo_shift_v_fixed(&data, &tmp_data_len, @@ -155,21 +158,24 @@ static void check_lv_shift_data_len(size_t data_len, size_t len, const uint8_t *test_data) { - uint8_t buf[300] = {0}; + uint8_t buf[301] = {0}; + *buf = 0xfe; - uint8_t *unchanged_ptr = buf - 1; + uint8_t *unchanged_ptr = buf; size_t unchanged_len = 0xdead; size_t tmp_data_len = data_len; uint8_t *value = unchanged_ptr; size_t value_len = unchanged_len; - uint8_t *data = buf; + uint8_t *data = buf + 1; + + OSMO_ASSERT(data_len <= sizeof(buf) - 1); lv_put(data, len, test_data); if (data_len < len + 1) { OSMO_ASSERT(-1 == osmo_shift_lv(&data, &tmp_data_len, &value, &value_len)); OSMO_ASSERT(tmp_data_len == 0); - OSMO_ASSERT(data == buf + data_len); + OSMO_ASSERT(data == buf + 1 + data_len); OSMO_ASSERT(value == unchanged_ptr); OSMO_ASSERT(value_len == unchanged_len); } else { -- To view, visit https://gerrit.osmocom.org/2952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35d7d926939c14700cbca732bd64e588c75424b4 Gerrit-PatchSet: 1 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 admin at opensuse.org Sun Jun 18 19:54:57 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 18 Jun 2017 19:54:57 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5946da9456419_58081138f84119802a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 216s] | [ 216s] | on build30 [ 216s] | [ 216s] | config.status:1170: creating Doxyfile.core [ 216s] [ 216s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 216s] make[1]: *** [override_dh_auto_test] Error 1 [ 216s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 216s] debian/rules:15: recipe for target 'build' failed [ 216s] make: *** [build] Error 2 [ 216s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 216s] [ 216s] build30 failed "build libosmocore_0.9.6.20170618.dsc" at Sun Jun 18 19:54:48 UTC 2017. [ 216s] [ 216s] ### VM INTERACTION START ### [ 216s] [ 196.268044] serial8250: too much work for irq4 [ 216s] [ 196.336104] serial8250: too much work for irq4 [ 216s] [ 196.404135] serial8250: too much work for irq4 [ 216s] [ 196.472112] serial8250: too much work for irq4 [ 216s] [ 196.540117] serial8250: too much work for irq4 [ 216s] [ 196.608130] serial8250: too much work for irq4 [ 216s] [ 196.672125] serial8250: too much work for irq4 [ 216s] [ 196.740149] serial8250: too much work for irq4 [ 216s] [ 196.808114] serial8250: too much work for irq4 [ 216s] [ 196.876103] serial8250: too much work for irq4 [ 221s] ### VM INTERACTION END ### [ 221s] [ 221s] build30 failed "build libosmocore_0.9.6.20170618.dsc" at Sun Jun 18 19:54:54 UTC 2017. [ 221s] -- 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 Jun 18 20:50:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 20:50:50 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx: wait some longer before starting osmo-... In-Reply-To: References: Message-ID: Patch Set 2: I am all for avoiding complex merges in the history, but don't agree here. a) I would have had to reconfigure the run job to see a history of multiple runs. b) We hardly ever revert anything, we can manage a revert every now and then. c) it doesn't hurt to see in the history that a given patch (that was well formed) turned out to not help. -- To view, visit https://gerrit.osmocom.org/2965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I324e965fdf40a369e1bcebfa4b32d0a3a7b86eb3 Gerrit-PatchSet: 2 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 21:02:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 18 Jun 2017 21:02:51 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 5: > > osmo-gsm-tester scripts don't use osmo-ci > > So why you've comment in another patch that "each is still callable > on its own" in the context of osmo-gsm-tester and jenkins_* helpers > in osmo-bts? Those are using osmo-ci. I don't get your question? I hope the reasons why I comment are clear. I can only try to read a real question in this comment. osmo-ci.git is about our "internal" jenkins.osmocom.org setup. You mentioned the osmo-gsm-tester in above comment, after I asked you which users you intend to benefit from this patch; hence I decided to point out that the tester is so far kept separate from osmocom's "internal" jenkins setup on purpose, doesn't use osmo-ci and probably won't ever (it is intended to run on anyone's jenkins, not only ours; installation is easier when those scripts don't need osmo-ci; if we change our jenkins setup, other peoples' jenkins should remain independent, so that we don't need to worry about them in osmo-ci). And true, I want the osmo-ci bts build scripts to still be callable on their own, not necessarily needing the bts_model.sh script, which is an unrelated fact to anything else, and frankly not too much to ask. Anything still unclear? -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 21:33:47 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 18 Jun 2017 21:33:47 +0000 Subject: libosmocore[master]: sercomm_test.c: return correctly in main In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 21:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 18 Jun 2017 21:34:47 +0000 Subject: libosmocore[master]: osmo-sim-test.c: Remove unused functions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 21:36:15 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 18 Jun 2017 21:36:15 +0000 Subject: libosmocore[master]: Fix compilation warnings: use correct log type for uint32_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1e3255800999669ca9619bfceb4124c773eff2d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 21:37:40 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 18 Jun 2017 21:37:40 +0000 Subject: libosmocore[master]: gsm0411_utils.c: Fix compilation warnings In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d6cb31f38721f79e2cf93f9b8e4776f3720aa07 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 18 21:40:54 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 18 Jun 2017 21:40:54 +0000 Subject: libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 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: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 08:34:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 08:34:23 +0000 Subject: [MERGED] osmo-bts[master]: lc15bts-mgr: use extended config file example In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: lc15bts-mgr: use extended config file example ...................................................................... lc15bts-mgr: use extended config file example Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92 Related: SYS#3686 --- M doc/examples/litecell15/lc15bts-mgr.cfg 1 file changed, 41 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/litecell15/lc15bts-mgr.cfg b/doc/examples/litecell15/lc15bts-mgr.cfg index 27ed326..e7c9926 100644 --- a/doc/examples/litecell15/lc15bts-mgr.cfg +++ b/doc/examples/litecell15/lc15bts-mgr.cfg @@ -1,15 +1,17 @@ ! -! SysmoMgr (0.3.0.141-33e5) configuration saved from vty +! lc15bts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty !! ! log stderr logging filter all 1 logging color 1 + logging print category 0 logging timestamp 0 logging level all everything logging level temp info logging level fw info logging level find info + logging level calib info logging level lglobal notice logging level llapd notice logging level linp notice @@ -17,8 +19,46 @@ logging level lmi notice logging level lmib notice logging level lsms notice + logging level lctrl notice + logging level lgtp notice ! line vty no login ! lc15bts-mgr + limits supply + threshold warning 60 + threshold critical 78 + limits soc + threshold warning 60 + threshold critical 78 + limits fpga + threshold warning 60 + threshold critical 78 + limits logrf + threshold warning 60 + threshold critical 78 + limits tx0 + threshold warning 60 + threshold critical 78 + limits tx1 + threshold warning 60 + threshold critical 78 + limits pa0 + threshold warning 60 + threshold critical 78 + limits pa1 + threshold warning 60 + threshold critical 78 + actions normal + pa0-on + pa1-on + bts-service-on + actions warn + no pa0-off + no pa1-off + no bts-service-off + actions critical + pa0-off + pa1-off + no bts-service-off -- To view, visit https://gerrit.osmocom.org/2929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92 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 Mon Jun 19 08:34:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 08:34:43 +0000 Subject: [MERGED] osmo-bts[master]: Move parameter file opening into separate function In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move parameter file opening into separate function ...................................................................... Move parameter file opening into separate function * use talloc for file path allocation * print detailed error on failures This simplifies troubleshooting of lc15bts-mgr failures. Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c Related: SYS#3686 --- M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_util.c 5 files changed, 52 insertions(+), 61 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index 903c5fe..549c179 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -116,7 +116,7 @@ } /* fetch the serial number */ - lc15bts_par_get_int(LC15BTS_PAR_SERNR, &serno); + lc15bts_par_get_int(tall_mgr_ctx, LC15BTS_PAR_SERNR, &serno); snprintf(ser_str, sizeof(ser_str), "%d", serno); /* fetch the model and trx number */ diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index 5ff8e31..fa59b7c 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -114,12 +114,13 @@ for (i = 0; i < ARRAY_SIZE(temp_data); i++) { int ret; - rc = lc15bts_par_get_int(temp_data[i].ee_par, &ret); + rc = lc15bts_par_get_int(tall_mgr_ctx, temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); if (temp_cur[i] < 0 && temp_cur[i] > -1000) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d)\n", temp_data[i].sensor); + LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d): unexpected value %d\n", + temp_data[i].sensor, temp_cur[i]); continue; } @@ -132,8 +133,7 @@ temp_cur[i]/1000, temp_old[i]%1000); if (!no_rom_write) { - rc = lc15bts_par_set_int(temp_data[i].ee_par, - temp_cur[i]/1000); + rc = lc15bts_par_set_int(tall_mgr_ctx, temp_data[i].ee_par, temp_cur[i]/1000); if (rc < 0) LOGP(DTEMP, LOGL_ERROR, "error writing new %s " "max temp %d (%s)\n", temp_data[i].name, @@ -157,7 +157,7 @@ if (last_update == 0) { last_update = now; - rc = lc15bts_par_get_int(LC15BTS_PAR_HOURS, &op_hrs); + rc = lc15bts_par_get_int(tall_mgr_ctx, LC15BTS_PAR_HOURS, &op_hrs); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Unable to read " "operational hours: %d (%s)\n", rc, @@ -172,7 +172,7 @@ } if (now >= last_update + 3600) { - rc = lc15bts_par_get_int(LC15BTS_PAR_HOURS, &op_hrs); + rc = lc15bts_par_get_int(tall_mgr_ctx, LC15BTS_PAR_HOURS, &op_hrs); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Unable to read " "operational hours: %d (%s)\n", rc, @@ -187,7 +187,7 @@ op_hrs); if (!no_rom_write) { - rc = lc15bts_par_set_int(LC15BTS_PAR_HOURS, op_hrs); + rc = lc15bts_par_set_int(tall_mgr_ctx, LC15BTS_PAR_HOURS, op_hrs); if (rc < 0) return rc; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 3d80e67..ab3e96b 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -35,12 +35,9 @@ #include #include +#include #include "lc15bts_par.h" - - -#define FACTORY_ROM_PATH "/mnt/rom/factory" -#define USER_ROM_PATH "/mnt/rom/user" const struct value_string lc15bts_par_names[_NUM_LC15BTS_PAR+1] = { { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, @@ -80,19 +77,32 @@ } } -int lc15bts_par_get_int(enum lc15bts_par par, int *ret) +FILE *lc15bts_par_get_path(void *ctx, enum lc15bts_par par, const char* mode) { - char fpath[PATH_MAX]; + char *fpath; FILE *fp; - int rc; if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; + return NULL; - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; + fpath = talloc_asprintf(ctx, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); + if (!fpath) + return NULL; - fp = fopen(fpath, "r"); + fp = fopen(fpath, mode); + if (!fp) + fprintf(stderr, "Failed to open %s due to '%s' error\n", fpath, strerror(errno)); + + talloc_free(fpath); + + return fp; +} + +int lc15bts_par_get_int(void *ctx, enum lc15bts_par par, int *ret) +{ + FILE *fp = lc15bts_par_get_path(ctx, par, "r"); + int rc; + if (fp == NULL) { return -errno; } @@ -106,19 +116,11 @@ return 0; } -int lc15bts_par_set_int(enum lc15bts_par par, int val) +int lc15bts_par_set_int(void *ctx, enum lc15bts_par par, int val) { - char fpath[PATH_MAX]; - FILE *fp; + FILE *fp = lc15bts_par_get_path(ctx, par, "w"); int rc; - if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; - - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; - - fp = fopen(fpath, "w"); if (fp == NULL) { return -errno; } @@ -132,20 +134,11 @@ return 0; } -int lc15bts_par_get_buf(enum lc15bts_par par, uint8_t *buf, - unsigned int size) +int lc15bts_par_get_buf(void *ctx, enum lc15bts_par par, uint8_t *buf, unsigned int size) { - char fpath[PATH_MAX]; - FILE *fp; + FILE *fp = lc15bts_par_get_path(ctx, par, "rb"); int rc; - if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; - - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; - - fp = fopen(fpath, "rb"); if (fp == NULL) { return -errno; } @@ -157,20 +150,11 @@ return rc; } -int lc15bts_par_set_buf(enum lc15bts_par par, const uint8_t *buf, - unsigned int size) +int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size) { - char fpath[PATH_MAX]; - FILE *fp; + FILE *fp = lc15bts_par_get_path(ctx, par, "wb"); int rc; - if (par >= _NUM_LC15BTS_PAR) - return -ENODEV; - - snprintf(fpath, sizeof(fpath)-1, "%s/%s", USER_ROM_PATH, get_value_string(lc15bts_par_names, par)); - fpath[sizeof(fpath)-1] = '\0'; - - fp = fopen(fpath, "wb"); if (fp == NULL) { return -errno; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index c50a69f..b9fe740 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -3,6 +3,9 @@ #include +#define FACTORY_ROM_PATH "/mnt/rom/factory" +#define USER_ROM_PATH "/mnt/rom/user" + enum lc15bts_par { LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, @@ -22,12 +25,10 @@ extern const struct value_string lc15bts_par_names[_NUM_LC15BTS_PAR+1]; -int lc15bts_par_get_int(enum lc15bts_par par, int *ret); -int lc15bts_par_set_int(enum lc15bts_par par, int val); -int lc15bts_par_get_buf(enum lc15bts_par par, uint8_t *buf, - unsigned int size); -int lc15bts_par_set_buf(enum lc15bts_par par, const uint8_t *buf, - unsigned int size); +int lc15bts_par_get_int(void *ctx, enum lc15bts_par par, int *ret); +int lc15bts_par_set_int(void *ctx, enum lc15bts_par par, int val); +int lc15bts_par_get_buf(void *ctx, enum lc15bts_par par, uint8_t *buf, unsigned int size); +int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, unsigned int size); int lc15bts_par_is_int(enum lc15bts_par par); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_util.c b/src/osmo-bts-litecell15/misc/lc15bts_util.c index 33f9e4e..430ce0f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_util.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_util.c @@ -28,9 +28,12 @@ #include #include #include - +#include +#include #include "lc15bts_par.h" + +void *tall_util_ctx; enum act { ACT_GET, @@ -101,6 +104,9 @@ enum lc15bts_par par; int rc, val; + tall_util_ctx = talloc_named_const(NULL, 1, "lc15 utils"); + msgb_talloc_ctx_init(tall_util_ctx, 0); + rc = parse_options(argc, argv); if (rc < 0) exit(2); @@ -120,7 +126,7 @@ switch (action) { case ACT_GET: - rc = lc15bts_par_get_int(par, &val); + rc = lc15bts_par_get_int(tall_util_ctx, par, &val); if (rc < 0) { fprintf(stderr, "Error %d\n", rc); goto err; @@ -128,7 +134,7 @@ printf("%d\n", val); break; case ACT_SET: - rc = lc15bts_par_get_int(par, &val); + rc = lc15bts_par_get_int(tall_util_ctx, par, &val); if (rc < 0) { fprintf(stderr, "Error %d\n", rc); goto err; @@ -137,7 +143,7 @@ fprintf(stderr, "Parameter is already set!\r\n"); goto err; } - rc = lc15bts_par_set_int(par, atoi(write_arg)); + rc = lc15bts_par_set_int(tall_util_ctx, par, atoi(write_arg)); if (rc < 0) { fprintf(stderr, "Error %d\n", rc); goto err; -- To view, visit https://gerrit.osmocom.org/2928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c 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 Mon Jun 19 08:36:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 08:36:09 +0000 Subject: osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Patch Set 5: Verified+1 -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 08:36:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 08:36:13 +0000 Subject: [MERGED] osmo-ci[master]: Add script for fetching BTS-specific L1 headers In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add script for fetching BTS-specific L1 headers ...................................................................... Add script for fetching BTS-specific L1 headers Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682 --- A scripts/osmo-layer1-headers.sh 1 file changed, 47 insertions(+), 0 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh new file mode 100755 index 0000000..b2372d4 --- /dev/null +++ b/scripts/osmo-layer1-headers.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# -e: fail if any of the subsequent commands fail +# -x: trace each executed command via debug log +set -e -x + +# Usage: +# ./osmo-layer1-headers.sh sysmo superfemto_v5.1 +# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset) +# 2nd parameter is optional and defaults to latest master branch + +case "$1" in + sysmo) + uri="git://git.sysmocom.de/sysmo-bts/layer1-api" + version="origin/master" + ;; + oct) + uri="git://git.osmocom.org/octphy-2g-headers" + version="origin/master" + ;; + lc15) + uri="https://gitlab.com/nrw_litecell15/litecell15-fw" + version="nrw/litecell15-next" + ;; + *) + echo "Unknown BTS model '$1'" + exit 1 + ;; +esac + +# if 2nd parameter was specified and it's not 'master' then use it instead of default +if [ -n "$2" ] +then + if [ "$2" != "master" ] + then + version=$2 + fi +fi + +if ! test -d layer1-headers; +then + git clone "$uri" layer1-headers +fi + +cd layer1-headers +git fetch origin +git reset --hard "$version" -- To view, visit https://gerrit.osmocom.org/2893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Gerrit-PatchSet: 5 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 19 08:39:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 08:39:00 +0000 Subject: libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 What's the point of accommodating for compiler bugs? There're too many of those to change the code for each one of them. The proper fix would be to update compiler to version which has this bug fixed. -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Jun 19 08:46:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 08:46:58 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: > why not go for python without specifying a version number here? Good idea - in this case we don't have change debian/control: AFAIK jenkins buildslaves are not used for making .deb packages anyway and OBS have no problems with python3. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 09:09:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 09:09:24 +0000 Subject: [PATCH] libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2901 to look at the new patch set (#3). Move NUM_BYTES macro to core library It's universally useful so it make sense to have it in the shared core: * move macro from libosmocoding to libosmocore * add OSMO_ prefix * add doxygen docs Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/core/utils.h M src/coding/gsm0503_coding.c 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/2901/3 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index 55375bb..2f0e631 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -13,7 +13,6 @@ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) -#define NUM_BYTES(N) ((N + 8 - 1) / 8) enum gsm0503_egprs_mcs { EGPRS_MCS0, diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..1d1ebd8 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -19,6 +19,8 @@ #define OSMO_STRINGIFY(x) #x /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Number of bytes necessary to store given BITS */ +#define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) #include #include diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 7039863..1e70d2e 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -901,7 +901,7 @@ u, 0, data_len, 1); /* Return the number of bytes required for the bit message */ - return NUM_BYTES(code->hdr_len + code->data_len); + return OSMO_BYTES_FOR_BITS(code->hdr_len + code->data_len); } /*! \brief Decode EGPRS UL message -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 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-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 09:19:33 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 09:19:33 +0000 Subject: libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 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-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 10:09:18 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 10:09:18 +0000 Subject: [PATCH] libosmocore[master]: core/conv/viterbi.c: drop unused structure member Message-ID: Review at https://gerrit.osmocom.org/2966 core/conv/viterbi.c: drop unused structure member Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b --- M src/viterbi.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/2966/1 diff --git a/src/viterbi.c b/src/viterbi.c index 308cfe0..9574084 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -156,7 +156,6 @@ * recursive - Set to '1' if the code is recursive * intrvl - Normalization interval * trellis - Trellis object - * punc - Puncturing sequence * paths - Trellis paths */ struct vdecoder { @@ -166,7 +165,6 @@ int recursive; int intrvl; struct vtrellis *trellis; - int *punc; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, -- To view, visit https://gerrit.osmocom.org/2966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 10:09:19 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 10:09:19 +0000 Subject: [PATCH] libosmocore[master]: core/conv/viterbi.c: delete reset_decoder() Message-ID: Review at https://gerrit.osmocom.org/2967 core/conv/viterbi.c: delete reset_decoder() Currently this implementation exposes nothing than osmo_conv_decode_acc(), so it wasn't possible to call reset_decoder() from outside. The method itself was used to initialize accumulated path metrics and the starting state of encoder. Now this code is moved to generate_trellis(). Moreover, setting accumulated path metrics inside existing loop is a bit faster that calling memset(). Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 --- M src/viterbi.c 1 file changed, 13 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/2967/1 diff --git a/src/viterbi.c b/src/viterbi.c index 9574084..7777f96 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -413,32 +413,27 @@ rc = gen_state_info(&trellis->vals[i], i, outputs, code); } + + if (rc < 0) + goto fail; + + /* Set accumulated path metrics to zero */ + trellis->sums[i] = 0; } - if (rc < 0) - goto fail; + /** + * For termination other than tail-biting, initialize the zero state + * as the encoder starting state. Initialize with the maximum + * accumulated sum at length equal to the constraint length. + */ + if (code->term != CONV_TERM_TAIL_BITING) + trellis->sums[0] = INT8_MAX * code->N * code->K; return trellis; fail: free_trellis(trellis); return NULL; -} - -/* Reset decoder - * Set accumulated path metrics to zero. For termination other than - * tail-biting, initialize the zero state as the encoder starting state. - * Initialize with the maximum accumulated sum at length equal to the - * constraint length. - */ -static void reset_decoder(struct vdecoder *dec, int term) -{ - int ns = dec->trellis->num_states; - - memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); - - if (term != CONV_TERM_TAIL_BITING) - dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; } static void _traceback(struct vdecoder *dec, @@ -640,8 +635,6 @@ const int *punc, uint8_t *out, int len, int term) { int8_t depunc[dec->len * dec->n]; - - reset_decoder(dec, term); if (punc) { depuncture(seq, punc, depunc, dec->len * dec->n); -- To view, visit https://gerrit.osmocom.org/2967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 10:09:19 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 10:09:19 +0000 Subject: [PATCH] libosmocore[master]: core/conv/viterbi.c: use static allocation for vdecoder Message-ID: Review at https://gerrit.osmocom.org/2968 core/conv/viterbi.c: use static allocation for vdecoder Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The vdecoder struct wasn't require dynamic allocation itself, so let's use static allocation in order to increase performance. Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab --- M src/viterbi.c 1 file changed, 19 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/2968/1 diff --git a/src/viterbi.c b/src/viterbi.c index 7777f96..9806386 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -498,7 +498,7 @@ } /* Release decoder object */ -static void free_vdec(struct vdecoder *dec) +static void vdec_deinit(struct vdecoder *dec) { if (!dec) return; @@ -509,22 +509,18 @@ vdec_free(dec->paths[0]); free(dec->paths); } - - free(dec); } -/* Allocate decoder object +/* Initialize decoder object with code specific params * Subtract the constraint length K on the normalization interval to * accommodate the initialization path metric at state zero. */ -static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { int i, ns; - struct vdecoder *dec; ns = NUM_STATES(code->K); - dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); dec->n = code->N; dec->k = code->K; dec->recursive = conv_code_recursive(code); @@ -542,7 +538,7 @@ dec->metric_func = osmo_conv_metrics_k5_n4; break; default: - goto fail; + return -EINVAL; } } else if (dec->k == 7) { switch (dec->n) { @@ -556,10 +552,10 @@ dec->metric_func = osmo_conv_metrics_k7_n4; break; default: - goto fail; + return -EINVAL; } } else { - goto fail; + return -EINVAL; } if (code->term == CONV_TERM_FLUSH) @@ -569,24 +565,24 @@ dec->trellis = generate_trellis(code); if (!dec->trellis) - goto fail; + goto enomem; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) - goto fail; + goto enomem; dec->paths[0] = vdec_malloc(ns * dec->len); if (!dec->paths[0]) - goto fail; + goto enomem; for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; - return dec; + return 0; -fail: - free_vdec(dec); - return NULL; +enomem: + vdec_deinit(dec); + return -ENOMEM; } /* Depuncture sequence with nagative value terminated puncturing matrix */ @@ -697,7 +693,7 @@ const sbit_t *input, ubit_t *output) { int rc; - struct vdecoder *vdec; + struct vdecoder dec; if (!init_complete) osmo_conv_init(); @@ -706,14 +702,14 @@ ((code->K != 5) && (code->K != 7))) return -EINVAL; - vdec = alloc_vdec(code); - if (!vdec) - return -EFAULT; + rc = vdec_init(&dec, code); + if (rc) + return rc; - rc = conv_decode(vdec, input, code->puncture, + rc = conv_decode(&dec, input, code->puncture, output, code->len, code->term); - free_vdec(vdec); + vdec_deinit(&dec); return rc; } -- To view, visit https://gerrit.osmocom.org/2968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 10:09:19 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 10:09:19 +0000 Subject: [PATCH] libosmocore[master]: core/conv/viterbi.c: use static allocation for trellis Message-ID: Review at https://gerrit.osmocom.org/2969 core/conv/viterbi.c: use static allocation for trellis Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The trellis struct wasn't require dynamic allocation itself, so let's allocate one statically inside the vdecoder structure. Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 --- M src/viterbi.c 1 file changed, 23 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/2969/1 diff --git a/src/viterbi.c b/src/viterbi.c index 9806386..8dcf850 100644 --- a/src/viterbi.c +++ b/src/viterbi.c @@ -164,7 +164,7 @@ int len; int recursive; int intrvl; - struct vtrellis *trellis; + struct vtrellis trellis; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, @@ -372,41 +372,38 @@ vdec_free(trellis->outputs); vdec_free(trellis->sums); free(trellis->vals); - free(trellis); } -/* Allocate and initialize the trellis object +/* Initialize the trellis object * Initialization consists of generating the outputs and output value of a * given state. Due to trellis symmetry and anti-symmetry, only one of the * transition paths is utilized by the butterfly operation in the forward * recursion, so only one set of N outputs is required per state variable. */ -static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +static int generate_trellis(struct vdecoder *dec, + const struct osmo_conv_code *code) { - int i, rc = -1; - struct vtrellis *trellis; + struct vtrellis *trellis = &dec->trellis; int16_t *outputs; + int i, rc; int ns = NUM_STATES(code->K); - int recursive = conv_code_recursive(code); int olen = (code->N == 2) ? 2 : 4; - - trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); - if (!trellis) - goto fail; trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs || !trellis->vals) + if (!trellis->sums || !trellis->outputs || !trellis->vals) { + rc = -ENOMEM; goto fail; + } /* Populate the trellis state objects */ for (i = 0; i < ns; i++) { outputs = &trellis->outputs[olen * i]; - if (recursive) { + if (dec->recursive) { rc = gen_recursive_state_info(&trellis->vals[i], i, outputs, code); } else { @@ -429,11 +426,11 @@ if (code->term != CONV_TERM_TAIL_BITING) trellis->sums[0] = INT8_MAX * code->N * code->K; - return trellis; + return 0; fail: free_trellis(trellis); - return NULL; + return rc; } static void _traceback(struct vdecoder *dec, @@ -444,7 +441,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = dec->trellis->vals[state]; + out[i] = dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -457,7 +454,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = path ^ dec->trellis->vals[state]; + out[i] = path ^ dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -472,8 +469,8 @@ unsigned path, state = 0; if (term != CONV_TERM_FLUSH) { - for (i = 0; i < dec->trellis->num_states; i++) { - sum = dec->trellis->sums[i]; + for (i = 0; i < dec->trellis.num_states; i++) { + sum = dec->trellis.sums[i]; if (sum > max) { max = sum; state = i; @@ -503,7 +500,7 @@ if (!dec) return; - free_trellis(dec->trellis); + free_trellis(&dec->trellis); if (dec->paths != NULL) { vdec_free(dec->paths[0]); @@ -517,7 +514,7 @@ */ static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { - int i, ns; + int i, ns, rc; ns = NUM_STATES(code->K); @@ -563,9 +560,9 @@ else dec->len = code->len; - dec->trellis = generate_trellis(code); - if (!dec->trellis) - goto enomem; + rc = generate_trellis(dec, code); + if (rc) + return rc; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) @@ -610,13 +607,12 @@ */ static void forward_traverse(struct vdecoder *dec, const int8_t *seq) { - struct vtrellis *trellis = dec->trellis; int i; for (i = 0; i < dec->len; i++) { dec->metric_func(&seq[dec->n * i], - trellis->outputs, - trellis->sums, + dec->trellis.outputs, + dec->trellis.sums, dec->paths[i], !(i % dec->intrvl)); } -- To view, visit https://gerrit.osmocom.org/2969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 10:26:41 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 10:26:41 +0000 Subject: [PATCH] libosmocore[master]: vty: additional nodes for sccp-address configuration 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/2922 to look at the new patch set (#2). vty: additional nodes for sccp-address configuration The planned sccp-addressbook implementation in libosmo-sccp requires two additional VTY nodes. See also in libosmo-sccp.git: Change-Id I068ed7f7d113dab88424a9d47bab7fc703bb7942 Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 --- M TODO-RELEASE M include/osmocom/vty/command.h 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/2922/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index a23fcea..1964cff 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,4 @@ 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 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index b39bbf7..62989c1 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -92,13 +92,13 @@ L_CS7_RTABLE_NODE, /*!< \brief SS7 Routing Table */ L_CS7_LINK_NODE, /*!< \brief SS7 Link */ L_CS7_LINKSET_NODE, /*!< \brief SS7 Linkset */ + L_CS7_SCCPADDR_NODE, /*!< \brief SS7 SCCP Address */ + L_CS7_SCCPADDR_GT_NODE, /*!< \brief SS7 SCCP Global Title */ /* * When adding new nodes to the libosmocore project, these nodes can be * used to avoid ABI changes for unrelated projects. */ - RESERVED1_NODE, /*!< \brief Reserved for later extensions */ - RESERVED2_NODE, /*!< \brief Reserved for later extensions */ RESERVED3_NODE, /*!< \brief Reserved for later extensions */ _LAST_OSMOVTY_NODE -- To view, visit https://gerrit.osmocom.org/2922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Jun 19 10:54:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 10:54:14 +0000 Subject: [PATCH] osmo-pcu[master]: lc15: use generic L1 headers helper Message-ID: Review at https://gerrit.osmocom.org/2970 lc15: use generic L1 headers helper * use generic L1 headers helper for both sysmocom-dsp and lc15bts-phy options * use sh instead of bash Related: SYS#3683 Change-Id: I3dc621731f47650cbc15a5f17b9e899e9ed2770f --- M contrib/jenkins.sh 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/70/2970/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 8a96380..9c5c2e2 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex @@ -22,17 +22,19 @@ # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" - if [ ! -d layer1-api ]; then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api - fi - cd layer1-api - git fetch origin - git reset --hard origin/master + osmo-layer1-headers.sh sysmo + cd layer1-headers api_incl="$inst/include/sysmocom/femtobts/" mkdir -p "$api_incl" cp include/*.h "$api_incl" cd "$base" +elif [ "$with_dsp" = lc15 ]; then + PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc" + cd "$deps" + osmo-layer1-headers.sh lc15 + cd "$base" + elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then echo "Direct DSP access disabled" else -- To view, visit https://gerrit.osmocom.org/2970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3dc621731f47650cbc15a5f17b9e899e9ed2770f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:10:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 11:10:55 +0000 Subject: [PATCH] osmo-ci[master]: lc15: correct default master branch Message-ID: Review at https://gerrit.osmocom.org/2971 lc15: correct default master branch Change-Id: I6e86edc34fdb8c7bc57f87c41e05dd2338dd2506 Related: SYS#3683 --- M scripts/osmo-layer1-headers.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/71/2971/1 diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh index b2372d4..374515e 100755 --- a/scripts/osmo-layer1-headers.sh +++ b/scripts/osmo-layer1-headers.sh @@ -20,7 +20,7 @@ ;; lc15) uri="https://gitlab.com/nrw_litecell15/litecell15-fw" - version="nrw/litecell15-next" + version="origin/nrw/litecell15" ;; *) echo "Unknown BTS model '$1'" -- To view, visit https://gerrit.osmocom.org/2971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e86edc34fdb8c7bc57f87c41e05dd2338dd2506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:22:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:22:23 +0000 Subject: [PATCH] libosmocore[master]: core/conv: use proper filenames Message-ID: Review at https://gerrit.osmocom.org/2972 core/conv: use proper filenames We already have generic convolutional transcoding implementation written by Sylvain Munaut and named 'conv.c', so 'viterbi_*' names looked a bit confusing. Let's use a single naming scheme for Viterbi related code. Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 --- M src/Makefile.am R src/conv_acc.c R src/conv_acc_generic.c R src/conv_acc_sse.c R src/conv_acc_sse_avx.c R src/conv_acc_sse_impl.h 6 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/2972/1 diff --git a/src/Makefile.am b/src/Makefile.am index e98c623..692b699 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,28 +21,28 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - viterbi.c viterbi_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c if HAVE_SSE3 -libosmocore_la_SOURCES += viterbi_sse.c +libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 else -viterbi_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : CFLAGS += -msse3 endif if HAVE_AVX2 -libosmocore_la_SOURCES += viterbi_sse_avx.c +libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 else -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 endif endif endif BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c -EXTRA_DIST = viterbi_sse_common.h +EXTRA_DIST = conv_acc_sse_impl.h if ENABLE_PLUGIN libosmocore_la_SOURCES += plugin.c diff --git a/src/viterbi.c b/src/conv_acc.c similarity index 100% rename from src/viterbi.c rename to src/conv_acc.c diff --git a/src/viterbi_generic.c b/src/conv_acc_generic.c similarity index 100% rename from src/viterbi_generic.c rename to src/conv_acc_generic.c diff --git a/src/viterbi_sse.c b/src/conv_acc_sse.c similarity index 98% rename from src/viterbi_sse.c rename to src/conv_acc_sse.c index f389085..9cbcc2f 100644 --- a/src/viterbi_sse.c +++ b/src/conv_acc_sse.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_avx.c b/src/conv_acc_sse_avx.c similarity index 98% rename from src/viterbi_sse_avx.c rename to src/conv_acc_sse_avx.c index b4c45a6..5d9a82b 100644 --- a/src/viterbi_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_common.h b/src/conv_acc_sse_impl.h similarity index 100% rename from src/viterbi_sse_common.h rename to src/conv_acc_sse_impl.h -- To view, visit https://gerrit.osmocom.org/2972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:22:24 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:22:24 +0000 Subject: [PATCH] libosmocore[master]: core/conv: update description headers for conv_acc_* Message-ID: Review at https://gerrit.osmocom.org/2973 core/conv: update description headers for conv_acc_* Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458 --- M src/conv_acc.c M src/conv_acc_generic.c M src/conv_acc_sse.c M src/conv_acc_sse_avx.c M src/conv_acc_sse_impl.h 5 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/2973/1 diff --git a/src/conv_acc.c b/src/conv_acc.c index 8dcf850..13b220b 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -1,5 +1,5 @@ /* - * Viterbi decoder + * Accelerated Viterbi decoder implementation * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_generic.c b/src/conv_acc_generic.c index 6042668..a4787e3 100644 --- a/src/conv_acc_generic.c +++ b/src/conv_acc_generic.c @@ -1,5 +1,6 @@ /* - * Viterbi decoder + * Accelerated Viterbi decoder implementation + * for generic architectures without SSE support * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_sse.c b/src/conv_acc_sse.c index 9cbcc2f..bcc9d48 100644 --- a/src/conv_acc_sse.c +++ b/src/conv_acc_sse.c @@ -1,5 +1,6 @@ /* - * Intel SSE Viterbi decoder + * Accelerated Viterbi decoder implementation + * for architectures with only SSE3 available * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_sse_avx.c b/src/conv_acc_sse_avx.c index 5d9a82b..2ad353a 100644 --- a/src/conv_acc_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -1,5 +1,6 @@ /* - * Intel SSE + AVX Viterbi decoder + * Accelerated Viterbi decoder implementation + * for architectures with both SSE3 and AVX2 support * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index 7d48c94..a62f910 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -1,5 +1,7 @@ /* - * Intel SSE Viterbi decoder + * Accelerated Viterbi decoder implementation + * Actual definitions which are being included + * from both conv_acc_sse.c and conv_acc_sse_avx.c * * Copyright (C) 2013, 2014 Thomas Tsou * -- To view, visit https://gerrit.osmocom.org/2973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:28:57 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: delete reset_decoder() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2967 to look at the new patch set (#2). core/conv/conv_acc.c: delete reset_decoder() Currently this implementation exposes nothing than osmo_conv_decode_acc(), so it wasn't possible to call reset_decoder() from outside. The method itself was used to initialize accumulated path metrics and the starting state of encoder. Now this code is moved to generate_trellis(). Moreover, setting accumulated path metrics inside existing loop is a bit faster that calling memset(). Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 --- M src/conv_acc.c 1 file changed, 13 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/2967/2 diff --git a/src/conv_acc.c b/src/conv_acc.c index c4545d7..7f03628 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -413,32 +413,27 @@ rc = gen_state_info(&trellis->vals[i], i, outputs, code); } + + if (rc < 0) + goto fail; + + /* Set accumulated path metrics to zero */ + trellis->sums[i] = 0; } - if (rc < 0) - goto fail; + /** + * For termination other than tail-biting, initialize the zero state + * as the encoder starting state. Initialize with the maximum + * accumulated sum at length equal to the constraint length. + */ + if (code->term != CONV_TERM_TAIL_BITING) + trellis->sums[0] = INT8_MAX * code->N * code->K; return trellis; fail: free_trellis(trellis); return NULL; -} - -/* Reset decoder - * Set accumulated path metrics to zero. For termination other than - * tail-biting, initialize the zero state as the encoder starting state. - * Initialize with the maximum accumulated sum at length equal to the - * constraint length. - */ -static void reset_decoder(struct vdecoder *dec, int term) -{ - int ns = dec->trellis->num_states; - - memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); - - if (term != CONV_TERM_TAIL_BITING) - dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; } static void _traceback(struct vdecoder *dec, @@ -640,8 +635,6 @@ const int *punc, uint8_t *out, int len, int term) { int8_t depunc[dec->len * dec->n]; - - reset_decoder(dec, term); if (punc) { depuncture(seq, punc, depunc, dec->len * dec->n); -- To view, visit https://gerrit.osmocom.org/2967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:28:57 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: use static allocation for vdecoder In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2968 to look at the new patch set (#2). core/conv/conv_acc.c: use static allocation for vdecoder Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The vdecoder struct wasn't require dynamic allocation itself, so let's use static allocation in order to increase performance. Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab --- M src/conv_acc.c 1 file changed, 19 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/2968/2 diff --git a/src/conv_acc.c b/src/conv_acc.c index 7f03628..f45d50f 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -498,7 +498,7 @@ } /* Release decoder object */ -static void free_vdec(struct vdecoder *dec) +static void vdec_deinit(struct vdecoder *dec) { if (!dec) return; @@ -509,22 +509,18 @@ vdec_free(dec->paths[0]); free(dec->paths); } - - free(dec); } -/* Allocate decoder object +/* Initialize decoder object with code specific params * Subtract the constraint length K on the normalization interval to * accommodate the initialization path metric at state zero. */ -static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { int i, ns; - struct vdecoder *dec; ns = NUM_STATES(code->K); - dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); dec->n = code->N; dec->k = code->K; dec->recursive = conv_code_recursive(code); @@ -542,7 +538,7 @@ dec->metric_func = osmo_conv_metrics_k5_n4; break; default: - goto fail; + return -EINVAL; } } else if (dec->k == 7) { switch (dec->n) { @@ -556,10 +552,10 @@ dec->metric_func = osmo_conv_metrics_k7_n4; break; default: - goto fail; + return -EINVAL; } } else { - goto fail; + return -EINVAL; } if (code->term == CONV_TERM_FLUSH) @@ -569,24 +565,24 @@ dec->trellis = generate_trellis(code); if (!dec->trellis) - goto fail; + goto enomem; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) - goto fail; + goto enomem; dec->paths[0] = vdec_malloc(ns * dec->len); if (!dec->paths[0]) - goto fail; + goto enomem; for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; - return dec; + return 0; -fail: - free_vdec(dec); - return NULL; +enomem: + vdec_deinit(dec); + return -ENOMEM; } /* Depuncture sequence with nagative value terminated puncturing matrix */ @@ -697,7 +693,7 @@ const sbit_t *input, ubit_t *output) { int rc; - struct vdecoder *vdec; + struct vdecoder dec; if (!init_complete) osmo_conv_init(); @@ -706,14 +702,14 @@ ((code->K != 5) && (code->K != 7))) return -EINVAL; - vdec = alloc_vdec(code); - if (!vdec) - return -EFAULT; + rc = vdec_init(&dec, code); + if (rc) + return rc; - rc = conv_decode(vdec, input, code->puncture, + rc = conv_decode(&dec, input, code->puncture, output, code->len, code->term); - free_vdec(vdec); + vdec_deinit(&dec); return rc; } -- To view, visit https://gerrit.osmocom.org/2968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:28:57 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: use static allocation for trellis In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2969 to look at the new patch set (#2). core/conv/conv_acc.c: use static allocation for trellis Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The trellis struct wasn't require dynamic allocation itself, so let's allocate one statically inside the vdecoder structure. Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 --- M src/conv_acc.c 1 file changed, 23 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/2969/2 diff --git a/src/conv_acc.c b/src/conv_acc.c index f45d50f..13b220b 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -164,7 +164,7 @@ int len; int recursive; int intrvl; - struct vtrellis *trellis; + struct vtrellis trellis; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, @@ -372,41 +372,38 @@ vdec_free(trellis->outputs); vdec_free(trellis->sums); free(trellis->vals); - free(trellis); } -/* Allocate and initialize the trellis object +/* Initialize the trellis object * Initialization consists of generating the outputs and output value of a * given state. Due to trellis symmetry and anti-symmetry, only one of the * transition paths is utilized by the butterfly operation in the forward * recursion, so only one set of N outputs is required per state variable. */ -static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +static int generate_trellis(struct vdecoder *dec, + const struct osmo_conv_code *code) { - int i, rc = -1; - struct vtrellis *trellis; + struct vtrellis *trellis = &dec->trellis; int16_t *outputs; + int i, rc; int ns = NUM_STATES(code->K); - int recursive = conv_code_recursive(code); int olen = (code->N == 2) ? 2 : 4; - - trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); - if (!trellis) - goto fail; trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs || !trellis->vals) + if (!trellis->sums || !trellis->outputs || !trellis->vals) { + rc = -ENOMEM; goto fail; + } /* Populate the trellis state objects */ for (i = 0; i < ns; i++) { outputs = &trellis->outputs[olen * i]; - if (recursive) { + if (dec->recursive) { rc = gen_recursive_state_info(&trellis->vals[i], i, outputs, code); } else { @@ -429,11 +426,11 @@ if (code->term != CONV_TERM_TAIL_BITING) trellis->sums[0] = INT8_MAX * code->N * code->K; - return trellis; + return 0; fail: free_trellis(trellis); - return NULL; + return rc; } static void _traceback(struct vdecoder *dec, @@ -444,7 +441,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = dec->trellis->vals[state]; + out[i] = dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -457,7 +454,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = path ^ dec->trellis->vals[state]; + out[i] = path ^ dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -472,8 +469,8 @@ unsigned path, state = 0; if (term != CONV_TERM_FLUSH) { - for (i = 0; i < dec->trellis->num_states; i++) { - sum = dec->trellis->sums[i]; + for (i = 0; i < dec->trellis.num_states; i++) { + sum = dec->trellis.sums[i]; if (sum > max) { max = sum; state = i; @@ -503,7 +500,7 @@ if (!dec) return; - free_trellis(dec->trellis); + free_trellis(&dec->trellis); if (dec->paths != NULL) { vdec_free(dec->paths[0]); @@ -517,7 +514,7 @@ */ static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { - int i, ns; + int i, ns, rc; ns = NUM_STATES(code->K); @@ -563,9 +560,9 @@ else dec->len = code->len; - dec->trellis = generate_trellis(code); - if (!dec->trellis) - goto enomem; + rc = generate_trellis(dec, code); + if (rc) + return rc; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) @@ -610,13 +607,12 @@ */ static void forward_traverse(struct vdecoder *dec, const int8_t *seq) { - struct vtrellis *trellis = dec->trellis; int i; for (i = 0; i < dec->len; i++) { dec->metric_func(&seq[dec->n * i], - trellis->outputs, - trellis->sums, + dec->trellis.outputs, + dec->trellis.sums, dec->paths[i], !(i % dec->intrvl)); } -- To view, visit https://gerrit.osmocom.org/2969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:28:57 +0000 Subject: [PATCH] libosmocore[master]: core/conv: use proper filenames In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2972 to look at the new patch set (#2). core/conv: use proper filenames We already have generic convolutional transcoding implementation written by Sylvain Munaut and named 'conv.c', so 'viterbi_*' names looked a bit confusing. Let's use a single naming scheme for Viterbi related code. Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 --- M src/Makefile.am R src/conv_acc.c R src/conv_acc_generic.c R src/conv_acc_sse.c R src/conv_acc_sse_avx.c R src/conv_acc_sse_impl.h 6 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/2972/2 diff --git a/src/Makefile.am b/src/Makefile.am index e98c623..692b699 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,28 +21,28 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - viterbi.c viterbi_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c if HAVE_SSE3 -libosmocore_la_SOURCES += viterbi_sse.c +libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 else -viterbi_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : CFLAGS += -msse3 endif if HAVE_AVX2 -libosmocore_la_SOURCES += viterbi_sse_avx.c +libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 else -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 endif endif endif BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c -EXTRA_DIST = viterbi_sse_common.h +EXTRA_DIST = conv_acc_sse_impl.h if ENABLE_PLUGIN libosmocore_la_SOURCES += plugin.c diff --git a/src/viterbi.c b/src/conv_acc.c similarity index 100% rename from src/viterbi.c rename to src/conv_acc.c diff --git a/src/viterbi_generic.c b/src/conv_acc_generic.c similarity index 100% rename from src/viterbi_generic.c rename to src/conv_acc_generic.c diff --git a/src/viterbi_sse.c b/src/conv_acc_sse.c similarity index 98% rename from src/viterbi_sse.c rename to src/conv_acc_sse.c index f389085..9cbcc2f 100644 --- a/src/viterbi_sse.c +++ b/src/conv_acc_sse.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_avx.c b/src/conv_acc_sse_avx.c similarity index 98% rename from src/viterbi_sse_avx.c rename to src/conv_acc_sse_avx.c index b4c45a6..5d9a82b 100644 --- a/src/viterbi_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_common.h b/src/conv_acc_sse_impl.h similarity index 100% rename from src/viterbi_sse_common.h rename to src/conv_acc_sse_impl.h -- To view, visit https://gerrit.osmocom.org/2972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:30:38 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: drop unused structure member In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2966 to look at the new patch set (#2). core/conv/conv_acc.c: drop unused structure member Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b --- M src/conv_acc.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/2966/2 diff --git a/src/conv_acc.c b/src/conv_acc.c index a3e3f16..c4545d7 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -156,7 +156,6 @@ * recursive - Set to '1' if the code is recursive * intrvl - Normalization interval * trellis - Trellis object - * punc - Puncturing sequence * paths - Trellis paths */ struct vdecoder { @@ -166,7 +165,6 @@ int recursive; int intrvl; struct vtrellis *trellis; - int *punc; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, -- To view, visit https://gerrit.osmocom.org/2966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:30:38 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: delete reset_decoder() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2967 to look at the new patch set (#3). core/conv/conv_acc.c: delete reset_decoder() Currently this implementation exposes nothing than osmo_conv_decode_acc(), so it wasn't possible to call reset_decoder() from outside. The method itself was used to initialize accumulated path metrics and the starting state of encoder. Now this code is moved to generate_trellis(). Moreover, setting accumulated path metrics inside existing loop is a bit faster that calling memset(). Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 --- M src/conv_acc.c 1 file changed, 13 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/2967/3 diff --git a/src/conv_acc.c b/src/conv_acc.c index c4545d7..7f03628 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -413,32 +413,27 @@ rc = gen_state_info(&trellis->vals[i], i, outputs, code); } + + if (rc < 0) + goto fail; + + /* Set accumulated path metrics to zero */ + trellis->sums[i] = 0; } - if (rc < 0) - goto fail; + /** + * For termination other than tail-biting, initialize the zero state + * as the encoder starting state. Initialize with the maximum + * accumulated sum at length equal to the constraint length. + */ + if (code->term != CONV_TERM_TAIL_BITING) + trellis->sums[0] = INT8_MAX * code->N * code->K; return trellis; fail: free_trellis(trellis); return NULL; -} - -/* Reset decoder - * Set accumulated path metrics to zero. For termination other than - * tail-biting, initialize the zero state as the encoder starting state. - * Initialize with the maximum accumulated sum at length equal to the - * constraint length. - */ -static void reset_decoder(struct vdecoder *dec, int term) -{ - int ns = dec->trellis->num_states; - - memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); - - if (term != CONV_TERM_TAIL_BITING) - dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; } static void _traceback(struct vdecoder *dec, @@ -640,8 +635,6 @@ const int *punc, uint8_t *out, int len, int term) { int8_t depunc[dec->len * dec->n]; - - reset_decoder(dec, term); if (punc) { depuncture(seq, punc, depunc, dec->len * dec->n); -- To view, visit https://gerrit.osmocom.org/2967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:30:38 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: use static allocation for vdecoder In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2968 to look at the new patch set (#3). core/conv/conv_acc.c: use static allocation for vdecoder Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The vdecoder struct wasn't require dynamic allocation itself, so let's use static allocation in order to increase performance. Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab --- M src/conv_acc.c 1 file changed, 19 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/2968/3 diff --git a/src/conv_acc.c b/src/conv_acc.c index 7f03628..f45d50f 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -498,7 +498,7 @@ } /* Release decoder object */ -static void free_vdec(struct vdecoder *dec) +static void vdec_deinit(struct vdecoder *dec) { if (!dec) return; @@ -509,22 +509,18 @@ vdec_free(dec->paths[0]); free(dec->paths); } - - free(dec); } -/* Allocate decoder object +/* Initialize decoder object with code specific params * Subtract the constraint length K on the normalization interval to * accommodate the initialization path metric at state zero. */ -static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { int i, ns; - struct vdecoder *dec; ns = NUM_STATES(code->K); - dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); dec->n = code->N; dec->k = code->K; dec->recursive = conv_code_recursive(code); @@ -542,7 +538,7 @@ dec->metric_func = osmo_conv_metrics_k5_n4; break; default: - goto fail; + return -EINVAL; } } else if (dec->k == 7) { switch (dec->n) { @@ -556,10 +552,10 @@ dec->metric_func = osmo_conv_metrics_k7_n4; break; default: - goto fail; + return -EINVAL; } } else { - goto fail; + return -EINVAL; } if (code->term == CONV_TERM_FLUSH) @@ -569,24 +565,24 @@ dec->trellis = generate_trellis(code); if (!dec->trellis) - goto fail; + goto enomem; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) - goto fail; + goto enomem; dec->paths[0] = vdec_malloc(ns * dec->len); if (!dec->paths[0]) - goto fail; + goto enomem; for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; - return dec; + return 0; -fail: - free_vdec(dec); - return NULL; +enomem: + vdec_deinit(dec); + return -ENOMEM; } /* Depuncture sequence with nagative value terminated puncturing matrix */ @@ -697,7 +693,7 @@ const sbit_t *input, ubit_t *output) { int rc; - struct vdecoder *vdec; + struct vdecoder dec; if (!init_complete) osmo_conv_init(); @@ -706,14 +702,14 @@ ((code->K != 5) && (code->K != 7))) return -EINVAL; - vdec = alloc_vdec(code); - if (!vdec) - return -EFAULT; + rc = vdec_init(&dec, code); + if (rc) + return rc; - rc = conv_decode(vdec, input, code->puncture, + rc = conv_decode(&dec, input, code->puncture, output, code->len, code->term); - free_vdec(vdec); + vdec_deinit(&dec); return rc; } -- To view, visit https://gerrit.osmocom.org/2968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:30:38 +0000 Subject: [PATCH] libosmocore[master]: core/conv/conv_acc.c: use static allocation for trellis In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2969 to look at the new patch set (#3). core/conv/conv_acc.c: use static allocation for trellis Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The trellis struct wasn't require dynamic allocation itself, so let's allocate one statically inside the vdecoder structure. Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 --- M src/conv_acc.c 1 file changed, 23 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/2969/3 diff --git a/src/conv_acc.c b/src/conv_acc.c index f45d50f..13b220b 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -164,7 +164,7 @@ int len; int recursive; int intrvl; - struct vtrellis *trellis; + struct vtrellis trellis; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, @@ -372,41 +372,38 @@ vdec_free(trellis->outputs); vdec_free(trellis->sums); free(trellis->vals); - free(trellis); } -/* Allocate and initialize the trellis object +/* Initialize the trellis object * Initialization consists of generating the outputs and output value of a * given state. Due to trellis symmetry and anti-symmetry, only one of the * transition paths is utilized by the butterfly operation in the forward * recursion, so only one set of N outputs is required per state variable. */ -static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +static int generate_trellis(struct vdecoder *dec, + const struct osmo_conv_code *code) { - int i, rc = -1; - struct vtrellis *trellis; + struct vtrellis *trellis = &dec->trellis; int16_t *outputs; + int i, rc; int ns = NUM_STATES(code->K); - int recursive = conv_code_recursive(code); int olen = (code->N == 2) ? 2 : 4; - - trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); - if (!trellis) - goto fail; trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs || !trellis->vals) + if (!trellis->sums || !trellis->outputs || !trellis->vals) { + rc = -ENOMEM; goto fail; + } /* Populate the trellis state objects */ for (i = 0; i < ns; i++) { outputs = &trellis->outputs[olen * i]; - if (recursive) { + if (dec->recursive) { rc = gen_recursive_state_info(&trellis->vals[i], i, outputs, code); } else { @@ -429,11 +426,11 @@ if (code->term != CONV_TERM_TAIL_BITING) trellis->sums[0] = INT8_MAX * code->N * code->K; - return trellis; + return 0; fail: free_trellis(trellis); - return NULL; + return rc; } static void _traceback(struct vdecoder *dec, @@ -444,7 +441,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = dec->trellis->vals[state]; + out[i] = dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -457,7 +454,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = path ^ dec->trellis->vals[state]; + out[i] = path ^ dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -472,8 +469,8 @@ unsigned path, state = 0; if (term != CONV_TERM_FLUSH) { - for (i = 0; i < dec->trellis->num_states; i++) { - sum = dec->trellis->sums[i]; + for (i = 0; i < dec->trellis.num_states; i++) { + sum = dec->trellis.sums[i]; if (sum > max) { max = sum; state = i; @@ -503,7 +500,7 @@ if (!dec) return; - free_trellis(dec->trellis); + free_trellis(&dec->trellis); if (dec->paths != NULL) { vdec_free(dec->paths[0]); @@ -517,7 +514,7 @@ */ static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { - int i, ns; + int i, ns, rc; ns = NUM_STATES(code->K); @@ -563,9 +560,9 @@ else dec->len = code->len; - dec->trellis = generate_trellis(code); - if (!dec->trellis) - goto enomem; + rc = generate_trellis(dec, code); + if (rc) + return rc; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) @@ -610,13 +607,12 @@ */ static void forward_traverse(struct vdecoder *dec, const int8_t *seq) { - struct vtrellis *trellis = dec->trellis; int i; for (i = 0; i < dec->len; i++) { dec->metric_func(&seq[dec->n * i], - trellis->outputs, - trellis->sums, + dec->trellis.outputs, + dec->trellis.sums, dec->paths[i], !(i % dec->intrvl)); } -- To view, visit https://gerrit.osmocom.org/2969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:30:38 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 11:30:38 +0000 Subject: [PATCH] libosmocore[master]: core/conv: use proper filenames In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2972 to look at the new patch set (#3). core/conv: use proper filenames We already have generic convolutional transcoding implementation written by Sylvain Munaut and named 'conv.c', so 'viterbi_*' names looked a bit confusing. Let's use a single naming scheme for Viterbi related code. Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 --- M src/Makefile.am R src/conv_acc.c R src/conv_acc_generic.c R src/conv_acc_sse.c R src/conv_acc_sse_avx.c R src/conv_acc_sse_impl.h 6 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/2972/3 diff --git a/src/Makefile.am b/src/Makefile.am index e98c623..692b699 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,28 +21,28 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - viterbi.c viterbi_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c if HAVE_SSE3 -libosmocore_la_SOURCES += viterbi_sse.c +libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 else -viterbi_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : CFLAGS += -msse3 endif if HAVE_AVX2 -libosmocore_la_SOURCES += viterbi_sse_avx.c +libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 else -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 endif endif endif BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c -EXTRA_DIST = viterbi_sse_common.h +EXTRA_DIST = conv_acc_sse_impl.h if ENABLE_PLUGIN libosmocore_la_SOURCES += plugin.c diff --git a/src/viterbi.c b/src/conv_acc.c similarity index 100% rename from src/viterbi.c rename to src/conv_acc.c diff --git a/src/viterbi_generic.c b/src/conv_acc_generic.c similarity index 100% rename from src/viterbi_generic.c rename to src/conv_acc_generic.c diff --git a/src/viterbi_sse.c b/src/conv_acc_sse.c similarity index 98% rename from src/viterbi_sse.c rename to src/conv_acc_sse.c index f389085..9cbcc2f 100644 --- a/src/viterbi_sse.c +++ b/src/conv_acc_sse.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_avx.c b/src/conv_acc_sse_avx.c similarity index 98% rename from src/viterbi_sse_avx.c rename to src/conv_acc_sse_avx.c index b4c45a6..5d9a82b 100644 --- a/src/viterbi_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_common.h b/src/conv_acc_sse_impl.h similarity index 100% rename from src/viterbi_sse_common.h rename to src/conv_acc_sse_impl.h -- To view, visit https://gerrit.osmocom.org/2972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:49:04 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 11:49:04 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#3). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTX function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 549 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/3 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..17d5009 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,6 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr +*osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..c06cf6a 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,502 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry * +addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr +*osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if(entry) + return &entry->addr; + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + strcpy(entry->name,name); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + memset(&entry->addr.gt, 0, sizeof(entry->addr.gt)); + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-4294967295>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + strcpy(entry->addr.gt.digits, argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1441,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1453,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1477,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1501,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1575,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp 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 Jun 19 11:53:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 11:53:16 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add jenkins helper 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/2891 to look at the new patch set (#8). lc15: add jenkins helper Add jenkins build helper for lc15 and separate header with BTS-agnostic functions. Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_common.sh A contrib/jenkins_lc15.sh 3 files changed, 65 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/2891/8 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..c44daa7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -18,6 +18,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..a0eef43 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE "$PARALLEL_MAKE" +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 8 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 Jun 19 11:53:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 11:53:16 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper 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/2894 to look at the new patch set (#8). Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 12 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/8 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..bde9f38 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,33 +1,14 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..0f926c9 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..ed1edbc 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,31 +1,14 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..bce0690 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:53:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 11:53:17 +0000 Subject: [PATCH] osmo-bts[master]: Use generic L1 headers helper Message-ID: Review at https://gerrit.osmocom.org/2974 Use generic L1 headers helper Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 --- M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 9 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/2974/1 diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a0eef43..fa49979 100644 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -11,15 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d litecell15-fw; -then - git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git -fi - -cd litecell15-fw -git fetch origin -git reset --hard origin/$FIRMWARE_VERSION - +osmo-layer1-headers.sh lc15 $FIRMWARE_VERSION cd "$base" set +x @@ -31,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 $MAKE "$PARALLEL_MAKE" $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 0f926c9..0bcb3df 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -11,20 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct $FIRMWARE_VERSION cd "$base" set +x @@ -36,10 +23,10 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index ed1edbc..0981f5e 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -11,19 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct $FIRMWARE_VERSION cd "$base" set +x @@ -38,7 +26,7 @@ configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ - --with-octsdr-2g=$deps/layer1-api/ \ + --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index bce0690..95518a5 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -11,22 +11,9 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh sysmo $FIRMWARE_VERSION mkdir -p "$inst/include/sysmocom/femtobts" cp include/*.h "$inst/include/sysmocom/femtobts/" - cd "$base" set +x -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 19 11:56:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 11:56:55 +0000 Subject: libosmocore[master]: core/conv: use proper filenames In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 12:00:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 12:00:31 +0000 Subject: libosmocore[master]: core/conv/conv_acc.c: drop unused structure member In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 12:27:07 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 12:27:07 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#4). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 549 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/4 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..17d5009 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,6 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr +*osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..c06cf6a 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,502 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry * +addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr +*osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if(entry) + return &entry->addr; + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + strcpy(entry->name,name); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + memset(&entry->addr.gt, 0, sizeof(entry->addr.gt)); + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-4294967295>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + strcpy(entry->addr.gt.digits, argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1441,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1453,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1477,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1501,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1575,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp 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 Jun 19 12:27:10 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 12:27:10 +0000 Subject: libosmocore[master]: Add macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 In general, looks fine to me. Especially, it's very usable. But if your commit message says: "Add macros ...", it would be better to only add actual macros to keep it atomic. The macros integration could be done in a separate one or in a set of commits (prefered for me) with corresponding description. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 13:10:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 13:10:27 +0000 Subject: libosmocore[master]: fsm.c: Fix compilation warning: Use PRIu32 for uint32_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Jun 19 13:12:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 13:12:13 +0000 Subject: libosmocore[master]: configure.ac: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 5: Have this been tested with .deb package building? -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 5 Gerrit-Project: libosmocore 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 Jun 19 13:17:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 13:17:18 +0000 Subject: [PATCH] libosmocore[master]: fix build: viterbi_sse: use AM_CFLAGS, not CFLAGS Message-ID: Review at https://gerrit.osmocom.org/2975 fix build: viterbi_sse: use AM_CFLAGS, not CFLAGS This allows passing 'make CFLAGS+="..."' without breaking the build. Suggested-by: zecke Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b --- M src/Makefile.am 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/2975/1 diff --git a/src/Makefile.am b/src/Makefile.am index e98c623..60f5002 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,17 +26,17 @@ if HAVE_SSE3 libosmocore_la_SOURCES += viterbi_sse.c if HAVE_SSE4_1 -viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 +viterbi_sse.lo : AM_CFLAGS += -msse3 -msse4.1 else -viterbi_sse.lo : CFLAGS += -msse3 +viterbi_sse.lo : AM_CFLAGS += -msse3 endif if HAVE_AVX2 libosmocore_la_SOURCES += viterbi_sse_avx.c if HAVE_SSE4_1 -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +viterbi_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 -msse4.1 else -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 +viterbi_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 endif endif endif -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 13:21:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 13:21:56 +0000 Subject: libosmocore[master]: fix build: viterbi_sse: use AM_CFLAGS, not CFLAGS In-Reply-To: References: Message-ID: Patch Set 1: this was built with this patch: http://jenkins.osmocom.org/jenkins/job/Osmocom_Sanitizer/578/ It's red because of libsccp, but libosmocore worked. -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 1 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 Mon Jun 19 13:31:12 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Mon, 19 Jun 2017 13:31:12 +0000 Subject: osmo-pcu[master]: lc15: use generic L1 headers helper In-Reply-To: References: Message-ID: Patch Set 1: Afaics the called script isn't available (rebase?, see log): + osmo-layer1-headers.sh sysmo ./contrib/jenkins.sh: line 25: osmo-layer1-headers.sh: command not found Build step 'Execute shell' marked build as failure [WARNINGS] Skipping publisher since build result is FAILURE Finished: FAILURE -- To view, visit https://gerrit.osmocom.org/2970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3dc621731f47650cbc15a5f17b9e899e9ed2770f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 13:34:37 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Mon, 19 Jun 2017 13:34:37 +0000 Subject: osmo-bts[master]: Use generic L1 headers helper In-Reply-To: References: Message-ID: Patch Set 1: Afaics invoked script is not available (rebase?), see log: + osmo-layer1-headers.sh sysmo master ./contrib/jenkins_sysmobts.sh: line 14: osmo-layer1-headers.sh: command not found Build step 'Execute shell' marked build as failure [WARNINGS] Skipping publisher since build result is FAILURE Finished: FAILURE -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 13:37:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 13:37:49 +0000 Subject: [PATCH] libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2857 to look at the new patch set (#3). Add and use macros to set/get/clear/toggle bit flags We extensively use bit masks and flags but do not have any convenience wrappers for it which decrease code readability. Add macros which can set/get, clear and toggle bits with corresponding doxygen annotations and use them throughout the code to make sure they are covered by existing tests. Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f --- M include/osmocom/core/utils.h M src/bits.c M src/fsm.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns_vty.c 5 files changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/2857/3 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..3b1838e 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -20,6 +20,15 @@ /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Set flag bit in x */ +#define OSMO_BIT_SET(x, flag) ((x) |= 1 << (flag)) +/*! \brief Get flag bit in x */ +#define OSMO_BIT_GET(x, flag) ((x) & (1 << (flag))) +/*! \brief Clear flag bit in x */ +#define OSMO_BIT_CLEAR(x, flag) ((x) &= ~(1 << (flag))) +/*! \brief Toggle flag bit in x */ +#define OSMO_BIT_TOGGLE(x, flag) ((x) ^= (1 << (flag))) + #include #include diff --git a/src/bits.c b/src/bits.c index 0c77b27..37c98f0 100644 --- a/src/bits.c +++ b/src/bits.c @@ -23,6 +23,7 @@ #include #include +#include /*! \addtogroup bits * @{ @@ -193,9 +194,9 @@ op = out_ofs + i; bn = lsb_mode ? (op&7) : (7-(op&7)); if (in[in_ofs+i]) - out[op>>3] |= 1 << bn; + OSMO_BIT_SET(out[op>>3], bn); else - out[op>>3] &= ~(1 << bn); + OSMO_BIT_CLEAR(out[op>>3], bn); } return ((out_ofs + num_bits - 1) >> 3) + 1; } diff --git a/src/fsm.c b/src/fsm.c index 5e74482..333f9e9 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -355,7 +355,7 @@ const struct osmo_fsm_state *st = &fsm->states[fi->state]; /* validate if new_state is a valid state */ - if (!(st->out_state_mask & (1 << new_state))) { + if (!OSMO_BIT_GET(st->out_state_mask, new_state)) { LOGPFSMLSRC(fi, LOGL_ERROR, file, line, "transition to state %s not permitted!\n", osmo_fsm_state_name(fsm, new_state)); @@ -423,12 +423,12 @@ LOGPFSMSRC(fi, file, line, "Received Event %s\n", osmo_fsm_event_name(fsm, event)); - if (((1 << event) & fsm->allstate_event_mask) && fsm->allstate_action) { + if (OSMO_BIT_GET(fsm->allstate_event_mask, event) && fsm->allstate_action) { fsm->allstate_action(fi, event, data); return 0; } - if (!((1 << event) & fs->in_event_mask)) { + if (!OSMO_BIT_GET(fs->in_event_mask, event)) { LOGPFSMLSRC(fi, LOGL_ERROR, file, line, "Event %s not permitted\n", osmo_fsm_event_name(fsm, event)); diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f3f354c..7501b00 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include #include #include @@ -47,7 +47,7 @@ struct bssgp_bvc_ctx *bctx) { if (bctx) { - target->filter_map |= (1 << LOG_FLT_GB_BVC); + OSMO_BIT_SET(target->filter_map, LOG_FLT_GB_BVC); target->filter_data[LOG_FLT_GB_BVC] = bctx; } else if (target->filter_data[LOG_FLT_GB_BVC]) { target->filter_map = ~(1 << LOG_FLT_GB_BVC); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index bdccb3f..e8d7a1b 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -34,7 +34,7 @@ #include #include #include - +#include #include #include #include @@ -62,7 +62,7 @@ struct gprs_nsvc *nsvc) { if (nsvc) { - target->filter_map |= (1 << LOG_FLT_GB_NSVC); + OSMO_BIT_SET(target->filter_map, LOG_FLT_GB_NSVC); target->filter_data[LOG_FLT_GB_NSVC] = nsvc; } else if (target->filter_data[LOG_FLT_GB_NSVC]) { target->filter_map = ~(1 << LOG_FLT_GB_NSVC); -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:05:16 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:05:16 +0000 Subject: libosmocore[master]: fix build: viterbi_sse: use AM_CFLAGS, not CFLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:07:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:07:28 +0000 Subject: libosmocore[master]: core/conv: use proper filenames In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:07:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:07:32 +0000 Subject: libosmocore[master]: core/conv: update description headers for conv_acc_* In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:07:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:07:48 +0000 Subject: libosmocore[master]: core/conv/conv_acc.c: drop unused structure member In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:08:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:08:21 +0000 Subject: libosmocore[master]: core/conv/conv_acc.c: delete reset_decoder() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:08:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:08:45 +0000 Subject: libosmocore[master]: core/conv/conv_acc.c: use static allocation for vdecoder In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:09:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:09:48 +0000 Subject: libosmocore[master]: core/conv/conv_acc.c: use static allocation for trellis In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:14:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:14:54 +0000 Subject: libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/2924/4/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1359: "nature-of-address-indicator <0-4294967295>", where did you see that this could be 32bits? I can only see 7 bits in Q.713 Sec.3.4.2.3.1 -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp 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 Jun 19 14:16:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:16:18 +0000 Subject: libosmocore[master]: vty: additional nodes for sccp-address configuration In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 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 Mon Jun 19 14:17:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:17:18 +0000 Subject: libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 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-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:18:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 14:18:16 +0000 Subject: [MERGED] libosmocore[master]: Move NUM_BYTES macro to core library In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move NUM_BYTES macro to core library ...................................................................... Move NUM_BYTES macro to core library It's universally useful so it make sense to have it in the shared core: * move macro from libosmocoding to libosmocore * add OSMO_ prefix * add doxygen docs Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 --- M include/osmocom/coding/gsm0503_coding.h M include/osmocom/core/utils.h M src/coding/gsm0503_coding.c 3 files changed, 3 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index 55375bb..2f0e631 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -13,7 +13,6 @@ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) -#define NUM_BYTES(N) ((N + 8 - 1) / 8) enum gsm0503_egprs_mcs { EGPRS_MCS0, diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab..1d1ebd8 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -19,6 +19,8 @@ #define OSMO_STRINGIFY(x) #x /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Number of bytes necessary to store given BITS */ +#define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) #include #include diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 7039863..1e70d2e 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -901,7 +901,7 @@ u, 0, data_len, 1); /* Return the number of bytes required for the bit message */ - return NUM_BYTES(code->hdr_len + code->data_len); + return OSMO_BYTES_FOR_BITS(code->hdr_len + code->data_len); } /*! \brief Decode EGPRS UL message -- To view, visit https://gerrit.osmocom.org/2901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 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: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:18:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 19 Jun 2017 14:18:53 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 8: basically waiting for Neels to voice his opinion on the latest patch and to decide how to move ahead here. -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add speech codec type constants 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/2818 to look at the new patch set (#5). gsm0808: add speech codec type constants The codec type to be set in member type in struct gsm0808_speech_codec has its own coding scheme to reference the used codec types. This patch declares an enum with valid speech codec types. Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/2818/5 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 5916823..7656c38 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -397,9 +397,27 @@ GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_FR4 = 0x41, /*!< OFR AMR-WB */ + GSM0808_PERM_FR5 = 0x42, /*!< FR AMR-WB */ GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ + GSM0808_PERM_HR4 = 0x46, /*!< OHR AMR-WB */ + GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ +}; + +/*! \brief 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ +enum gsm0808_speech_codec_type { + GSM0808_SCT_FR1 = 0x0, /*!< GSM FR */ + GSM0808_SCT_FR2 = 0x2, /*!< GSM EFR */ + GSM0808_SCT_FR3 = 0x3, /*!< FR AMR */ + GSM0808_SCT_FR4 = 0xc, /*!< OFR AMR-WB */ + GSM0808_SCT_FR5 = 0x9, /*!< FR AMR-WB */ + GSM0808_SCT_HR1 = 0x1, /*!< GSM_HR */ + GSM0808_SCT_HR3 = 0x4, /*!< HR_AMR */ + GSM0808_SCT_HR4 = 0xd, /*!< OHR AMR-WB */ + GSM0808_SCT_HR6 = 0xb, /*!< OHR AMR */ + GSM0808_SCT_CSD = 0xfd, /*!< CSData (see also TS 26.103) */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator 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/2820 to look at the new patch set (#4). gsm0808: fix AoIP speech codec element parser/generator The implementation of the parser/generator for the speech codec information element slightly wrong, making it impossible to use it properly. (See also: 3GPP TS 48.008, 3.2.2.103) Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 136 insertions(+), 79 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/2820/4 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 7656c38..9e00d23 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -447,8 +447,6 @@ bool tf; uint8_t type; uint16_t cfg; - bool type_extended; - bool cfg_present; }; /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index bdd02e5..126ce17 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -151,6 +151,32 @@ /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; uint8_t *old_tail; + bool type_extended; + + /* Note: Extended codec types are codec types that require 8 instead + * of 4 bit to fully specify the selected codec. In the following, + * we check if we work with an extended type or not. We also check + * if the codec type is valid at all. */ + switch(sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_FR3: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR1: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR4: + case GSM0808_SCT_HR6: + type_extended = false; + break; + case GSM0808_SCT_CSD: + type_extended = true; + break; + default: + /* Invalid codec type specified */ + OSMO_ASSERT(false); + break; + } old_tail = msg->tail; @@ -162,20 +188,37 @@ header |= (1 << 5); if (sc->tf) header |= (1 << 4); - if (sc->type_extended) { + + if (type_extended) { header |= 0x0f; msgb_put_u8(msg, header); + msgb_put_u8(msg, sc->type); } else { OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); - return (uint8_t) (msg->tail - old_tail); } - msgb_put_u8(msg, sc->type); - - if (sc->cfg_present) + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one + * or two octets, depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + default: + OSMO_ASSERT(sc->cfg == 0); + break; + } return (uint8_t) (msg->tail - old_tail); } @@ -244,21 +287,42 @@ if ((header & 0x0F) != 0x0F) { sc->type = (header & 0x0F); - return (int)(elem - old_elem); + } else { + sc->type = *elem; + elem++; + len--; } - sc->type = *elem; - elem++; - len--; - - sc->type_extended = true; - - if (len < 2) - return (int)(elem - old_elem); - - sc->cfg = osmo_load16be(elem); - elem += 2; - sc->cfg_present = true; + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one or + * two octets depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_HR1: + break; + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: + if(len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + default: + /* Invalid codec type => malformed speech codec element! */ + return -EINVAL; + break; + } return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8304052..68771a4 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -49,19 +49,17 @@ scl->codec[0].pi = true; scl->codec[0].tf = true; - scl->codec[0].type = 0xab; - scl->codec[0].type_extended = true; - scl->codec[0].cfg_present = true; + scl->codec[0].type = GSM0808_SCT_FR3; scl->codec[0].cfg = 0xcdef; scl->codec[1].fi = true; scl->codec[1].pt = true; - scl->codec[1].type = 0x05; + scl->codec[1].type = GSM0808_SCT_FR2; scl->codec[2].fi = true; scl->codec[2].tf = true; - scl->codec[2].type = 0xf2; - scl->codec[2].type_extended = true; + scl->codec[2].type = GSM0808_SCT_CSD; + scl->codec[2].cfg = 0xc0; scl->len = 3; } @@ -89,8 +87,9 @@ static const uint8_t res[] = { 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, - 0xa5, 0x9f, 0xf2 + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, + 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg, *in_msg; @@ -282,9 +281,10 @@ static const uint8_t res2[] = { 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, 0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, - 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, - 0xef, 0xa5, 0x9f, 0xf2, GSM0808_IE_CALL_ID, 0xaa, 0xbb, 0xcc, - 0xdd }; + 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, + GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb, + 0xcc, 0xdd }; struct msgb *msg; struct gsm0808_channel_type ct; @@ -351,9 +351,9 @@ static const uint8_t res[] = { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04, - 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, 0x9a, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, - 0x9f, 0xf2 }; + 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90, + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg; memset(&sin, 0, sizeof(sin)); @@ -367,7 +367,7 @@ memset(&sc, 0, sizeof(sc)); sc.fi = true; sc.tf = true; - sc.type = 0x0a; + sc.type = GSM0808_SCT_HR1; setup_codec_list(&sc_list); @@ -400,11 +400,12 @@ { static const uint8_t res1[] = { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, - 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, + 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; static const uint8_t res2[] = { 0x00, 0x0f, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, - 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; uint8_t rr_res = 2; struct msgb *msg; struct gsm0808_speech_codec_list sc_list; @@ -574,7 +575,7 @@ memset(&enc_sc, 0, sizeof(enc_sc)); enc_sc.fi = true; enc_sc.pt = true; - enc_sc.type = 0x05; + enc_sc.type = GSM0808_SCT_FR2; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); @@ -589,6 +590,31 @@ } +static void test_gsm0808_enc_dec_speech_codec_with_cfg() +{ + struct gsm0808_speech_codec enc_sc; + struct gsm0808_speech_codec dec_sc; + struct msgb *msg; + uint8_t rc_enc; + int rc_dec; + + enc_sc.pi = true; + enc_sc.tf = true; + enc_sc.type = GSM0808_SCT_FR3; + enc_sc.cfg = 0xabcd; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); + OSMO_ASSERT(rc_enc == 5); + + rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + + OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() { struct gsm0808_speech_codec enc_sc; @@ -599,44 +625,15 @@ enc_sc.pi = true; enc_sc.tf = true; - enc_sc.type = 0xab; - enc_sc.type_extended = true; - enc_sc.cfg_present = true; - enc_sc.cfg = 0xcdef; + enc_sc.type = GSM0808_SCT_CSD; + enc_sc.cfg = 0xc0; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 6); + OSMO_ASSERT(rc_enc == 5); rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 4); - - OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); - - msgb_free(msg); -} - -static void test_gsm0808_enc_dec_speech_codec_ext() -{ - struct gsm0808_speech_codec enc_sc; - struct gsm0808_speech_codec dec_sc; - struct msgb *msg; - uint8_t rc_enc; - int rc_dec; - - enc_sc.fi = true; - enc_sc.tf = true; - enc_sc.type = 0xf2; - enc_sc.type_extended = true; - enc_sc.cfg_present = false; - enc_sc.cfg = 0x0000; - - msg = msgb_alloc(1024, "output buffer"); - rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 4); - - rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 2); + OSMO_ASSERT(rc_dec == 3); OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); @@ -655,19 +652,17 @@ enc_scl.codec[0].pi = true; enc_scl.codec[0].tf = true; - enc_scl.codec[0].type = 0xab; - enc_scl.codec[0].type_extended = true; - enc_scl.codec[0].cfg_present = true; + enc_scl.codec[0].type = GSM0808_SCT_FR3; enc_scl.codec[0].cfg = 0xcdef; enc_scl.codec[1].fi = true; enc_scl.codec[1].pt = true; - enc_scl.codec[1].type = 0x05; + enc_scl.codec[1].type = GSM0808_SCT_FR2; enc_scl.codec[2].fi = true; enc_scl.codec[2].tf = true; - enc_scl.codec[2].type = 0xf2; - enc_scl.codec[2].type_extended = true; + enc_scl.codec[2].type = GSM0808_SCT_CSD; + enc_scl.codec[2].cfg = 0xc0; enc_scl.len = 3; @@ -860,8 +855,8 @@ test_enc_dec_aoip_trasp_addr_v4(); test_enc_dec_aoip_trasp_addr_v6(); test_gsm0808_enc_dec_speech_codec(); - test_gsm0808_enc_dec_speech_codec_ext(); test_gsm0808_enc_dec_speech_codec_ext_with_cfg(); + test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_channel_type(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: remove API documentation strings in header file 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/2936 to look at the new patch set (#2). cosmetic: remove API documentation strings in header file Typically we don't place comments with the function declarations in .h files. Not sure why this file has comments for each. The API doc belongs in the .c file as proper doxygen comments, and shouldn't be duplicated in the .h file. In this particular case, doxygen comments are added in the corresponding c file recently. Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad --- M include/osmocom/gsm/gsm0808_utils.h 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/2936/2 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 0c69e31..3e59ab0 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -23,55 +23,31 @@ #include -/* Encode AoIP transport address element */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss); - -/* Decode AoIP transport address element */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec element */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc); - -/* Decode Speech Codec element */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec list */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl); - -/* Decode Speech Codec list */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len); - -/* Encode Channel Type element */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct); - -/* Decode Channel Type element */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len); - -/* Encode Encryption Information element */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei); - -/* Decode Encryption Information element */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len); - -/* Encode Cell Identifier List element */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil); - -/* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); - int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add codec references to Speech Version Indication 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/2937 to look at the new patch set (#2). cosmetic: Add codec references to Speech Version Indication Add the information which GSM Speech codec version coresponds to which bearer capability speech version. Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/2937/2 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 124f8b7..fef23d8 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1620,13 +1620,13 @@ GSM48_BCAP_MT_AUTO_1 = 8, }; -/* GSM 04.08 Bearer Capability: Speech Version Indication */ +/*! \brief GSM 04.08 Bearer Capability: Speech Version Indication */ enum gsm48_bcap_speech_ver { - GSM48_BCAP_SV_FR = 0, - GSM48_BCAP_SV_HR = 1, - GSM48_BCAP_SV_EFR = 2, - GSM48_BCAP_SV_AMR_F = 4, - GSM48_BCAP_SV_AMR_H = 5, + GSM48_BCAP_SV_FR = 0, /*!< GSM FR V1 (GSM FR) */ + GSM48_BCAP_SV_HR = 1, /*!< GSM HR V1 (GSM HR) */ + GSM48_BCAP_SV_EFR = 2, /*!< GSM FR V2 (GSM EFR) */ + GSM48_BCAP_SV_AMR_F = 4, /*!< GSM FR V3 (FR AMR) */ + GSM48_BCAP_SV_AMR_H = 5, /*!< GSM HR V3 (HR_AMR) */ }; #define GSM48_TMSI_LEN 5 -- To view, visit https://gerrit.osmocom.org/2937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add info about corespondig codecs to permitted speech 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/2938 to look at the new patch set (#2). cosmetic: Add info about corespondig codecs to permitted speech The constants in enum gsm0808_permitted_speech are not very expressive. This patch adds a comment which tells to which codec the constand is coresponding. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/2938/2 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5916823 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,15 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/*! \brief GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ + GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0408: update bearer capability speech version 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/2812 to look at the new patch set (#6). gsm0408: update bearer capability speech version 3GPP TS 24.008 specifies two new speech versions for half rate and two new speech modes for full rate. This patch adds the relevant constants to enum gsm48_bcap_speech_ver in gsm_04_08.h Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/2812/6 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index fef23d8..604a5df 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1620,13 +1620,18 @@ GSM48_BCAP_MT_AUTO_1 = 8, }; -/*! \brief GSM 04.08 Bearer Capability: Speech Version Indication */ +/*! \brief GSM 04.08 Bearer Capability: Speech Version Indication + * (See also 3GPP TS 24.008, Table 10.5.103) */ enum gsm48_bcap_speech_ver { GSM48_BCAP_SV_FR = 0, /*!< GSM FR V1 (GSM FR) */ GSM48_BCAP_SV_HR = 1, /*!< GSM HR V1 (GSM HR) */ GSM48_BCAP_SV_EFR = 2, /*!< GSM FR V2 (GSM EFR) */ GSM48_BCAP_SV_AMR_F = 4, /*!< GSM FR V3 (FR AMR) */ GSM48_BCAP_SV_AMR_H = 5, /*!< GSM HR V3 (HR_AMR) */ + GSM48_BCAP_SV_AMR_OFW = 6, /*!< GSM FR V4 (OFR AMR-WB) */ + GSM48_BCAP_SV_AMR_OHW = 7, /*!< GSM HR V4 (OHR AMR-WB) */ + GSM48_BCAP_SV_AMR_FW = 8, /*!< GSM FR V5 (FR AMR-WB) */ + GSM48_BCAP_SV_AMR_OH = 11, /*!< GSM HR V6 (OHR AMR) */ }; #define GSM48_TMSI_LEN 5 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 6 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 Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add default speech codec configuration 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/2829 to look at the new patch set (#4). gsm0808: add default speech codec configuration In an AoIP scenario, the speech codec list field specifies the codecs used in the RTP interface. This patch adds a table with default codec configurations that match the codec configurations that are also used on the air interface. Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/2829/4 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 9e00d23..11347f6 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -449,6 +449,26 @@ uint16_t cfg; }; +/*! \brief Default speech codec configurations: Some codecs specified with + * struct gsm0808_speech_codec, require a configuration (cfg). The following + * default configuration will configure the codec (RTP) to match the + * configuration that is used on the air interface (Um). */ +enum gsm0808_speech_codec_defaults { + /*! Default values for FR_AMR, HR_AMR and OHR_AMR: + * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred + * Configurations for the Adaptive Multi-Rate Codec Types */ + GSM0808_SC_CFG_DEFAULT_FR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_HR_AMR = 0x073f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR = 0xffff, + + /*! Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: + * See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations + * for the Adaptive Multi-Rate - Wideband Codec Types */ + GSM0808_SC_CFG_DEFAULT_FR_AMR_WB = 0x01, + GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB = 0x3f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01, +}; + /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ #define SPEECH_CODEC_MAXLEN 255 struct gsm0808_speech_codec_list { -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... 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/2830 to look at the new patch set (#5). gsm0808: add function to translate perm speech to speech codec type The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/5 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..9057273 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,5 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 126ce17..2d4b15c 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -645,4 +645,41 @@ return (int)(elem - old_elem); } +/*! \brief Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec. + * \param[in] perm_spch to be converted + * \returns GSM speech codec type; negative on error */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) +{ + /*! The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + } + + /* Invalid input */ + return -EINVAL; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9613c4e..ccc5b9a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:27:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:27:21 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() 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/2831 to look at the new patch set (#5). gsm0808: add function gsm0808_extrapolate_speech_codec() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/5 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 9057273..0c69e31 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -73,3 +73,5 @@ const uint8_t *elem, uint8_t len); int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 2d4b15c..eeb9b42 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -682,4 +682,56 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted speech + * parameter (channel type). + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value from where the speech codec is derived from + * (see also: enum gsm0808_speech_codec_type in gsm0808_utils.h) + * \returns zero when successful; negative on error */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codc + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + default: + return -EINVAL; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add speech codec type constants 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/2818 to look at the new patch set (#6). gsm0808: add speech codec type constants The codec type to be set in member type in struct gsm0808_speech_codec has its own coding scheme to reference the used codec types. This patch declares an enum with valid speech codec types. Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/2818/6 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 5916823..7656c38 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -397,9 +397,27 @@ GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_FR4 = 0x41, /*!< OFR AMR-WB */ + GSM0808_PERM_FR5 = 0x42, /*!< FR AMR-WB */ GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ + GSM0808_PERM_HR4 = 0x46, /*!< OHR AMR-WB */ + GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ +}; + +/*! \brief 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ +enum gsm0808_speech_codec_type { + GSM0808_SCT_FR1 = 0x0, /*!< GSM FR */ + GSM0808_SCT_FR2 = 0x2, /*!< GSM EFR */ + GSM0808_SCT_FR3 = 0x3, /*!< FR AMR */ + GSM0808_SCT_FR4 = 0xc, /*!< OFR AMR-WB */ + GSM0808_SCT_FR5 = 0x9, /*!< FR AMR-WB */ + GSM0808_SCT_HR1 = 0x1, /*!< GSM_HR */ + GSM0808_SCT_HR3 = 0x4, /*!< HR_AMR */ + GSM0808_SCT_HR4 = 0xd, /*!< OHR AMR-WB */ + GSM0808_SCT_HR6 = 0xb, /*!< OHR AMR */ + GSM0808_SCT_CSD = 0xfd, /*!< CSData (see also TS 26.103) */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator 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/2820 to look at the new patch set (#5). gsm0808: fix AoIP speech codec element parser/generator The implementation of the parser/generator for the speech codec information element slightly wrong, making it impossible to use it properly. (See also: 3GPP TS 48.008, 3.2.2.103) Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 136 insertions(+), 79 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/2820/5 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 7656c38..9e00d23 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -447,8 +447,6 @@ bool tf; uint8_t type; uint16_t cfg; - bool type_extended; - bool cfg_present; }; /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index bdd02e5..126ce17 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -151,6 +151,32 @@ /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; uint8_t *old_tail; + bool type_extended; + + /* Note: Extended codec types are codec types that require 8 instead + * of 4 bit to fully specify the selected codec. In the following, + * we check if we work with an extended type or not. We also check + * if the codec type is valid at all. */ + switch(sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_FR3: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR1: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR4: + case GSM0808_SCT_HR6: + type_extended = false; + break; + case GSM0808_SCT_CSD: + type_extended = true; + break; + default: + /* Invalid codec type specified */ + OSMO_ASSERT(false); + break; + } old_tail = msg->tail; @@ -162,20 +188,37 @@ header |= (1 << 5); if (sc->tf) header |= (1 << 4); - if (sc->type_extended) { + + if (type_extended) { header |= 0x0f; msgb_put_u8(msg, header); + msgb_put_u8(msg, sc->type); } else { OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); - return (uint8_t) (msg->tail - old_tail); } - msgb_put_u8(msg, sc->type); - - if (sc->cfg_present) + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one + * or two octets, depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + default: + OSMO_ASSERT(sc->cfg == 0); + break; + } return (uint8_t) (msg->tail - old_tail); } @@ -244,21 +287,42 @@ if ((header & 0x0F) != 0x0F) { sc->type = (header & 0x0F); - return (int)(elem - old_elem); + } else { + sc->type = *elem; + elem++; + len--; } - sc->type = *elem; - elem++; - len--; - - sc->type_extended = true; - - if (len < 2) - return (int)(elem - old_elem); - - sc->cfg = osmo_load16be(elem); - elem += 2; - sc->cfg_present = true; + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one or + * two octets depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_HR1: + break; + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + if(len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: + if(len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + default: + /* Invalid codec type => malformed speech codec element! */ + return -EINVAL; + break; + } return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8304052..68771a4 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -49,19 +49,17 @@ scl->codec[0].pi = true; scl->codec[0].tf = true; - scl->codec[0].type = 0xab; - scl->codec[0].type_extended = true; - scl->codec[0].cfg_present = true; + scl->codec[0].type = GSM0808_SCT_FR3; scl->codec[0].cfg = 0xcdef; scl->codec[1].fi = true; scl->codec[1].pt = true; - scl->codec[1].type = 0x05; + scl->codec[1].type = GSM0808_SCT_FR2; scl->codec[2].fi = true; scl->codec[2].tf = true; - scl->codec[2].type = 0xf2; - scl->codec[2].type_extended = true; + scl->codec[2].type = GSM0808_SCT_CSD; + scl->codec[2].cfg = 0xc0; scl->len = 3; } @@ -89,8 +87,9 @@ static const uint8_t res[] = { 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, - 0xa5, 0x9f, 0xf2 + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, + 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg, *in_msg; @@ -282,9 +281,10 @@ static const uint8_t res2[] = { 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, 0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, - 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, - 0xef, 0xa5, 0x9f, 0xf2, GSM0808_IE_CALL_ID, 0xaa, 0xbb, 0xcc, - 0xdd }; + 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, + GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb, + 0xcc, 0xdd }; struct msgb *msg; struct gsm0808_channel_type ct; @@ -351,9 +351,9 @@ static const uint8_t res[] = { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04, - 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, 0x9a, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, - 0x9f, 0xf2 }; + 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90, + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg; memset(&sin, 0, sizeof(sin)); @@ -367,7 +367,7 @@ memset(&sc, 0, sizeof(sc)); sc.fi = true; sc.tf = true; - sc.type = 0x0a; + sc.type = GSM0808_SCT_HR1; setup_codec_list(&sc_list); @@ -400,11 +400,12 @@ { static const uint8_t res1[] = { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, - 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, + 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; static const uint8_t res2[] = { 0x00, 0x0f, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, - 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; uint8_t rr_res = 2; struct msgb *msg; struct gsm0808_speech_codec_list sc_list; @@ -574,7 +575,7 @@ memset(&enc_sc, 0, sizeof(enc_sc)); enc_sc.fi = true; enc_sc.pt = true; - enc_sc.type = 0x05; + enc_sc.type = GSM0808_SCT_FR2; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); @@ -589,6 +590,31 @@ } +static void test_gsm0808_enc_dec_speech_codec_with_cfg() +{ + struct gsm0808_speech_codec enc_sc; + struct gsm0808_speech_codec dec_sc; + struct msgb *msg; + uint8_t rc_enc; + int rc_dec; + + enc_sc.pi = true; + enc_sc.tf = true; + enc_sc.type = GSM0808_SCT_FR3; + enc_sc.cfg = 0xabcd; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); + OSMO_ASSERT(rc_enc == 5); + + rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + + OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() { struct gsm0808_speech_codec enc_sc; @@ -599,44 +625,15 @@ enc_sc.pi = true; enc_sc.tf = true; - enc_sc.type = 0xab; - enc_sc.type_extended = true; - enc_sc.cfg_present = true; - enc_sc.cfg = 0xcdef; + enc_sc.type = GSM0808_SCT_CSD; + enc_sc.cfg = 0xc0; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 6); + OSMO_ASSERT(rc_enc == 5); rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 4); - - OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); - - msgb_free(msg); -} - -static void test_gsm0808_enc_dec_speech_codec_ext() -{ - struct gsm0808_speech_codec enc_sc; - struct gsm0808_speech_codec dec_sc; - struct msgb *msg; - uint8_t rc_enc; - int rc_dec; - - enc_sc.fi = true; - enc_sc.tf = true; - enc_sc.type = 0xf2; - enc_sc.type_extended = true; - enc_sc.cfg_present = false; - enc_sc.cfg = 0x0000; - - msg = msgb_alloc(1024, "output buffer"); - rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 4); - - rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 2); + OSMO_ASSERT(rc_dec == 3); OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); @@ -655,19 +652,17 @@ enc_scl.codec[0].pi = true; enc_scl.codec[0].tf = true; - enc_scl.codec[0].type = 0xab; - enc_scl.codec[0].type_extended = true; - enc_scl.codec[0].cfg_present = true; + enc_scl.codec[0].type = GSM0808_SCT_FR3; enc_scl.codec[0].cfg = 0xcdef; enc_scl.codec[1].fi = true; enc_scl.codec[1].pt = true; - enc_scl.codec[1].type = 0x05; + enc_scl.codec[1].type = GSM0808_SCT_FR2; enc_scl.codec[2].fi = true; enc_scl.codec[2].tf = true; - enc_scl.codec[2].type = 0xf2; - enc_scl.codec[2].type_extended = true; + enc_scl.codec[2].type = GSM0808_SCT_CSD; + enc_scl.codec[2].cfg = 0xc0; enc_scl.len = 3; @@ -860,8 +855,8 @@ test_enc_dec_aoip_trasp_addr_v4(); test_enc_dec_aoip_trasp_addr_v6(); test_gsm0808_enc_dec_speech_codec(); - test_gsm0808_enc_dec_speech_codec_ext(); test_gsm0808_enc_dec_speech_codec_ext_with_cfg(); + test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_channel_type(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: remove API documentation strings in header file 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/2936 to look at the new patch set (#3). cosmetic: remove API documentation strings in header file Typically we don't place comments with the function declarations in .h files. Not sure why this file has comments for each. The API doc belongs in the .c file as proper doxygen comments, and shouldn't be duplicated in the .h file. In this particular case, doxygen comments are added in the corresponding c file recently. Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad --- M include/osmocom/gsm/gsm0808_utils.h 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/2936/3 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 0c69e31..3e59ab0 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -23,55 +23,31 @@ #include -/* Encode AoIP transport address element */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss); - -/* Decode AoIP transport address element */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec element */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc); - -/* Decode Speech Codec element */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec list */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl); - -/* Decode Speech Codec list */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len); - -/* Encode Channel Type element */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct); - -/* Decode Channel Type element */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len); - -/* Encode Encryption Information element */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei); - -/* Decode Encryption Information element */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len); - -/* Encode Cell Identifier List element */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil); - -/* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); - int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add info about corespondig codecs to permitted speech 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/2938 to look at the new patch set (#3). cosmetic: Add info about corespondig codecs to permitted speech The constants in enum gsm0808_permitted_speech are not very expressive. This patch adds a comment which tells to which codec the constant is coresponding to. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/2938/3 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5916823 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,15 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/*! \brief GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ + GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add default speech codec configuration 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/2829 to look at the new patch set (#5). gsm0808: add default speech codec configuration In an AoIP scenario, the speech codec list field specifies the codecs used in the RTP interface. This patch adds a table with default codec configurations that match the codec configurations that are also used on the air interface. Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/2829/5 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 9e00d23..11347f6 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -449,6 +449,26 @@ uint16_t cfg; }; +/*! \brief Default speech codec configurations: Some codecs specified with + * struct gsm0808_speech_codec, require a configuration (cfg). The following + * default configuration will configure the codec (RTP) to match the + * configuration that is used on the air interface (Um). */ +enum gsm0808_speech_codec_defaults { + /*! Default values for FR_AMR, HR_AMR and OHR_AMR: + * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred + * Configurations for the Adaptive Multi-Rate Codec Types */ + GSM0808_SC_CFG_DEFAULT_FR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_HR_AMR = 0x073f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR = 0xffff, + + /*! Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: + * See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations + * for the Adaptive Multi-Rate - Wideband Codec Types */ + GSM0808_SC_CFG_DEFAULT_FR_AMR_WB = 0x01, + GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB = 0x3f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01, +}; + /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ #define SPEECH_CODEC_MAXLEN 255 struct gsm0808_speech_codec_list { -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... 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/2830 to look at the new patch set (#6). gsm0808: add function to translate perm speech to speech codec type The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/6 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..9057273 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,5 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 126ce17..2d4b15c 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -645,4 +645,41 @@ return (int)(elem - old_elem); } +/*! \brief Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec. + * \param[in] perm_spch to be converted + * \returns GSM speech codec type; negative on error */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) +{ + /*! The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + } + + /* Invalid input */ + return -EINVAL; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9613c4e..ccc5b9a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:29:39 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:29:39 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() 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/2831 to look at the new patch set (#6). gsm0808: add function gsm0808_extrapolate_speech_codec() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/6 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 9057273..0c69e31 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -73,3 +73,5 @@ const uint8_t *elem, uint8_t len); int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 2d4b15c..eeb9b42 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -682,4 +682,56 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted speech + * parameter (channel type). + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value from where the speech codec is derived from + * (see also: enum gsm0808_speech_codec_type in gsm0808_utils.h) + * \returns zero when successful; negative on error */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codc + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + default: + return -EINVAL; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:35:22 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:35:22 +0000 Subject: [MERGED] libosmocore[master]: core/conv/conv_acc.c: use static allocation for trellis In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: core/conv/conv_acc.c: use static allocation for trellis ...................................................................... core/conv/conv_acc.c: use static allocation for trellis Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The trellis struct wasn't require dynamic allocation itself, so let's allocate one statically inside the vdecoder structure. Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 --- M src/conv_acc.c 1 file changed, 23 insertions(+), 27 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/conv_acc.c b/src/conv_acc.c index f45d50f..13b220b 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -164,7 +164,7 @@ int len; int recursive; int intrvl; - struct vtrellis *trellis; + struct vtrellis trellis; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, @@ -372,41 +372,38 @@ vdec_free(trellis->outputs); vdec_free(trellis->sums); free(trellis->vals); - free(trellis); } -/* Allocate and initialize the trellis object +/* Initialize the trellis object * Initialization consists of generating the outputs and output value of a * given state. Due to trellis symmetry and anti-symmetry, only one of the * transition paths is utilized by the butterfly operation in the forward * recursion, so only one set of N outputs is required per state variable. */ -static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +static int generate_trellis(struct vdecoder *dec, + const struct osmo_conv_code *code) { - int i, rc = -1; - struct vtrellis *trellis; + struct vtrellis *trellis = &dec->trellis; int16_t *outputs; + int i, rc; int ns = NUM_STATES(code->K); - int recursive = conv_code_recursive(code); int olen = (code->N == 2) ? 2 : 4; - - trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); - if (!trellis) - goto fail; trellis->num_states = ns; trellis->sums = vdec_malloc(ns); trellis->outputs = vdec_malloc(ns * olen); trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); - if (!trellis->sums || !trellis->outputs || !trellis->vals) + if (!trellis->sums || !trellis->outputs || !trellis->vals) { + rc = -ENOMEM; goto fail; + } /* Populate the trellis state objects */ for (i = 0; i < ns; i++) { outputs = &trellis->outputs[olen * i]; - if (recursive) { + if (dec->recursive) { rc = gen_recursive_state_info(&trellis->vals[i], i, outputs, code); } else { @@ -429,11 +426,11 @@ if (code->term != CONV_TERM_TAIL_BITING) trellis->sums[0] = INT8_MAX * code->N * code->K; - return trellis; + return 0; fail: free_trellis(trellis); - return NULL; + return rc; } static void _traceback(struct vdecoder *dec, @@ -444,7 +441,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = dec->trellis->vals[state]; + out[i] = dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -457,7 +454,7 @@ for (i = len - 1; i >= 0; i--) { path = dec->paths[i][state] + 1; - out[i] = path ^ dec->trellis->vals[state]; + out[i] = path ^ dec->trellis.vals[state]; state = vstate_lshift(state, dec->k, path); } } @@ -472,8 +469,8 @@ unsigned path, state = 0; if (term != CONV_TERM_FLUSH) { - for (i = 0; i < dec->trellis->num_states; i++) { - sum = dec->trellis->sums[i]; + for (i = 0; i < dec->trellis.num_states; i++) { + sum = dec->trellis.sums[i]; if (sum > max) { max = sum; state = i; @@ -503,7 +500,7 @@ if (!dec) return; - free_trellis(dec->trellis); + free_trellis(&dec->trellis); if (dec->paths != NULL) { vdec_free(dec->paths[0]); @@ -517,7 +514,7 @@ */ static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { - int i, ns; + int i, ns, rc; ns = NUM_STATES(code->K); @@ -563,9 +560,9 @@ else dec->len = code->len; - dec->trellis = generate_trellis(code); - if (!dec->trellis) - goto enomem; + rc = generate_trellis(dec, code); + if (rc) + return rc; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) @@ -610,13 +607,12 @@ */ static void forward_traverse(struct vdecoder *dec, const int8_t *seq) { - struct vtrellis *trellis = dec->trellis; int i; for (i = 0; i < dec->len; i++) { dec->metric_func(&seq[dec->n * i], - trellis->outputs, - trellis->sums, + dec->trellis.outputs, + dec->trellis.sums, dec->paths[i], !(i % dec->intrvl)); } -- To view, visit https://gerrit.osmocom.org/2969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:35:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:35:23 +0000 Subject: [MERGED] libosmocore[master]: core/conv/conv_acc.c: use static allocation for vdecoder In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: core/conv/conv_acc.c: use static allocation for vdecoder ...................................................................... core/conv/conv_acc.c: use static allocation for vdecoder Allocation of a new memory is an expensive operation, which takes place when it's initially unknown, how much memory will we need, or in order to decrease total memory usage. The vdecoder struct wasn't require dynamic allocation itself, so let's use static allocation in order to increase performance. Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab --- M src/conv_acc.c 1 file changed, 19 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/conv_acc.c b/src/conv_acc.c index 7f03628..f45d50f 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -498,7 +498,7 @@ } /* Release decoder object */ -static void free_vdec(struct vdecoder *dec) +static void vdec_deinit(struct vdecoder *dec) { if (!dec) return; @@ -509,22 +509,18 @@ vdec_free(dec->paths[0]); free(dec->paths); } - - free(dec); } -/* Allocate decoder object +/* Initialize decoder object with code specific params * Subtract the constraint length K on the normalization interval to * accommodate the initialization path metric at state zero. */ -static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code) { int i, ns; - struct vdecoder *dec; ns = NUM_STATES(code->K); - dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); dec->n = code->N; dec->k = code->K; dec->recursive = conv_code_recursive(code); @@ -542,7 +538,7 @@ dec->metric_func = osmo_conv_metrics_k5_n4; break; default: - goto fail; + return -EINVAL; } } else if (dec->k == 7) { switch (dec->n) { @@ -556,10 +552,10 @@ dec->metric_func = osmo_conv_metrics_k7_n4; break; default: - goto fail; + return -EINVAL; } } else { - goto fail; + return -EINVAL; } if (code->term == CONV_TERM_FLUSH) @@ -569,24 +565,24 @@ dec->trellis = generate_trellis(code); if (!dec->trellis) - goto fail; + goto enomem; dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); if (!dec->paths) - goto fail; + goto enomem; dec->paths[0] = vdec_malloc(ns * dec->len); if (!dec->paths[0]) - goto fail; + goto enomem; for (i = 1; i < dec->len; i++) dec->paths[i] = &dec->paths[0][i * ns]; - return dec; + return 0; -fail: - free_vdec(dec); - return NULL; +enomem: + vdec_deinit(dec); + return -ENOMEM; } /* Depuncture sequence with nagative value terminated puncturing matrix */ @@ -697,7 +693,7 @@ const sbit_t *input, ubit_t *output) { int rc; - struct vdecoder *vdec; + struct vdecoder dec; if (!init_complete) osmo_conv_init(); @@ -706,14 +702,14 @@ ((code->K != 5) && (code->K != 7))) return -EINVAL; - vdec = alloc_vdec(code); - if (!vdec) - return -EFAULT; + rc = vdec_init(&dec, code); + if (rc) + return rc; - rc = conv_decode(vdec, input, code->puncture, + rc = conv_decode(&dec, input, code->puncture, output, code->len, code->term); - free_vdec(vdec); + vdec_deinit(&dec); return rc; } -- To view, visit https://gerrit.osmocom.org/2968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:35:23 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:35:23 +0000 Subject: [MERGED] libosmocore[master]: core/conv/conv_acc.c: delete reset_decoder() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: core/conv/conv_acc.c: delete reset_decoder() ...................................................................... core/conv/conv_acc.c: delete reset_decoder() Currently this implementation exposes nothing than osmo_conv_decode_acc(), so it wasn't possible to call reset_decoder() from outside. The method itself was used to initialize accumulated path metrics and the starting state of encoder. Now this code is moved to generate_trellis(). Moreover, setting accumulated path metrics inside existing loop is a bit faster that calling memset(). Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 --- M src/conv_acc.c 1 file changed, 13 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/conv_acc.c b/src/conv_acc.c index c4545d7..7f03628 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -413,32 +413,27 @@ rc = gen_state_info(&trellis->vals[i], i, outputs, code); } + + if (rc < 0) + goto fail; + + /* Set accumulated path metrics to zero */ + trellis->sums[i] = 0; } - if (rc < 0) - goto fail; + /** + * For termination other than tail-biting, initialize the zero state + * as the encoder starting state. Initialize with the maximum + * accumulated sum at length equal to the constraint length. + */ + if (code->term != CONV_TERM_TAIL_BITING) + trellis->sums[0] = INT8_MAX * code->N * code->K; return trellis; fail: free_trellis(trellis); return NULL; -} - -/* Reset decoder - * Set accumulated path metrics to zero. For termination other than - * tail-biting, initialize the zero state as the encoder starting state. - * Initialize with the maximum accumulated sum at length equal to the - * constraint length. - */ -static void reset_decoder(struct vdecoder *dec, int term) -{ - int ns = dec->trellis->num_states; - - memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); - - if (term != CONV_TERM_TAIL_BITING) - dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; } static void _traceback(struct vdecoder *dec, @@ -640,8 +635,6 @@ const int *punc, uint8_t *out, int len, int term) { int8_t depunc[dec->len * dec->n]; - - reset_decoder(dec, term); if (punc) { depuncture(seq, punc, depunc, dec->len * dec->n); -- To view, visit https://gerrit.osmocom.org/2967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:35:24 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:35:24 +0000 Subject: [MERGED] libosmocore[master]: core/conv/conv_acc.c: drop unused structure member In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: core/conv/conv_acc.c: drop unused structure member ...................................................................... core/conv/conv_acc.c: drop unused structure member Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b --- M src/conv_acc.c 1 file changed, 0 insertions(+), 2 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/conv_acc.c b/src/conv_acc.c index a3e3f16..c4545d7 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -156,7 +156,6 @@ * recursive - Set to '1' if the code is recursive * intrvl - Normalization interval * trellis - Trellis object - * punc - Puncturing sequence * paths - Trellis paths */ struct vdecoder { @@ -166,7 +165,6 @@ int recursive; int intrvl; struct vtrellis *trellis; - int *punc; int16_t **paths; void (*metric_func)(const int8_t *, const int16_t *, -- To view, visit https://gerrit.osmocom.org/2966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:35:25 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:35:25 +0000 Subject: [MERGED] libosmocore[master]: core/conv: update description headers for conv_acc_* In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: core/conv: update description headers for conv_acc_* ...................................................................... core/conv: update description headers for conv_acc_* Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458 --- M src/conv_acc.c M src/conv_acc_generic.c M src/conv_acc_sse.c M src/conv_acc_sse_avx.c M src/conv_acc_sse_impl.h 5 files changed, 10 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/conv_acc.c b/src/conv_acc.c index 308cfe0..a3e3f16 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -1,5 +1,5 @@ /* - * Viterbi decoder + * Accelerated Viterbi decoder implementation * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_generic.c b/src/conv_acc_generic.c index 6042668..a4787e3 100644 --- a/src/conv_acc_generic.c +++ b/src/conv_acc_generic.c @@ -1,5 +1,6 @@ /* - * Viterbi decoder + * Accelerated Viterbi decoder implementation + * for generic architectures without SSE support * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_sse.c b/src/conv_acc_sse.c index 9cbcc2f..bcc9d48 100644 --- a/src/conv_acc_sse.c +++ b/src/conv_acc_sse.c @@ -1,5 +1,6 @@ /* - * Intel SSE Viterbi decoder + * Accelerated Viterbi decoder implementation + * for architectures with only SSE3 available * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_sse_avx.c b/src/conv_acc_sse_avx.c index 5d9a82b..2ad353a 100644 --- a/src/conv_acc_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -1,5 +1,6 @@ /* - * Intel SSE + AVX Viterbi decoder + * Accelerated Viterbi decoder implementation + * for architectures with both SSE3 and AVX2 support * * Copyright (C) 2013, 2014 Thomas Tsou * diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index 7d48c94..a62f910 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -1,5 +1,7 @@ /* - * Intel SSE Viterbi decoder + * Accelerated Viterbi decoder implementation + * Actual definitions which are being included + * from both conv_acc_sse.c and conv_acc_sse_avx.c * * Copyright (C) 2013, 2014 Thomas Tsou * -- To view, visit https://gerrit.osmocom.org/2973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:35:25 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:35:25 +0000 Subject: [MERGED] libosmocore[master]: core/conv: use proper filenames In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: core/conv: use proper filenames ...................................................................... core/conv: use proper filenames We already have generic convolutional transcoding implementation written by Sylvain Munaut and named 'conv.c', so 'viterbi_*' names looked a bit confusing. Let's use a single naming scheme for Viterbi related code. Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 --- M src/Makefile.am R src/conv_acc.c R src/conv_acc_generic.c R src/conv_acc_sse.c R src/conv_acc_sse_avx.c R src/conv_acc_sse_impl.h 6 files changed, 10 insertions(+), 10 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/Makefile.am b/src/Makefile.am index e98c623..692b699 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,28 +21,28 @@ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ - viterbi.c viterbi_generic.c sercomm.c + conv_acc.c conv_acc_generic.c sercomm.c if HAVE_SSE3 -libosmocore_la_SOURCES += viterbi_sse.c +libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -viterbi_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 else -viterbi_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : CFLAGS += -msse3 endif if HAVE_AVX2 -libosmocore_la_SOURCES += viterbi_sse_avx.c +libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 else -viterbi_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 endif endif endif BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c -EXTRA_DIST = viterbi_sse_common.h +EXTRA_DIST = conv_acc_sse_impl.h if ENABLE_PLUGIN libosmocore_la_SOURCES += plugin.c diff --git a/src/viterbi.c b/src/conv_acc.c similarity index 100% rename from src/viterbi.c rename to src/conv_acc.c diff --git a/src/viterbi_generic.c b/src/conv_acc_generic.c similarity index 100% rename from src/viterbi_generic.c rename to src/conv_acc_generic.c diff --git a/src/viterbi_sse.c b/src/conv_acc_sse.c similarity index 98% rename from src/viterbi_sse.c rename to src/conv_acc_sse.c index f389085..9cbcc2f 100644 --- a/src/viterbi_sse.c +++ b/src/conv_acc_sse.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_avx.c b/src/conv_acc_sse_avx.c similarity index 98% rename from src/viterbi_sse_avx.c rename to src/conv_acc_sse_avx.c index b4c45a6..5d9a82b 100644 --- a/src/viterbi_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -55,7 +55,7 @@ /** * Include common SSE implementation */ -#include +#include /* Aligned Memory Allocator * SSE requires 16-byte memory alignment. We store relevant trellis values diff --git a/src/viterbi_sse_common.h b/src/conv_acc_sse_impl.h similarity index 100% rename from src/viterbi_sse_common.h rename to src/conv_acc_sse_impl.h -- To view, visit https://gerrit.osmocom.org/2972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:37:15 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 14:37:15 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#5). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 549 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/5 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..17d5009 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,6 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr +*osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..40431e4 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,502 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry * +addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr +*osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if(entry) + return &entry->addr; + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + strcpy(entry->name,name); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + memset(&entry->addr.gt, 0, sizeof(entry->addr.gt)); + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-127>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + strcpy(entry->addr.gt.digits, argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1441,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1453,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1477,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1501,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1575,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp 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 Jun 19 14:45:28 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:45:28 +0000 Subject: [PATCH] libosmocore[master]: core/conv/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2975 to look at the new patch set (#2). core/conv/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS This allows passing 'make CFLAGS+="..."' without breaking the build. Suggested-by: zecke Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b --- M src/Makefile.am 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/2975/2 diff --git a/src/Makefile.am b/src/Makefile.am index 692b699..d8fceca 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,17 +26,17 @@ if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : AM_CFLAGS += -msse3 -msse4.1 else -conv_acc_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : AM_CFLAGS += -msse3 endif if HAVE_AVX2 libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 -msse4.1 else -conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 endif endif endif -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:46:59 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 14:46:59 +0000 Subject: [PATCH] libosmocore[master]: src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2975 to look at the new patch set (#3). src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS This allows passing 'make CFLAGS+="..."' without breaking the build. Suggested-by: zecke Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b --- M src/Makefile.am 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/2975/3 diff --git a/src/Makefile.am b/src/Makefile.am index 692b699..d8fceca 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,17 +26,17 @@ if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : AM_CFLAGS += -msse3 -msse4.1 else -conv_acc_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : AM_CFLAGS += -msse3 endif if HAVE_AVX2 libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 -msse4.1 else -conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 endif endif endif -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 14:56:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 14:56:16 +0000 Subject: libosmocore[master]: cosmetic: Add codec references to Speech Version Indication In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Jun 19 14:56:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 14:56:47 +0000 Subject: libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 6 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 Mon Jun 19 14:58:23 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 19 Jun 2017 14:58:23 +0000 Subject: libosmocore[master]: src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 15:01:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 15:01:59 +0000 Subject: libosmocore[master]: cosmetic: remove API documentation strings in header file In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 yes, gsm0808_utils.c has complete api docs -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 3 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 Mon Jun 19 15:10:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 15:10:05 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add info about coresponding codecs to permitted sp... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2938 to look at the new patch set (#4). cosmetic: Add info about coresponding codecs to permitted speech consts The constants in enum gsm0808_permitted_speech are not very expressive. Add comments indicating each constant's corresponding codec. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/2938/4 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5916823 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,15 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/*! \brief GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ + GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 15:10:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 15:10:40 +0000 Subject: libosmocore[master]: cosmetic: Add info about coresponding codecs to permitted sp... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Jun 19 15:24:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 19 Jun 2017 15:24:57 +0000 Subject: [PATCH] openbsc[master]: Fix BTS features length check 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/2900 to look at the new patch set (#2). Fix BTS features length check While fixing potentially incorrect memory access, the check for maximum number of supported BTS features was incorrectly adjusted instead of feature vectore length check next to it. Fix this by adjusting checks properly and adding comments to avoid future confusion. The error was introduced in a60bb3dd28ce9e3720f8ee1b262893f3e233e2e6. Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/2900/2 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 1715688..019d039 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -484,13 +484,13 @@ if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_ID, 2)) { m_id_len = TLVP_LEN(&tp, NM_ATT_MANUF_ID); - if (m_id_len > MAX_BTS_FEATURES/8 + 1) { + /* log potential BTS feature vector overflow */ + if (m_id_len > sizeof(bts->_features_data)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n", bts->nr, MAX_BTS_FEATURES/8); - m_id_len = MAX_BTS_FEATURES/8; - } - if (m_id_len > sizeof(bts->_features_data)) + /* check that max. expected BTS attribute is above given feature vector length */ + if (m_id_len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " "feature vector - most likely it was compiled against newer BSC headers. " "Consider upgrading your BSC to later version.\n", -- To view, visit https://gerrit.osmocom.org/2900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 15:28:17 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 19 Jun 2017 15:28:17 +0000 Subject: osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Patch Set 2: > I think this is something that we can only do in close coordination > with Nutaq, i.e. if they had some specific reason to not use the > real path but rather go via the symlink. Minh, can you comment on > that? We had issue when using real path to /sys/devices/... when upgrading yocto Linux kernel. Thus, we decided to create an abstract path named /var/lc15/... to right system devices via symbolic links. Using this method we will only need to change the system devices remap script rather changing BTS source code. -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 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-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 16:06:38 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 16:06:38 +0000 Subject: [MERGED] libosmocore[master]: src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS ...................................................................... src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS This allows passing 'make CFLAGS+="..."' without breaking the build. Suggested-by: zecke Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b --- M src/Makefile.am 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/Makefile.am b/src/Makefile.am index 692b699..d8fceca 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,17 +26,17 @@ if HAVE_SSE3 libosmocore_la_SOURCES += conv_acc_sse.c if HAVE_SSE4_1 -conv_acc_sse.lo : CFLAGS += -msse3 -msse4.1 +conv_acc_sse.lo : AM_CFLAGS += -msse3 -msse4.1 else -conv_acc_sse.lo : CFLAGS += -msse3 +conv_acc_sse.lo : AM_CFLAGS += -msse3 endif if HAVE_AVX2 libosmocore_la_SOURCES += conv_acc_sse_avx.c if HAVE_SSE4_1 -conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 -msse4.1 +conv_acc_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 -msse4.1 else -conv_acc_sse_avx.lo : CFLAGS += -msse3 -mavx2 +conv_acc_sse_avx.lo : AM_CFLAGS += -msse3 -mavx2 endif endif endif -- To view, visit https://gerrit.osmocom.org/2975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 16:20:43 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 19 Jun 2017 16:20:43 +0000 Subject: [PATCH] libosmocore[master]: gitignore some tests Message-ID: Review at https://gerrit.osmocom.org/2976 gitignore some tests For some reasons, the following test executables were not listed in .gitignore: - tests/conv/conv_gsm0503_test - tests/endian/endian_test - tests/sercomm/sercomm_test Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 --- M .gitignore 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/2976/1 diff --git a/.gitignore b/.gitignore index 89459f0..0702c4d 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ tests/auth/milenage_test tests/coding/coding_test tests/conv/conv_test +tests/conv/conv_gsm0503_test tests/lapd/lapd_test tests/gsm0808/gsm0808_test tests/gb/bssgp_fc_test @@ -103,6 +104,8 @@ tests/write_queue/wqueue_test tests/oap/oap_test tests/socket/socket_test +tests/endian/endian_test +tests/sercomm/sercomm_test utils/osmo-arfcn utils/osmo-auc-gen -- To view, visit https://gerrit.osmocom.org/2976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jun 19 16:25:56 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 16:25:56 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add info about corespondig codecs to permitted speech 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/2938 to look at the new patch set (#5). cosmetic: Add info about corespondig codecs to permitted speech The constants in enum gsm0808_permitted_speech are not very expressive. This patch adds a comment which tells to which codec the constant is coresponding to. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/2938/5 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5916823 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,15 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/*! \brief GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ + GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 16:25:56 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 19 Jun 2017 16:25:56 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() 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/2831 to look at the new patch set (#7). gsm0808: add function gsm0808_extrapolate_speech_codec() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 53 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/7 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 9057273..0c69e31 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -73,3 +73,5 @@ const uint8_t *elem, uint8_t len); int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 2d4b15c..d27ca5b 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -682,4 +682,54 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted speech + * parameter (channel type). + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value from where the speech codec is derived from + * (see also: enum gsm0808_speech_codec_type in gsm0808_utils.h) + * \returns zero when successful; negative on error */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codc + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:02:37 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 19 Jun 2017 17:02:37 +0000 Subject: osmo-trx[master]: common: Declare explicit Vector move constructor In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:02:42 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 19 Jun 2017 17:02:42 +0000 Subject: [MERGED] osmo-trx[master]: common: Declare explicit Vector move constructor In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: common: Declare explicit Vector move constructor ...................................................................... common: Declare explicit Vector move constructor Vector class already has a semantically odd non-const copy constructor that serves the same function as a C++11 move constructor. Make the move constructor semantics explicit and address Coverity at the same time. Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Fixes: Coverity CID 170738 --- M CommonLibs/Vector.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/CommonLibs/Vector.h b/CommonLibs/Vector.h index eae674b..15d6710 100644 --- a/CommonLibs/Vector.h +++ b/CommonLibs/Vector.h @@ -118,8 +118,8 @@ /** Build an empty Vector of a given size. */ Vector(size_t wSize=0):mData(NULL) { resize(wSize); } - /** Build a Vector by shifting the data block. */ - Vector(Vector& other) + /** Build a Vector by moving another. */ + Vector(Vector&& other) :mData(other.mData),mStart(other.mStart),mEnd(other.mEnd) { other.mData=NULL; } -- To view, visit https://gerrit.osmocom.org/2939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:03:10 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 19 Jun 2017 17:03:10 +0000 Subject: osmo-trx[master]: sigProcLib: Remove trigonometric tables In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I45bba5daf8610cbba6af95b92c2142f2256491ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:03:11 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 19 Jun 2017 17:03:11 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Remove trigonometric tables In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Remove trigonometric tables ...................................................................... sigProcLib: Remove trigonometric tables Trigonometric sin/cos tables are unused after initialization. There is no benefit to implementing lookup tables for run-once operations. Also perform initial calculations in double width because there is no penalty for doing so. Change-Id: I45bba5daf8610cbba6af95b92c2142f2256491ff --- M Transceiver52M/sigProcLib.cpp 1 file changed, 8 insertions(+), 36 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index a72ec43..c776501 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -46,14 +46,10 @@ #define CLIP_THRESH 30000.0f /** Lookup tables for trigonometric approximation */ -static float cosTable[TABLESIZE+1]; // add 1 element for wrap around -static float sinTable[TABLESIZE+1]; -static float sincTable[TABLESIZE+1]; +static float sincTable[TABLESIZE+1]; // add 1 element for wrap around /** Constants */ static const float M_PI_F = (float)M_PI; -static const float M_2PI_F = (float)(2.0*M_PI); -static const float M_1_2PI_F = 1/M_2PI_F; /* Precomputed rotation vectors */ static signalVector *GMSKRotation4 = NULL; @@ -182,29 +178,6 @@ return Energy; } -/** compute e^(-jx) via lookup table. */ -static complex expjLookup(float x) -{ - float arg = x*M_1_2PI_F; - while (arg > 1.0F) arg -= 1.0F; - while (arg < 0.0F) arg += 1.0F; - - const float argT = arg*((float)TABLESIZE); - const int argI = (int)argT; - const float delta = argT-argI; - const float iDelta = 1.0F-delta; - return complex(iDelta*cosTable[argI] + delta*cosTable[argI+1], - iDelta*sinTable[argI] + delta*sinTable[argI+1]); -} - -/** Library setup functions */ -static void initTrigTables() { - for (int i = 0; i < TABLESIZE+1; i++) { - cosTable[i] = cos(2.0*M_PI*i/TABLESIZE); - sinTable[i] = sin(2.0*M_PI*i/TABLESIZE); - } -} - /* * Initialize 4 sps and 1 sps rotation tables */ @@ -216,11 +189,11 @@ GMSKReverseRotation4 = new signalVector(len4); signalVector::iterator rotPtr = GMSKRotation4->begin(); signalVector::iterator revPtr = GMSKReverseRotation4->begin(); - float phase = 0.0; + auto phase = 0.0; while (rotPtr != GMSKRotation4->end()) { - *rotPtr++ = expjLookup(phase); - *revPtr++ = expjLookup(-phase); - phase += M_PI_F / 2.0F / 4.0; + *rotPtr++ = complex(cos(phase), sin(phase)); + *revPtr++ = complex(cos(-phase), sin(-phase)); + phase += M_PI / 2.0 / 4.0; } GMSKRotation1 = new signalVector(len1); @@ -229,9 +202,9 @@ revPtr = GMSKReverseRotation1->begin(); phase = 0.0; while (rotPtr != GMSKRotation1->end()) { - *rotPtr++ = expjLookup(phase); - *revPtr++ = expjLookup(-phase); - phase += M_PI_F / 2.0F; + *rotPtr++ = complex(cos(phase), sin(phase)); + *revPtr++ = complex(cos(-phase), sin(-phase)); + phase += M_PI / 2.0; } } @@ -1887,7 +1860,6 @@ bool sigProcLibSetup() { - initTrigTables(); generateSincTable(); initGMSKRotationTables(); -- To view, visit https://gerrit.osmocom.org/2941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I45bba5daf8610cbba6af95b92c2142f2256491ff Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:03:33 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 19 Jun 2017 17:03:33 +0000 Subject: osmo-trx[master]: sigProcLib: Use explicit NaN check in sinc table generation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a838fe3139fa977dfe906246020a14451185714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:05:15 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 19 Jun 2017 17:05:15 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Use explicit NaN check in sinc table generation In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Use explicit NaN check in sinc table generation ...................................................................... sigProcLib: Use explicit NaN check in sinc table generation Using "x < 0.01" is a crude check for detecting NaN condition, which occurs in a sinc call when x = 0 due to divide-by-zero. Use stdlib isnan() call for this purpose. Also, as the table is created only once during initialization, use double floats for table value generation. Change-Id: I3a838fe3139fa977dfe906246020a14451185714 --- M Transceiver52M/sigProcLib.cpp 1 file changed, 3 insertions(+), 9 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index c776501..9d1ef49 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -979,16 +979,10 @@ static void generateSincTable() { - float x; - for (int i = 0; i < TABLESIZE; i++) { - x = (float) i / TABLESIZE * 8 * M_PI; - if (fabs(x) < 0.01) { - sincTable[i] = 1.0f; - continue; - } - - sincTable[i] = sinf(x) / x; + auto x = (double) i / TABLESIZE * 8 * M_PI; + auto y = sin(x) / x; + sincTable[i] = isnan(y) ? 1.0 : y; } } -- To view, visit https://gerrit.osmocom.org/2942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3a838fe3139fa977dfe906246020a14451185714 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 19 17:24:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 17:24:25 +0000 Subject: libosmocore[master]: gsm0808: add default speech codec configuration In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2829/6/include/osmocom/gsm/protocol/gsm_08_08.h File include/osmocom/gsm/protocol/gsm_08_08.h: Line 459: * Configurations for the Adaptive Multi-Rate Codec Types */ As I said before: move this block up into the main API doc comment above, otherwise this is associated directly and only with GSM0808_SC_CFG_DEFAULT_FR_AMR. I know you want to associate this with three items, but that's not how doxygen works. Since you're explicitly naming them, it's fine to have it in the enum's global description. Line 464: /*! Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: same -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore 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 Mon Jun 19 17:26:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 17:26:46 +0000 Subject: libosmocore[master]: cosmetic: Add info about corespondig codecs to permitted speech In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/2938/5//COMMIT_MSG Commit Message: Line 7: cosmetic: Add info about corespondig codecs to permitted speech by uploading the patch again you overwrote my commit log fixes ... argh! There isn't even any difference other than that!? -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 5 Gerrit-Project: libosmocore 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 Mon Jun 19 17:28:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 17:28:04 +0000 Subject: libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/2830/7/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 658: * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ and again, as I said before, you have to move this up and join with the main API doc comment. -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Mon Jun 19 17:29:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 17:29:10 +0000 Subject: libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/2830/7/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 651: * \param[in] perm_spch to be converted define which uint8_t you expect here, e.g. name the enum type -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Mon Jun 19 17:35:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 17:35:26 +0000 Subject: libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/2831/7/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 688: * \param[in] perm_spch value from where the speech codec is derived from 'from where derived from' is incorrect. "perm_spch value the speech codec is derived from" (optionally include "that" or "which" after "value") Line 704: /* Depending on the speech codec type, pick a default codc (codec) Line 725: break; why did you drop the 'default: return -EINVAL'? There should be a default case. (loosely related, callers should check for -EINVAL rc) -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Mon Jun 19 18:32:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 18:32:08 +0000 Subject: libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 (7 comments) https://gerrit.osmocom.org/#/c/2924/5/include/osmocom/sigtran/sccp_sap.h File include/osmocom/sigtran/sccp_sap.h: Line 251: struct osmo_sccp_addr (in above code, the '*' is with the struct, not one line below.) https://gerrit.osmocom.org/#/c/2924/5/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1130: strcpy(entry->name,name); *never* use strcpy()! strncpy() also has various pitfalls. We always use osmo_strlcpy(), here with sizeof(entry->name). Line 1250: memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); (really needed?) Line 1254: memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); on error, we should rather leave the original addr unchanged as it was before this call. i.e. first store to a local variable and then do entry->addr.ip.v4 = tmp_ip_v4; Line 1278: memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); same as above Line 1319: memset(&entry->addr.gt, 0, sizeof(entry->addr.gt)); (syntactically nicer: entry->addr.gt = (struct osmo_sccp_gt){}; ) Line 1383: strcpy(entry->addr.gt.digits, argv[0]); use osmo_strlcpy() with sizeof() -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 5 Gerrit-Project: libosmo-sccp 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 Jun 19 19:17:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 19:17:53 +0000 Subject: libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2820/6/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 308: if(len < 1) (space after if, same below) -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore 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 Mon Jun 19 19:18:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 19:18:26 +0000 Subject: libosmocore[master]: gsm0808: add speech codec type constants In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Jun 19 19:23:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 19:23:55 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 8: Code-Review-1 Max, please pay attention! This patch is removing code and calling a script that is missing here. The script is instead added in another patch, as I commented before. If removing a bit of code dup is taking this long I would welcome if you could focus on the actual task instead, i.e. why not just add one standalone lc15.sh script that I can +2 right away and be done with it. This is getting dragged on for way too long. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max 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 Jun 19 19:24:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 19 Jun 2017 19:24:53 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 8: Code-Review-1 I hate to repeat myself. The jenkins_common.sh belongs in the other patch. -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Jun 20 00:44:23 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 20 Jun 2017 00:44:23 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Specify standard namespace for isnan() Message-ID: Review at https://gerrit.osmocom.org/2977 sigProcLib: Specify standard namespace for isnan() In commit a3dce85f "sigProcLib: Use explicit NaN check in sinc table generation" Use of std::isnan(double) was added without namespace specifier, which may cause build issues depending on whether the C version isnan() call is available. Add standard namespace to force C++ call usage and potential build issues. Change-Id: I49328c43fdd690a4e6a2b2e949411aaf5674ead1 --- M Transceiver52M/sigProcLib.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/77/2977/1 diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 9d1ef49..e94170b 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -982,7 +982,7 @@ for (int i = 0; i < TABLESIZE; i++) { auto x = (double) i / TABLESIZE * 8 * M_PI; auto y = sin(x) / x; - sincTable[i] = isnan(y) ? 1.0 : y; + sincTable[i] = std::isnan(y) ? 1.0 : y; } } -- To view, visit https://gerrit.osmocom.org/2977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49328c43fdd690a4e6a2b2e949411aaf5674ead1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Tue Jun 20 00:44:45 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 20 Jun 2017 00:44:45 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Replace dynamically allocated resampling buffers Message-ID: Review at https://gerrit.osmocom.org/2978 sigProcLib: Replace dynamically allocated resampling buffers Instead use object allocated STL vectors. This simplifies code, removes the need to explicitly release buffers, and fixes a memory leak in destructor deallocation. Also, remove simplified init and release sub-calls. Maintain partition filter allocation using memalign() for SIMD alignment requirements. Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 --- M Transceiver52M/Resampler.cpp M Transceiver52M/Resampler.h 2 files changed, 39 insertions(+), 76 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/78/2978/1 diff --git a/Transceiver52M/Resampler.cpp b/Transceiver52M/Resampler.cpp index 1927e45..3836b68 100644 --- a/Transceiver52M/Resampler.cpp +++ b/Transceiver52M/Resampler.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "Resampler.h" @@ -35,6 +36,8 @@ #define MAX_OUTPUT_LEN 4096 +using namespace std; + static float sinc(float x) { if (x == 0.0) @@ -43,32 +46,19 @@ return sin(M_PI * x) / (M_PI * x); } -bool Resampler::initFilters(float bw) +void Resampler::initFilters(float bw) { - size_t proto_len = p * filt_len; - float *proto, val, cutoff; + float cutoff; float sum = 0.0f, scale = 0.0f; - float midpt = (float) (proto_len - 1.0) / 2.0; /* * Allocate partition filters and the temporary prototype filter * according to numerator of the rational rate. Coefficients are * real only and must be 16-byte memory aligned for SSE usage. */ - proto = new float[proto_len]; - if (!proto) - return false; - - partitions = (float **) malloc(sizeof(float *) * p); - if (!partitions) { - delete[] proto; - return false; - } - - for (size_t i = 0; i < p; i++) { - partitions[i] = (float *) - memalign(16, filt_len * 2 * sizeof(float)); - } + auto proto = vector(p * filt_len); + for (auto &part : partitions) + part = (complex *) memalign(16, filt_len * sizeof(complex)); /* * Generate the prototype filter with a Blackman-harris window. @@ -85,47 +75,26 @@ else cutoff = (float) q; - for (size_t i = 0; i < proto_len; i++) { + float midpt = (proto.size() - 1) / 2.0; + for (size_t i = 0; i < proto.size(); i++) { proto[i] = sinc(((float) i - midpt) / cutoff * bw); proto[i] *= a0 - - a1 * cos(2 * M_PI * i / (proto_len - 1)) + - a2 * cos(4 * M_PI * i / (proto_len - 1)) - - a3 * cos(6 * M_PI * i / (proto_len - 1)); + a1 * cos(2 * M_PI * i / (proto.size() - 1)) + + a2 * cos(4 * M_PI * i / (proto.size() - 1)) - + a3 * cos(6 * M_PI * i / (proto.size() - 1)); sum += proto[i]; } scale = p / sum; /* Populate filter partitions from the prototype filter */ for (size_t i = 0; i < filt_len; i++) { - for (size_t n = 0; n < p; n++) { - partitions[n][2 * i + 0] = proto[i * p + n] * scale; - partitions[n][2 * i + 1] = 0.0f; - } + for (size_t n = 0; n < p; n++) + partitions[n][i] = complex(proto[i * p + n] * scale); } - /* For convolution, we store the filter taps in reverse */ - for (size_t n = 0; n < p; n++) { - for (size_t i = 0; i < filt_len / 2; i++) { - val = partitions[n][2 * i]; - partitions[n][2 * i] = partitions[n][2 * (filt_len - 1 - i)]; - partitions[n][2 * (filt_len - 1 - i)] = val; - } - } - - delete[] proto; - - return true; -} - -void Resampler::releaseFilters() -{ - if (partitions) { - for (size_t i = 0; i < p; i++) - free(partitions[i]); - } - - free(partitions); - partitions = NULL; + /* Store filter taps in reverse */ + for (auto &part : partitions) + reverse(&part[0], &part[filt_len - 1]); } static bool check_vec_len(int in_len, int out_len, int p, int q) @@ -159,14 +128,6 @@ return true; } -void Resampler::computePath() -{ - for (int i = 0; i < MAX_OUTPUT_LEN; i++) { - in_index[i] = (q * i) / p; - out_path[i] = (q * i) % p; - } -} - int Resampler::rotate(const float *in, size_t in_len, float *out, size_t out_len) { int n, path; @@ -180,8 +141,8 @@ path = out_path[i]; convolve_real(in, in_len, - partitions[path], filt_len, - &out[2 * i], out_len - i, + reinterpret_cast(partitions[path]), + filt_len, &out[2 * i], out_len - i, n, 1, 1, 0); } @@ -190,14 +151,18 @@ bool Resampler::init(float bw) { + if (p == 0 || q == 0 || filt_len == 0) return false; + /* Filterbank filter internals */ - if (!initFilters(bw)) - return false; + initFilters(bw); /* Precompute filterbank paths */ - in_index = new size_t[MAX_OUTPUT_LEN]; - out_path = new size_t[MAX_OUTPUT_LEN]; - computePath(); + int i = 0; + for (auto &index : in_index) + index = (q * i++) / p; + i = 0; + for (auto &path : out_path) + path = (q * i++) % p; return true; } @@ -208,7 +173,7 @@ } Resampler::Resampler(size_t p, size_t q, size_t filt_len) - : in_index(NULL), out_path(NULL), partitions(NULL) + : in_index(MAX_OUTPUT_LEN), out_path(MAX_OUTPUT_LEN), partitions(p) { this->p = p; this->q = q; @@ -217,8 +182,6 @@ Resampler::~Resampler() { - releaseFilters(); - - delete in_index; - delete out_path; + for (auto &part : partitions) + free(part); } diff --git a/Transceiver52M/Resampler.h b/Transceiver52M/Resampler.h index c9f9787..caffc08 100644 --- a/Transceiver52M/Resampler.h +++ b/Transceiver52M/Resampler.h @@ -20,6 +20,9 @@ #ifndef _RESAMPLER_H_ #define _RESAMPLER_H_ +#include +#include + class Resampler { public: /* Constructor for rational sample rate conversion @@ -63,14 +66,11 @@ size_t p; size_t q; size_t filt_len; - size_t *in_index; - size_t *out_path; + std::vector in_index; + std::vector out_path; + std::vector *> partitions; - float **partitions; - - bool initFilters(float bw); - void releaseFilters(); - void computePath(); + void initFilters(float bw); }; #endif /* _RESAMPLER_H_ */ -- To view, visit https://gerrit.osmocom.org/2978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Tue Jun 20 00:52:29 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 20 Jun 2017 00:52:29 +0000 Subject: [PATCH] osmo-trx[master]: sigProcLib: Replace dynamically allocated resampling buffers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2978 to look at the new patch set (#2). sigProcLib: Replace dynamically allocated resampling buffers Instead use object allocated STL vectors. This simplifies code, removes the need to explicitly release buffers, and fixes a memory leak in destructor deallocation. Also, remove simplified init and release sub-calls. Maintain partition filter allocation using memalign() for SIMD alignment requirements. Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 --- M Transceiver52M/Resampler.cpp M Transceiver52M/Resampler.h 2 files changed, 39 insertions(+), 76 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/78/2978/2 diff --git a/Transceiver52M/Resampler.cpp b/Transceiver52M/Resampler.cpp index 1927e45..6b9621c 100644 --- a/Transceiver52M/Resampler.cpp +++ b/Transceiver52M/Resampler.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "Resampler.h" @@ -35,6 +36,8 @@ #define MAX_OUTPUT_LEN 4096 +using namespace std; + static float sinc(float x) { if (x == 0.0) @@ -43,32 +46,19 @@ return sin(M_PI * x) / (M_PI * x); } -bool Resampler::initFilters(float bw) +void Resampler::initFilters(float bw) { - size_t proto_len = p * filt_len; - float *proto, val, cutoff; + float cutoff; float sum = 0.0f, scale = 0.0f; - float midpt = (float) (proto_len - 1.0) / 2.0; /* * Allocate partition filters and the temporary prototype filter * according to numerator of the rational rate. Coefficients are * real only and must be 16-byte memory aligned for SSE usage. */ - proto = new float[proto_len]; - if (!proto) - return false; - - partitions = (float **) malloc(sizeof(float *) * p); - if (!partitions) { - delete[] proto; - return false; - } - - for (size_t i = 0; i < p; i++) { - partitions[i] = (float *) - memalign(16, filt_len * 2 * sizeof(float)); - } + auto proto = vector(p * filt_len); + for (auto &part : partitions) + part = (complex *) memalign(16, filt_len * sizeof(complex)); /* * Generate the prototype filter with a Blackman-harris window. @@ -85,47 +75,26 @@ else cutoff = (float) q; - for (size_t i = 0; i < proto_len; i++) { + float midpt = (proto.size() - 1) / 2.0; + for (size_t i = 0; i < proto.size(); i++) { proto[i] = sinc(((float) i - midpt) / cutoff * bw); proto[i] *= a0 - - a1 * cos(2 * M_PI * i / (proto_len - 1)) + - a2 * cos(4 * M_PI * i / (proto_len - 1)) - - a3 * cos(6 * M_PI * i / (proto_len - 1)); + a1 * cos(2 * M_PI * i / (proto.size() - 1)) + + a2 * cos(4 * M_PI * i / (proto.size() - 1)) - + a3 * cos(6 * M_PI * i / (proto.size() - 1)); sum += proto[i]; } scale = p / sum; /* Populate filter partitions from the prototype filter */ for (size_t i = 0; i < filt_len; i++) { - for (size_t n = 0; n < p; n++) { - partitions[n][2 * i + 0] = proto[i * p + n] * scale; - partitions[n][2 * i + 1] = 0.0f; - } + for (size_t n = 0; n < p; n++) + partitions[n][i] = complex(proto[i * p + n] * scale); } - /* For convolution, we store the filter taps in reverse */ - for (size_t n = 0; n < p; n++) { - for (size_t i = 0; i < filt_len / 2; i++) { - val = partitions[n][2 * i]; - partitions[n][2 * i] = partitions[n][2 * (filt_len - 1 - i)]; - partitions[n][2 * (filt_len - 1 - i)] = val; - } - } - - delete[] proto; - - return true; -} - -void Resampler::releaseFilters() -{ - if (partitions) { - for (size_t i = 0; i < p; i++) - free(partitions[i]); - } - - free(partitions); - partitions = NULL; + /* Store filter taps in reverse */ + for (auto &part : partitions) + reverse(&part[0], &part[filt_len]); } static bool check_vec_len(int in_len, int out_len, int p, int q) @@ -159,14 +128,6 @@ return true; } -void Resampler::computePath() -{ - for (int i = 0; i < MAX_OUTPUT_LEN; i++) { - in_index[i] = (q * i) / p; - out_path[i] = (q * i) % p; - } -} - int Resampler::rotate(const float *in, size_t in_len, float *out, size_t out_len) { int n, path; @@ -180,8 +141,8 @@ path = out_path[i]; convolve_real(in, in_len, - partitions[path], filt_len, - &out[2 * i], out_len - i, + reinterpret_cast(partitions[path]), + filt_len, &out[2 * i], out_len - i, n, 1, 1, 0); } @@ -190,14 +151,18 @@ bool Resampler::init(float bw) { + if (p == 0 || q == 0 || filt_len == 0) return false; + /* Filterbank filter internals */ - if (!initFilters(bw)) - return false; + initFilters(bw); /* Precompute filterbank paths */ - in_index = new size_t[MAX_OUTPUT_LEN]; - out_path = new size_t[MAX_OUTPUT_LEN]; - computePath(); + int i = 0; + for (auto &index : in_index) + index = (q * i++) / p; + i = 0; + for (auto &path : out_path) + path = (q * i++) % p; return true; } @@ -208,7 +173,7 @@ } Resampler::Resampler(size_t p, size_t q, size_t filt_len) - : in_index(NULL), out_path(NULL), partitions(NULL) + : in_index(MAX_OUTPUT_LEN), out_path(MAX_OUTPUT_LEN), partitions(p) { this->p = p; this->q = q; @@ -217,8 +182,6 @@ Resampler::~Resampler() { - releaseFilters(); - - delete in_index; - delete out_path; + for (auto &part : partitions) + free(part); } diff --git a/Transceiver52M/Resampler.h b/Transceiver52M/Resampler.h index c9f9787..caffc08 100644 --- a/Transceiver52M/Resampler.h +++ b/Transceiver52M/Resampler.h @@ -20,6 +20,9 @@ #ifndef _RESAMPLER_H_ #define _RESAMPLER_H_ +#include +#include + class Resampler { public: /* Constructor for rational sample rate conversion @@ -63,14 +66,11 @@ size_t p; size_t q; size_t filt_len; - size_t *in_index; - size_t *out_path; + std::vector in_index; + std::vector out_path; + std::vector *> partitions; - float **partitions; - - bool initFilters(float bw); - void releaseFilters(); - void computePath(); + void initFilters(float bw); }; #endif /* _RESAMPLER_H_ */ -- To view, visit https://gerrit.osmocom.org/2978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:53:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:53:59 +0000 Subject: [PATCH] libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* Message-ID: Review at https://gerrit.osmocom.org/2979 doxygen: gsm: do not exclude include/gsm/protocol/* Clear out the EXCLUDE tag to not exclude anything. Tried to add API doc to gsm/protocol/gsm_08_08.h and after a long time found out why they are not appearing in the API doc. It's not clear to me why this dir was excluded. Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 --- M Doxyfile.gsm.in 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/2979/1 diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index 1dae2b5..ed4ff47 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -654,7 +654,7 @@ # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* -EXCLUDE_PATTERNS = */include/osmocom/gsm/protocol/* +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 -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:53:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:53:59 +0000 Subject: [PATCH] libosmocore[master]: doxygen: drop INPUT gsm/protocol, already part of gsm/ Message-ID: Review at https://gerrit.osmocom.org/2980 doxygen: drop INPUT gsm/protocol, already part of gsm/ include/osmocom/gsm/protocol is also implicitly included in its parent dir because of the recursive rule. Naming it again makes doxygen use it twice. It doesn't seem to be harmful, but not needed either. Change-Id: I5dc22ca65740a88540dacc61c0742fede172de9c --- M Doxyfile.gsm.in 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/2980/1 diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index ed4ff47..474fb83 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@/include/osmocom/gsm/protocol @srcdir@/src/gsm +INPUT = @srcdir@/include/osmocom/gsm @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/2980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5dc22ca65740a88540dacc61c0742fede172de9c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:53:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:53:59 +0000 Subject: [PATCH] libosmocore[master]: doxygen: include all undocumented items in the API doc Message-ID: Review at https://gerrit.osmocom.org/2981 doxygen: include all undocumented items in the API doc Currently, files that omit the \file directive and all functions, enums, structs lacking a doxygen style comment are completely missing from the doxygen API docs. Set EXTRACT_ALL = YES so that all files and code items are at least listed in the doxygen API. Change-Id: I39f558ec0a33a61a1fcec0554f53c8e7668733de --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gsm.in M Doxyfile.vty.in 5 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/2981/1 diff --git a/Doxyfile.codec.in b/Doxyfile.codec.in index 8435379..b826a36 100644 --- a/Doxyfile.codec.in +++ b/Doxyfile.codec.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in index 28e3241..7c1a28e 100644 --- a/Doxyfile.coding.in +++ b/Doxyfile.coding.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.core.in b/Doxyfile.core.in index 58d35be..cc3d842 100644 --- a/Doxyfile.core.in +++ b/Doxyfile.core.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index 474fb83..2f5d084 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.vty.in b/Doxyfile.vty.in index 073ee0c..204436f 100644 --- a/Doxyfile.vty.in +++ b/Doxyfile.vty.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. -- To view, visit https://gerrit.osmocom.org/2981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39f558ec0a33a61a1fcec0554f53c8e7668733de Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:00 +0000 Subject: [PATCH] libosmocore[master]: doxygen: add missing gb API doc generation Message-ID: Review at https://gerrit.osmocom.org/2982 doxygen: add missing gb API doc generation Files in include/osmocom/gprs/ and src/gb/ are not included in any doxygen generated API docs. Add Doxyfile.gb.in and adjust configure.ac and Makefile.am. Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 --- M .gitignore A Doxyfile.gb.in M Makefile.am M configure.ac 4 files changed, 1,728 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2982/1 diff --git a/.gitignore b/.gitignore index 89459f0..f26b699 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ Doxyfile.vty Doxyfile.codec Doxyfile.coding +Doxyfile.gb debian/autoreconf.after debian/autoreconf.before @@ -115,6 +116,7 @@ doc/vty/html doc/vty/doxygen_sqlite3.db doc/gsm +doc/gb doc/html.tar doc/*.tag tags diff --git a/Doxyfile.gb.in b/Doxyfile.gb.in new file mode 100644 index 0000000..36b4f2b --- /dev/null +++ b/Doxyfile.gb.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 = libosmogb + +# 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 Gb 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/gb + +# 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/gprs @srcdir@/src/gb + +# 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 = 1 + +# 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 = doc/libosmocore.tag=../../core/html + +# 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/libosmogb.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 3f6df9b..82c10dd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,11 +19,14 @@ html_DATA = $(top_builddir)/doc/html.tar +doc: $(html_DATA) + $(html_DATA): $(top_builddir)/doc/core/html/index.html \ $(top_builddir)/doc/gsm/html/index.html \ $(top_builddir)/doc/vty/html/index.html \ $(top_builddir)/doc/codec/html/index.html \ - $(top_builddir)/doc/coding/html/index.html + $(top_builddir)/doc/coding/html/index.html \ + $(top_builddir)/doc/gb/html/index.html cd $(top_builddir)/doc && tar cf html.tar */html $(top_builddir)/doc/core/html/index.html: $(SOURCES) Doxyfile.core @@ -50,6 +53,11 @@ mkdir -p doc/coding $(DOXYGEN) Doxyfile.coding +$(top_builddir)/doc/gb/html/index.html: $(SOURCES) Doxyfile.gb + @rm -rf doc/gb + mkdir -p doc/gb + $(DOXYGEN) Doxyfile.gb + install-data-hook: cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar diff --git a/configure.ac b/configure.ac index 340a896..1e258a4 100644 --- a/configure.ac +++ b/configure.ac @@ -308,4 +308,5 @@ Doxyfile.vty Doxyfile.codec Doxyfile.coding + Doxyfile.gb Makefile) -- To view, visit https://gerrit.osmocom.org/2982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:00 +0000 Subject: [PATCH] libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief Message-ID: Review at https://gerrit.osmocom.org/2983 doxygen: enable AUTOBRIEF, drop \brief Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gsm.in M Doxyfile.vty.in M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/application.h M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/defs.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/msgb.h M include/osmocom/core/panic.h M include/osmocom/core/prim.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/statistics.h M include/osmocom/core/strrb.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/sim.h M include/osmocom/vty/command.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/crc16.c M src/ctrl/control_if.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_ns.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/auth_core.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/panic.c M src/plugin.c M src/prim.c M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/core.c M src/socket.c M src/stat_item.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c 138 files changed, 1,542 insertions(+), 1,542 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/2983/1 -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:00 +0000 Subject: [PATCH] libosmocore[master]: doxygen: linuxlist.h: fix some API doc to use doxygen Qt style Message-ID: Review at https://gerrit.osmocom.org/2984 doxygen: linuxlist.h: fix some API doc to use doxygen Qt style Change-Id: I9ae25c9bc6b7504402e583a6ce77b037083dcb80 --- M include/osmocom/core/linuxlist.h 1 file changed, 16 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/2984/1 diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index 5098c5f..b942188 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -332,35 +332,31 @@ &pos->member != (head); \ pos = n, n = llist_entry(n->member.next, typeof(*n), member)) -/** - * llist_for_each_rcu - iterate over an rcu-protected llist - * @pos: the &struct llist_head to use as a loop counter. - * @head: the head for your llist. +/*! iterate over an rcu-protected llist. + * \param pos the &struct llist_head to use as a loop counter. + * \param head the head for your llist. */ #define llist_for_each_rcu(pos, head) \ for (pos = (head)->next, prefetch(pos->next); pos != (head); \ pos = pos->next, ({ smp_read_barrier_depends(); 0;}), prefetch(pos->next)) - + #define __llist_for_each_rcu(pos, head) \ for (pos = (head)->next; pos != (head); \ pos = pos->next, ({ smp_read_barrier_depends(); 0;})) - -/** - * llist_for_each_safe_rcu - iterate over an rcu-protected llist safe - * against removal of llist entry - * @pos: the &struct llist_head to use as a loop counter. - * @n: another &struct llist_head to use as temporary storage - * @head: the head for your llist. + +/*! iterate over an rcu-protected llist safe against removal of llist entry. + * \param pos the &struct llist_head to use as a loop counter. + * \param n another &struct llist_head to use as temporary storage + * \param head the head for your llist. */ #define llist_for_each_safe_rcu(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, ({ smp_read_barrier_depends(); 0;}), n = pos->next) -/** - * llist_for_each_entry_rcu - iterate over rcu llist of given type - * @pos: the type * to use as a loop counter. - * @head: the head for your llist. - * @member: the name of the llist_struct within the struct. +/*! iterate over rcu llist of given type. + * \param pos the type * to use as a loop counter. + * \param head the head for your llist. + * \param member the name of the llist_struct within the struct. */ #define llist_for_each_entry_rcu(pos, head, member) \ for (pos = llist_entry((head)->next, typeof(*pos), member), \ @@ -371,11 +367,9 @@ prefetch(pos->member.next)) -/** - * llist_for_each_continue_rcu - iterate over an rcu-protected llist - * continuing after existing point. - * @pos: the &struct llist_head to use as a loop counter. - * @head: the head for your llist. +/*! iterate over an rcu-protected llist continuing after existing point. + * \param pos the &struct llist_head to use as a loop counter. + * \param head the head for your llist. */ #define llist_for_each_continue_rcu(pos, head) \ for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \ -- To view, visit https://gerrit.osmocom.org/2984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ae25c9bc6b7504402e583a6ce77b037083dcb80 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:01 +0000 Subject: [PATCH] libosmocore[master]: api doc typo fix in core/logging.h Message-ID: Review at https://gerrit.osmocom.org/2985 api doc typo fix in core/logging.h Change-Id: I3f1cd5b10e7beccb61f370d7f8fa2666e56542cf --- M include/osmocom/core/logging.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/2985/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 4721713..bb5aa42 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -108,7 +108,7 @@ #define DLM3UA -16 /*!< Osmocom M3UA */ #define OSMO_NUM_DLIB 16 /*!< Number of logging sub-systems in libraries */ -/*! Configuration of singgle log category / sub-system */ +/*! Configuration of single log category / sub-system */ struct log_category { uint8_t loglevel; /*!< configured log-level */ uint8_t enabled; /*!< is logging enabled? */ -- To view, visit https://gerrit.osmocom.org/2985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f1cd5b10e7beccb61f370d7f8fa2666e56542cf Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:01 +0000 Subject: [PATCH] libosmocore[master]: doxygen: various fixes in core/timer.h Message-ID: Review at https://gerrit.osmocom.org/2986 doxygen: various fixes in core/timer.h Move a longish comment to the timer group so that it appears in the API doc. Un-doxygen some floating comments that were associated with unrelated code items ('/**' --> '/*'). Add braces to some function names so that the API doc will render as reference links. Change-Id: I3ea5b88cbe9cb54702429158bf47e768e04e8fe7 --- M include/osmocom/core/timer.h 1 file changed, 16 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/2986/1 diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 28785db..a039ac8 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -19,11 +19,24 @@ */ /*! \defgroup timer Osmocom timers + * Timer management: + * - Create a struct osmo_timer_list + * - Fill out timeout and use osmo_timer_add(), or + * use osmo_timer_schedule() to schedule a timer in + * x seconds and microseconds from now... + * - Use osmo_timer_del() to remove the timer + * + * Internally: + * - We hook into select.c to give a timeval of the + * nearest timer. On already passed timers we give + * it a 0 to immediately fire after the select + * - osmo_timers_update() will call the callbacks and + * remove the timers. * @{ */ /*! \file timer.h - * Osmocom timer handling routines + * Osmocom timer handling routines. */ #pragma once @@ -34,22 +47,6 @@ #include #include -/** - * Timer management: - * - Create a struct osmo_timer_list - * - Fill out timeout and use add_timer or - * use osmo_timer_schedule to schedule a timer in - * x seconds and microseconds from now... - * - Use osmo_timer_del to remove the timer - * - * Internally: - * - We hook into select.c to give a timeval of the - * nearest timer. On already passed timers we give - * it a 0 to immediately fire after the select - * - osmo_timers_update will call the callbacks and - * remove the timers. - * - */ /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ @@ -61,7 +58,7 @@ void *data; /*!< user data for callback */ }; -/** +/* * timer management */ @@ -88,7 +85,7 @@ int osmo_gettimeofday(struct timeval *tv, struct timezone *tz); -/** +/* * timer override */ -- To view, visit https://gerrit.osmocom.org/2986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ea5b88cbe9cb54702429158bf47e768e04e8fe7 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:01 +0000 Subject: [PATCH] libosmocore[master]: doxygen: unify use of \file across the board Message-ID: Review at https://gerrit.osmocom.org/2987 doxygen: unify use of \file across the board Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b --- M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/backtrace.h M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/crc16.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/crcgen.h M include/osmocom/core/defs.h M include/osmocom/core/endian.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/loggingrb.h M include/osmocom/core/macaddr.h M include/osmocom/core/msgb.h M include/osmocom/core/msgfile.h M include/osmocom/core/panic.h M include/osmocom/core/plugin.h M include/osmocom/core/prim.h M include/osmocom/core/process.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/serial.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/stats.h M include/osmocom/core/strrb.h M include/osmocom/core/talloc.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/crypt/gprs_cipher.h M include/osmocom/ctrl/control_cmd.h M include/osmocom/ctrl/control_if.h M include/osmocom/ctrl/control_vty.h M include/osmocom/ctrl/ports.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_bssgp_bss.h M include/osmocom/gprs/gprs_msgb.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_ns_frgre.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_04_60.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/apn.h M include/osmocom/gsm/bitvec_gsm.h M include/osmocom/gsm/comp128.h M include/osmocom/gsm/comp128v23.h M include/osmocom/gsm/gan.h M include/osmocom/gsm/gea.h 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 include/osmocom/gsm/gsm0480.h M include/osmocom/gsm/gsm0502.h M include/osmocom/gsm/gsm0808.h M include/osmocom/gsm/gsm0808_utils.h M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/gsm48.h M include/osmocom/gsm/gsm48_ie.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/gsup.h M include/osmocom/gsm/ipa.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/meas_rep.h M include/osmocom/gsm/mncc.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/prim.h M include/osmocom/gsm/protocol/gsm_03_40.h M include/osmocom/gsm/protocol/gsm_03_41.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M include/osmocom/gsm/protocol/gsm_04_11.h M include/osmocom/gsm/protocol/gsm_04_12.h M include/osmocom/gsm/protocol/gsm_04_14.h M include/osmocom/gsm/protocol/gsm_04_80.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_09_02.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/protocol/gsm_23_003.h M include/osmocom/gsm/protocol/gsm_44_318.h M include/osmocom/gsm/protocol/ipaccess.h M include/osmocom/gsm/protocol/smpp34_osmocom.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/rxlev_stat.h M include/osmocom/gsm/sysinfo.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/class_tables.h M include/osmocom/sim/sim.h M include/osmocom/vty/buffer.h M include/osmocom/vty/command.h M include/osmocom/vty/logging.h M include/osmocom/vty/misc.h M include/osmocom/vty/ports.h M include/osmocom/vty/stats.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vector.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm660.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/conv_acc.c M src/conv_acc_generic.c M src/conv_acc_sse.c M src/conv_acc_sse_avx.c M src/conv_acc_sse_impl.h M src/crc16.c M src/crcXXgen.c.tpl M src/ctrl/control_cmd.c M src/ctrl/control_if.c M src/ctrl/control_vty.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/common_vty.c M src/gb/common_vty.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_bssgp_util.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns.c M src/gb/gprs_ns_frgre.c M src/gb/gprs_ns_vty.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/apn.c M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_core.c M src/gsm/auth_milenage.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_gea.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0414.c M src/gsm/gsm0480.c M src/gsm/gsm0502.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/kasumi.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/milenage/aes-encblock.c M src/gsm/milenage/aes-internal-enc.c M src/gsm/milenage/aes-internal.c M src/gsm/milenage/aes.h M src/gsm/milenage/aes_i.h M src/gsm/milenage/aes_wrap.h M src/gsm/milenage/common.h M src/gsm/milenage/milenage.c M src/gsm/milenage/milenage.h M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/rxlev_stat.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/msgfile.c M src/panic.c M src/plugin.c M src/prim.c M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/card_fs_isim.c M src/sim/card_fs_sim.c M src/sim/card_fs_tetra.c M src/sim/card_fs_uicc.c M src/sim/card_fs_usim.c M src/sim/class_tables.c M src/sim/core.c M src/sim/gsm_int.h M src/sim/reader.c M src/sim/reader_pcsc.c M src/sim/sim_int.h M src/socket.c M src/stat_item.c M src/statistics.c M src/stats.c M src/stats_statsd.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/buffer.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c M utils/osmo-arfcn.c M utils/osmo-auc-gen.c 251 files changed, 874 insertions(+), 867 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/2987/1 diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h index 3e9b688..3e62a01 100644 --- a/include/osmocom/codec/codec.h +++ b/include/osmocom/codec/codec.h @@ -1,3 +1,5 @@ +/*! \file codec.h */ + #pragma once #include diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index a9c59e4..a2d4115 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -1,3 +1,7 @@ +/*! \file gsm0503_coding.h + * GSM TS 05.03 coding + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \addtogroup coding * @{ - */ - -/*! \file gsm0503_coding.h - * GSM TS 05.03 coding - */ + * \file gsm0503_coding.h */ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index 1463fb3..05b5e27 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_interleaving.h + * GSM TS 05.03 interleaving. + */ + #pragma once #include /*! \addtogroup interleaving * @{ - */ - -/*! \file gsm0503_interleaving.h - * GSM TS 05.03 interleaving - */ + * \file gsm0503_interleaving.h */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 435c913..fbd3bfd 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_mapping.c + * GSM TS 05.03 burst mapping. + */ + #pragma once #include /*! \addtogroup mapping * @{ - */ - -/*! \file gsm0503_mapping.c - * GSM TS 05.03 burst mapping - */ + * \file gsm0503_mapping.h */ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); diff --git a/include/osmocom/coding/gsm0503_parity.h b/include/osmocom/coding/gsm0503_parity.h index 2743bdb..28a5444 100644 --- a/include/osmocom/coding/gsm0503_parity.h +++ b/include/osmocom/coding/gsm0503_parity.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_parity.h + * GSM TS 05.03 parity. + */ + #pragma once #include /*! \addtogroup parity * @{ - */ - -/*! \file gsm0503_parity.h - * GSM TS 05.03 parity - */ + * \file gsm0503_parity.h */ const struct osmo_crc64gen_code gsm0503_fire_crc40; const struct osmo_crc16gen_code gsm0503_cs234_crc16; diff --git a/include/osmocom/coding/gsm0503_tables.h b/include/osmocom/coding/gsm0503_tables.h index f8c43c6..55c4ebe 100644 --- a/include/osmocom/coding/gsm0503_tables.h +++ b/include/osmocom/coding/gsm0503_tables.h @@ -1,3 +1,7 @@ +/*! \file gsm0503_tables.h + * GSM TS 05.03 tables. + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \addtogroup tables * @{ - */ - -/*! \file gsm0503_tables.h - * GSM TS 05.03 tables - */ + * \file gsm0503_tables.h */ extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8]; extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8]; diff --git a/include/osmocom/core/backtrace.h b/include/osmocom/core/backtrace.h index 0c9b6ef..d661dd0 100644 --- a/include/osmocom/core/backtrace.h +++ b/include/osmocom/core/backtrace.h @@ -1,3 +1,5 @@ +/*! \file backtrace.h */ + #pragma once void osmo_generate_backtrace(void); diff --git a/include/osmocom/core/bitcomp.h b/include/osmocom/core/bitcomp.h index a184a1c..dc356bd 100644 --- a/include/osmocom/core/bitcomp.h +++ b/include/osmocom/core/bitcomp.h @@ -1,8 +1,7 @@ -#pragma once - -/* bit compression routines */ - -/* (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev +/*! \file bitcomp.h + * Osmocom bit compression routines. */ +/* + * (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev * * All Rights Reserved * @@ -22,13 +21,11 @@ * */ +#pragma once + /*! \defgroup bitcomp Bit compression * @{ - */ - -/*! \file bitcomp.h - * Osmocom bit compression routines - */ + * \file bitcomp.h */ #include #include diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 61af716..17fe1c6 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -1,3 +1,11 @@ +/*! \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 #include @@ -9,15 +17,7 @@ /*! \defgroup bits soft, unpacked and packed bits * @{ - */ - -/*! \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)) - */ + * \file bits.h */ typedef int8_t sbit_t; /*!< soft bit (-127...127) */ typedef uint8_t ubit_t; /*!< unpacked bit (0 or 1) */ diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 9187ce2..d4c7d68 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -1,7 +1,3 @@ -#pragma once - -/* bit vector utility routines */ - /* (C) 2009 by Harald Welte * (C) 2012 Ivan Klyuchnikov * (C) 2015 Sysmocom s.f.m.c. GmbH @@ -24,21 +20,11 @@ * */ +#pragma once + /*! \defgroup bitvec Bit vectors * @{ - */ - -/*! \file bitvec.h - * Osmocom bit vector abstraction - * - * These functions assume a MSB (most significant bit) first layout of the - * bits, so that for instance the 5 bit number abcde (a is MSB) can be - * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count - * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). - * Note that there are other incompatible encodings, like it is used - * for the EGPRS RLC data block headers (there the bits are numbered from LSB - * to MSB). - */ + * \file bitvec.h */ #include #include diff --git a/include/osmocom/core/byteswap.h b/include/osmocom/core/byteswap.h index 4274b8f..1ea5b3d 100644 --- a/include/osmocom/core/byteswap.h +++ b/include/osmocom/core/byteswap.h @@ -1,3 +1,5 @@ +/*! \file byteswap.h */ + #pragma once #include #include diff --git a/include/osmocom/core/conv.h b/include/osmocom/core/conv.h index 1888fe1..8b344f4 100644 --- a/include/osmocom/core/conv.h +++ b/include/osmocom/core/conv.h @@ -1,6 +1,6 @@ +/*! \file conv.h + * Osmocom convolutional encoder and decoder. */ /* - * conv.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -22,11 +22,7 @@ /*! \defgroup conv Convolutional encoding and decoding routines * @{ - */ - -/*! \file conv.h - * Osmocom convolutional encoder and decoder - */ + * \file conv.h */ #pragma once diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h index f1564bd..52807af 100644 --- a/include/osmocom/core/crc16.h +++ b/include/osmocom/core/crc16.h @@ -1,4 +1,4 @@ -/* +/*! \file crc16.h * This was copied from the linux kernel and adjusted for our types. */ /* diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl index 164f720..2753346 100644 --- a/include/osmocom/core/crcXXgen.h.tpl +++ b/include/osmocom/core/crcXXgen.h.tpl @@ -1,6 +1,6 @@ +/*! \file crcXXgen.h + * Osmocom generic CRC routines (for max XX bits poly) header. */ /* - * crcXXgen.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,12 +24,7 @@ /*! \addtogroup crcgen * @{ - */ - -/*! \file crcXXgen.h - * Osmocom generic CRC routines (for max XX bits poly) header - */ - + * \file crcXXgen.h.tpl */ #include #include diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h index b39b55d..d73e6e8 100644 --- a/include/osmocom/core/crcgen.h +++ b/include/osmocom/core/crcgen.h @@ -1,6 +1,6 @@ +/*! \file crcgen.h + * Osmocom generic CRC routines global header. */ /* - * crcgen.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,11 +24,7 @@ /*! \defgroup crcgen Osmocom generic CRC routines * @{ - */ - -/*! \file crcgen.h - * Osmocom generic CRC routines global header - */ + * \file crcgen.h */ #include #include diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index 88c41b9..5e5aa90 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -1,12 +1,12 @@ +/*! \file defs.h + * General definitions that are meant to be included from header files. + */ + #pragma once /*! \defgroup utils General-purpose utility functions * @{ - */ - -/*! \file defs.h - * General definitions that are meant to be included from header files. - */ + * \file defs.h */ /*! Check for gcc and version. * diff --git a/include/osmocom/core/endian.h b/include/osmocom/core/endian.h index 621f34e..6107b12 100644 --- a/include/osmocom/core/endian.h +++ b/include/osmocom/core/endian.h @@ -1,6 +1,5 @@ -#pragma once - -/** +/*! \file endian.h + * * GNU and FreeBSD have various ways to express the * endianess but none of them is similiar enough. This * will create two defines that allows to decide on the @@ -12,6 +11,8 @@ * */ +#pragma once + #if defined(__FreeBSD__) #include #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index fb182f3..2fbb250 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -1,3 +1,7 @@ +/*! \file fsm.h + * Finite State Machine + */ + #pragma once #include @@ -9,11 +13,7 @@ /*! \defgroup fsm Finite State Machine abstraction * @{ - */ - -/*! \file fsm.h - * Finite State Machine - */ + * \file fsm.h */ struct osmo_fsm_inst; diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index 0dc25bb..1e19315 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -1,8 +1,6 @@ -#pragma once - -/* gsmtap header, pseudo-header in front of the actua GSM payload */ - -/* GSMTAP is a generic header format for GSM protocol captures, +/*! \file gsmtap.h + * gsmtap header, pseudo-header in front of the actua GSM payload. + * GSMTAP is a generic header format for GSM protocol captures, * it uses the IANA-assigned UDP port number 4729 and carries * payload in various formats of GSM interfaces such as Um MAC * blocks or Um bursts. @@ -11,6 +9,8 @@ * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/) */ +#pragma once + #include /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index b60257e..59b81e5 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -6,8 +6,7 @@ /*! \defgroup gsmtap GSMTAP * @{ - */ -/*! \file gsmtap_util.h */ + * \file gsmtap_util.h */ uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id); diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index b942188..cb8d4a1 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -1,11 +1,4 @@ -#pragma once - -/*! \defgroup linuxlist Simple doubly linked list implementation - * @{ - */ - -/*! - * \file linuxlist.h +/*! \file linuxlist.h * * Simple doubly linked list implementation. * @@ -16,6 +9,12 @@ * using the generic single-entry routines. */ +#pragma once + +/*! \defgroup linuxlist Simple doubly linked list implementation + * @{ + * \file linuxlist.h */ + #include #ifndef inline diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index bb5aa42..68a9c13 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -2,9 +2,7 @@ /*! \defgroup logging Osmocom logging framework * @{ - */ - -/*! \file logging.h */ + * \file logging.h */ #include #include diff --git a/include/osmocom/core/loggingrb.h b/include/osmocom/core/loggingrb.h index dcd7917..a9fb404 100644 --- a/include/osmocom/core/loggingrb.h +++ b/include/osmocom/core/loggingrb.h @@ -1,5 +1,3 @@ -#pragma once - /* (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * @@ -19,13 +17,11 @@ * */ +#pragma once /*! \defgroup loggingrb Osmocom ringbuffer-backed logging * @{ - */ - -/*! \file loggingrb.h - */ + * \file loggingrb.h */ struct log_info; diff --git a/include/osmocom/core/macaddr.h b/include/osmocom/core/macaddr.h index 8de6238..83f0bde 100644 --- a/include/osmocom/core/macaddr.h +++ b/include/osmocom/core/macaddr.h @@ -1,3 +1,5 @@ +/*! \file macaddr.h */ + #pragma once int osmo_macaddr_parse(uint8_t *out, const char *in); diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 7fad943..91b7ec7 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -27,9 +27,7 @@ /*! \defgroup msgb Message buffers * @{ - */ - -/*! \file msgb.h */ + * \file msgb.h */ #define MSGB_DEBUG diff --git a/include/osmocom/core/msgfile.h b/include/osmocom/core/msgfile.h index cab97b2..800b431 100644 --- a/include/osmocom/core/msgfile.h +++ b/include/osmocom/core/msgfile.h @@ -1,3 +1,4 @@ +/*! \file msgfile.h */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/include/osmocom/core/panic.h b/include/osmocom/core/panic.h index 92c557f..2bb4240 100644 --- a/include/osmocom/core/panic.h +++ b/include/osmocom/core/panic.h @@ -2,9 +2,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file panic.h */ + * \file panic.h */ #include diff --git a/include/osmocom/core/plugin.h b/include/osmocom/core/plugin.h index aef1dfc..6db8709 100644 --- a/include/osmocom/core/plugin.h +++ b/include/osmocom/core/plugin.h @@ -1,3 +1,5 @@ +/*! \file plugin.h */ + #pragma once int osmo_plugin_load_all(const char *directory); diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h index 7288ba6..88ae08b 100644 --- a/include/osmocom/core/prim.h +++ b/include/osmocom/core/prim.h @@ -2,9 +2,7 @@ /*! \defgroup prim Osmocom primitives * @{ - */ - -/*! \file prim.h */ + * \file prim.h */ #include #include diff --git a/include/osmocom/core/process.h b/include/osmocom/core/process.h index 1dde021..8cfca8a 100644 --- a/include/osmocom/core/process.h +++ b/include/osmocom/core/process.h @@ -1,2 +1,3 @@ +/*! \file process.h */ #warning "Update from osmocom/core/process.h to osmocom/core/application.h" #include diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index b75967a..74414e9 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -2,9 +2,7 @@ /*! \defgroup rate_ctr Rate counters * @{ - */ - -/*! \file rate_ctr.h */ + * \file rate_ctr.h */ #include diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index fe84c5b..9b5f372 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -1,3 +1,7 @@ +/*! \file select.h + * select loop abstraction. + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \defgroup select Select loop abstraction * @{ - */ - -/*! \file select.h - * select loop abstraction - */ + * \file select.h */ /*! Indicate interest in reading from the file descriptor */ #define BSC_FD_READ 0x0001 diff --git a/include/osmocom/core/sercomm.h b/include/osmocom/core/sercomm.h index cf15613..072f4d9 100644 --- a/include/osmocom/core/sercomm.h +++ b/include/osmocom/core/sercomm.h @@ -1,3 +1,7 @@ +/*! \file sercomm.h + * Osmocom Sercomm HDLC (de)multiplex. + */ + #ifndef _SERCOMM_H #define _SERCOMM_H @@ -5,11 +9,7 @@ /*! \defgroup sercomm Seriall Communications (HDLC) * @{ - */ - -/*! \file sercomm.h - * Osmocom Sercomm HDLC (de)multiplex - */ + * \file sercomm.h */ /*! A low sercomm_dlci means high priority. A high DLCI means low priority */ enum sercomm_dlci { diff --git a/include/osmocom/core/serial.h b/include/osmocom/core/serial.h index e3f7a9f..39614a4 100644 --- a/include/osmocom/core/serial.h +++ b/include/osmocom/core/serial.h @@ -1,6 +1,6 @@ +/*! \file serial.h + * Osmocom serial port helpers. */ /* - * serial.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -22,11 +22,7 @@ /*! \defgroup serial Utility functions to deal with serial ports * @{ - */ - -/*! \file serial.h - * Osmocom serial port helpers - */ + * \file serial.h */ #pragma once diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index d7132f9..ae78f15 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -4,8 +4,7 @@ /*! \defgroup signal Intra-application signals * @{ - */ -/*! \file signal.h */ + * \file signal.h */ /*! subsystem signaling numbers: we split the numberspace for * applications and libraries: from 0 to UINT_MAX/2 for applications, diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index d6a5662..d2118ef 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -1,12 +1,11 @@ +/*! \file socket.h + * Osmocom socket convenience functions. */ + #pragma once /*! \defgroup socket Socket convenience functions * @{ - */ - -/*! \file socket.h - * Osmocom socket convenience functions - */ + * \file socket.h */ #include diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 957918a..4cee8a8 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -2,9 +2,7 @@ /*! \defgroup osmo_stat_item Statistics value item * @{ - */ - -/*! \file stat_item.h */ + * \file stat_item.h */ #include diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 09b836a..161b34c 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -1,4 +1,6 @@ -/* (C) 2015 by Sysmocom s.f.m.c. GmbH +/*! \file stats.h */ +/* + * (C) 2015 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved * diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h index 2b4d89f..b87239d 100644 --- a/include/osmocom/core/strrb.h +++ b/include/osmocom/core/strrb.h @@ -1,6 +1,7 @@ -#pragma once - -/* (C) 2012-2013 by Katerina Barone-Adesi +/*! \file strrb.h + * Osmocom string ringbuffer handling routines. */ +/* + * (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -19,13 +20,11 @@ * */ +#pragma once + /*! \defgroup osmo_strrb Osmocom ringbuffers for log strings * @{ - */ - -/*! \file strrb.h - * Osmocom string ringbuffer handling routines - */ + * \file strrb.h */ #include #include diff --git a/include/osmocom/core/talloc.h b/include/osmocom/core/talloc.h index df7ea7f..191a463 100644 --- a/include/osmocom/core/talloc.h +++ b/include/osmocom/core/talloc.h @@ -1,4 +1,5 @@ -/* Convenience wrapper. libosmocore used to ship its own internal copy of +/*! \file talloc.h + * Convenience wrapper. libosmocore used to ship its own internal copy of * talloc, before libtalloc became a standard component on most systems */ #pragma once #include diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index a039ac8..40b39b9 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -1,3 +1,5 @@ +/*! \file timer.h + * Osmocom timer handling routines. */ /* * (C) 2008, 2009 by Holger Hans Peter Freyther * All Rights Reserved @@ -33,11 +35,7 @@ * - osmo_timers_update() will call the callbacks and * remove the timers. * @{ - */ - -/*! \file timer.h - * Osmocom timer handling routines. - */ + * \file timer.h */ #pragma once diff --git a/include/osmocom/core/timer_compat.h b/include/osmocom/core/timer_compat.h index 44259af..77d4ce0 100644 --- a/include/osmocom/core/timer_compat.h +++ b/include/osmocom/core/timer_compat.h @@ -1,3 +1,6 @@ +/*! \file timer_compat.h + * Compatibility header with some helpers + */ /* * (C) 2011 Sylvain Munaut * All Rights Reserved @@ -20,11 +23,7 @@ /*! \defgroup timer Osmocom timers * @{ - */ - -/*! \file timer_compat.h - * Compatibility header with some helpers - */ + * \file timer_compat.h */ #pragma once diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index ce49cbe..855e653 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -5,9 +5,7 @@ /*! \defgroup utils General-purpose utility functions * @{ - */ - -/*! \file utils.h */ + * \file utils.h */ /*! Determine number of elements in an array of static size */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/include/osmocom/core/write_queue.h b/include/osmocom/core/write_queue.h index 27d090d..2303f87 100644 --- a/include/osmocom/core/write_queue.h +++ b/include/osmocom/core/write_queue.h @@ -1,4 +1,5 @@ -/* Generic write queue implementation */ +/*! \file write_queue.h + * Generic write queue implementation */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves @@ -24,10 +25,7 @@ /*! \defgroup write_queue Osmocom msgb write queues * @{ - */ - -/*! \file write_queue.h - */ + * \file write_queue.h */ #include #include diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index af4ae15..2f88a3a 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -2,9 +2,7 @@ /*! \addtogroup auth * @{ - */ - -/*! \file auth.h */ + * \file auth.h */ #include diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index c302f10..20f0514 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -1,3 +1,5 @@ +/*! \file gprs_cipher.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 3cef9d8..77532e6 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -1,3 +1,5 @@ +/*! \file control_cmd.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h index 4cd3369..6e49742 100644 --- a/include/osmocom/ctrl/control_if.h +++ b/include/osmocom/ctrl/control_if.h @@ -1,3 +1,5 @@ +/*! \file control_if.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_vty.h b/include/osmocom/ctrl/control_vty.h index d0ef69f..af9ee99 100644 --- a/include/osmocom/ctrl/control_vty.h +++ b/include/osmocom/ctrl/control_vty.h @@ -1,3 +1,5 @@ +/*! \file control_vty.h */ + #pragma once /* Add the 'ctrl' section to VTY, containing the 'bind' command. */ diff --git a/include/osmocom/ctrl/ports.h b/include/osmocom/ctrl/ports.h index d28066e..f974daf 100644 --- a/include/osmocom/ctrl/ports.h +++ b/include/osmocom/ctrl/ports.h @@ -1,6 +1,4 @@ -#pragma once - -/* +/*! \file ports.h * TCP port numbers used for CTRL interfaces in osmocom projects. See also the * osmocom wiki as well as the osmo-gsm-manuals, which should all be kept in * sync with this file: @@ -8,6 +6,8 @@ * https://git.osmocom.org/osmo-gsm-manuals/tree/common/chapters/port_numbers.adoc */ +#pragma once + #define OSMO_CTRL_PORT_BTS 4238 #define OSMO_CTRL_PORT_NITB_BSC 4249 #define OSMO_CTRL_PORT_BSC_NAT 4250 diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index 0e9f7d6..2dead69 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -1,3 +1,5 @@ +/*! \file gprs_bssgp.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index d79b210..9374e73 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -1,11 +1,7 @@ -#pragma once - -#include -#include - -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2012 by Harald Welte +/*! \file gprs_bssgp_bss.h + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ +/* + * (C) 2009-2012 by Harald Welte * * All Rights Reserved * @@ -24,6 +20,10 @@ * */ +#pragma once + +#include +#include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); diff --git a/include/osmocom/gprs/gprs_msgb.h b/include/osmocom/gprs/gprs_msgb.h index 9ccc9a5..43471e2 100644 --- a/include/osmocom/gprs/gprs_msgb.h +++ b/include/osmocom/gprs/gprs_msgb.h @@ -1,3 +1,5 @@ +/*! \file gprs_msgb.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 5ecaed8..938ad99 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -1,3 +1,5 @@ +/*! \file gprs_ns.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_ns_frgre.h b/include/osmocom/gprs/gprs_ns_frgre.h index 72ef7d1..d48ce08 100644 --- a/include/osmocom/gprs/gprs_ns_frgre.h +++ b/include/osmocom/gprs/gprs_ns_frgre.h @@ -1,3 +1,5 @@ +/*! \file gprs_ns_frgre.h */ + #pragma once int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg); diff --git a/include/osmocom/gprs/gprs_rlc.h b/include/osmocom/gprs/gprs_rlc.h index 5765281..05d3de6 100644 --- a/include/osmocom/gprs/gprs_rlc.h +++ b/include/osmocom/gprs/gprs_rlc.h @@ -1,3 +1,5 @@ +/*! \file gprs_rlc.h */ + #pragma once #include diff --git a/include/osmocom/gprs/protocol/gsm_04_60.h b/include/osmocom/gprs/protocol/gsm_04_60.h index 42028bd..96e9ab7 100644 --- a/include/osmocom/gprs/protocol/gsm_04_60.h +++ b/include/osmocom/gprs/protocol/gsm_04_60.h @@ -1,10 +1,11 @@ -#pragma once - -/* General Packet Radio Service (GPRS) +/*! \file gsm_04_60.h + * General Packet Radio Service (GPRS). * Radio Link Control / Medium Access Control (RLC/MAC) protocol * 3GPP TS 04.60 version 8.27.0 Release 1999 */ +#pragma once + #include #if OSMO_IS_LITTLE_ENDIAN == 1 diff --git a/include/osmocom/gprs/protocol/gsm_08_16.h b/include/osmocom/gprs/protocol/gsm_08_16.h index c3dbe69..fc74336 100644 --- a/include/osmocom/gprs/protocol/gsm_08_16.h +++ b/include/osmocom/gprs/protocol/gsm_08_16.h @@ -1,16 +1,15 @@ -#pragma once - -/* GPRS Networks Service (NS) messages on the Gb interface +/*! \file gsm_08_16.h + * GPRS Networks Service (NS) messages on the Gb interface. * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * 3GPP TS 48.016 version 6.5.0 Release 6 / ETSI TS 148 016 V6.5.0 (2005-11) */ + +#pragma once #include /*! \addtogroup libgb * @{ - */ - -/*! \file gprs_ns.h */ + * \file gprs_ns.h */ /*! Common header of GPRS NS */ struct gprs_ns_hdr { diff --git a/include/osmocom/gprs/protocol/gsm_08_18.h b/include/osmocom/gprs/protocol/gsm_08_18.h index 8bc9a8e..3179455 100644 --- a/include/osmocom/gprs/protocol/gsm_08_18.h +++ b/include/osmocom/gprs/protocol/gsm_08_18.h @@ -1,3 +1,5 @@ +/*! \file gsm_08_18.h */ + #pragma once #include diff --git a/include/osmocom/gsm/a5.h b/include/osmocom/gsm/a5.h index 893fb02..fae3fdd 100644 --- a/include/osmocom/gsm/a5.h +++ b/include/osmocom/gsm/a5.h @@ -1,6 +1,6 @@ +/*! \file gsm/a5.h + * Osmocom GSM A5 ciphering algorithm header. */ /* - * a5.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -29,11 +29,7 @@ /*! \defgroup a5 GSM A5 ciphering algorithm * @{ - */ - -/*! \file gsm/a5.h - * Osmocom GSM A5 ciphering algorithm header - */ + * \file a5.h */ /*! Converts a frame number into the 22 bit number used in A5/x * \param[in] fn The true framenumber diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index acddb7f..e031ee1 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -1,14 +1,12 @@ #pragma once -/*! \defgroup oml A-bis OML - * @{ - */ - #include #include #include -/*! \file abis_nm.h */ +/*! \defgroup oml A-bis OML + * @{ + * \file abis_nm.h */ extern const char abis_nm_ipa_magic[13]; extern const char abis_nm_osmo_magic[12]; diff --git a/include/osmocom/gsm/apn.h b/include/osmocom/gsm/apn.h index b4ece3a..8d35324 100644 --- a/include/osmocom/gsm/apn.h +++ b/include/osmocom/gsm/apn.h @@ -1,3 +1,5 @@ +/*! \file apn.h */ + #pragma once #include diff --git a/include/osmocom/gsm/bitvec_gsm.h b/include/osmocom/gsm/bitvec_gsm.h index 20741ef..32f0cd2 100644 --- a/include/osmocom/gsm/bitvec_gsm.h +++ b/include/osmocom/gsm/bitvec_gsm.h @@ -5,8 +5,7 @@ /*! \defgroup bitvec helpers for GSM * @{ - */ -/*! \file bitvec_gsm.h */ + * \file bitvec_gsm.h */ void bitvec_add_range1024(struct bitvec *bv, const struct gsm48_range_1024 *r); diff --git a/include/osmocom/gsm/comp128.h b/include/osmocom/gsm/comp128.h index 8ff76b1..8626f4b 100644 --- a/include/osmocom/gsm/comp128.h +++ b/include/osmocom/gsm/comp128.h @@ -1,5 +1,5 @@ -/* - * COMP128 header +/*! \file comp128.h + * COMP128 header. * * See comp128.c for details */ diff --git a/include/osmocom/gsm/comp128v23.h b/include/osmocom/gsm/comp128v23.h index 31d3933..affe8a2 100644 --- a/include/osmocom/gsm/comp128v23.h +++ b/include/osmocom/gsm/comp128v23.h @@ -1,5 +1,5 @@ -/* - * COMP128v23 header +/*! \file comp128v23.h + * COMP128v23 header. * * See comp128v23.c for details */ diff --git a/include/osmocom/gsm/gan.h b/include/osmocom/gsm/gan.h index 6f2b535..efede1d 100644 --- a/include/osmocom/gsm/gan.h +++ b/include/osmocom/gsm/gan.h @@ -1,3 +1,5 @@ +/*! \file gan.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gea.h b/include/osmocom/gsm/gea.h index 3051101..5c23d2a 100644 --- a/include/osmocom/gsm/gea.h +++ b/include/osmocom/gsm/gea.h @@ -1,5 +1,5 @@ -/* - * GEA3 header +/*! \file gea.h + * GEA3 header. * * See gea.c for details */ diff --git a/include/osmocom/gsm/gsm0341.h b/include/osmocom/gsm/gsm0341.h index 29ba3e1..2fc83e4 100644 --- a/include/osmocom/gsm/gsm0341.h +++ b/include/osmocom/gsm/gsm0341.h @@ -1,3 +1,5 @@ +/*! \file gsm0341.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 89964fa..0cd1f94 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_smc.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index bc908a7..19f9c5d 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_smr.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h index 7005010..1c51111 100644 --- a/include/osmocom/gsm/gsm0411_utils.h +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_utils.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 6ca23e9..672ffe5 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -1,3 +1,5 @@ +/*! \file gsm0480.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h index 6ee5a60..fe5cf7e 100644 --- a/include/osmocom/gsm/gsm0502.h +++ b/include/osmocom/gsm/gsm0502.h @@ -1,3 +1,5 @@ +/*! \file gsm0502.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 9be229c..4369cab 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -1,4 +1,6 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther +/*! \file gsm0808.h */ +/* + * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves * All Rights Reserved * diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..04fc041 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -1,4 +1,6 @@ -/* (C) 2016 by Sysmocom s.f.m.c. GmbH +/*! \file gsm0808_utils.h */ +/* + * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Philipp Maier diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 29e646c..2bc7583 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -1,4 +1,7 @@ +/*! \file gsm23003.h */ + #pragma once + #include /* 23.003 Chapter 12.1 */ diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 6a52c2d..424748e 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -1,3 +1,5 @@ +/*! \file gsm48.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h index 8445486..f7cc24e 100644 --- a/include/osmocom/gsm/gsm48_ie.h +++ b/include/osmocom/gsm/gsm48_ie.h @@ -1,3 +1,5 @@ +/*! \file gsm48_ie.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index e76d9ee..998f681 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -1,4 +1,5 @@ -/* GSM utility functions, e.g. coding and decoding */ +/*! \file gsm_utils.h + * GSM utility functions, e.g. coding and decoding. */ /* * (C) 2008 by Daniel Willmann * (C) 2009 by Holger Hans Peter Freyther diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 04b31d0..886ea5d 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -1,6 +1,7 @@ -/* Osmocom Generic Subscriber Update Protocol message encoder/decoder */ - -/* (C) 2014 by sysmocom s.f.m.c. GmbH, Author: Jacob Erlbeck +/*! \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 * All Rights Reserved * diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index cabee13..7e1d723 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -1,3 +1,5 @@ +/*! \file ipa.h */ + #pragma once #include diff --git a/include/osmocom/gsm/kasumi.h b/include/osmocom/gsm/kasumi.h index 222aece..d9de10b 100644 --- a/include/osmocom/gsm/kasumi.h +++ b/include/osmocom/gsm/kasumi.h @@ -1,5 +1,5 @@ -/* - * KASUMI header +/*! \file kasumi.h + * KASUMI header. * * See kasumi.c for details * The parameters are described in TS 135 202. diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 322c7ec..01f61ce 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -1,3 +1,5 @@ +/*! \file l1sap.h */ + #pragma once #include diff --git a/include/osmocom/gsm/lapd_core.h b/include/osmocom/gsm/lapd_core.h index 8d3a0f8..cfc357a 100644 --- a/include/osmocom/gsm/lapd_core.h +++ b/include/osmocom/gsm/lapd_core.h @@ -1,3 +1,6 @@ +/*! \file lapd_core.h + * primitive related stuff + */ #pragma once #include @@ -8,10 +11,7 @@ /*! \defgroup lapd LAPD implementation common part * @{ - */ - -/*! \file lapd_core.h - * primitive related stuff + * \file lapd_core.h */ /*! LAPD related primitives (L2<->L3 SAP)*/ diff --git a/include/osmocom/gsm/lapdm.h b/include/osmocom/gsm/lapdm.h index ec14cdd..e01d065 100644 --- a/include/osmocom/gsm/lapdm.h +++ b/include/osmocom/gsm/lapdm.h @@ -5,9 +5,7 @@ /*! \defgroup lapdm LAPDm implementation according to GSM TS 04.06 * @{ - */ - -/*! \file lapdm.h */ + * \file lapdm.h */ /*! LAPDm mode/role */ enum lapdm_mode { diff --git a/include/osmocom/gsm/meas_rep.h b/include/osmocom/gsm/meas_rep.h index 90c981d..79f9f06 100644 --- a/include/osmocom/gsm/meas_rep.h +++ b/include/osmocom/gsm/meas_rep.h @@ -1,3 +1,5 @@ +/*! \file meas_rep.h */ + #pragma once #include diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index 171db7a..f2450d9 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -1,3 +1,5 @@ +/*! \file mncc.h */ + #pragma once #include diff --git a/include/osmocom/gsm/oap.h b/include/osmocom/gsm/oap.h index fba22c7..ef83b79 100644 --- a/include/osmocom/gsm/oap.h +++ b/include/osmocom/gsm/oap.h @@ -1,6 +1,7 @@ -/* Osmocom Authentication Protocol message encoder/decoder */ - -/* (C) 2015-2016 by sysmocom s.f.m.c. GmbH +/*! \file oap.h + * Osmocom Authentication Protocol message encoder/decoder. */ +/* + * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Neels Hofmeyr diff --git a/include/osmocom/gsm/prim.h b/include/osmocom/gsm/prim.h index 5f61dc7..386b7d8 100644 --- a/include/osmocom/gsm/prim.h +++ b/include/osmocom/gsm/prim.h @@ -1,3 +1,5 @@ +/*! \file prim.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_03_40.h b/include/osmocom/gsm/protocol/gsm_03_40.h index 32d5c2c..a65203f 100644 --- a/include/osmocom/gsm/protocol/gsm_03_40.h +++ b/include/osmocom/gsm/protocol/gsm_03_40.h @@ -1,6 +1,7 @@ -#pragma once +/*! \file gsm_03_40.h + * GSM TS 03.40. */ -/* GSM TS 03.40 */ +#pragma once /** * 9.1.2.5 Type Of Number diff --git a/include/osmocom/gsm/protocol/gsm_03_41.h b/include/osmocom/gsm/protocol/gsm_03_41.h index 40051cd..2e0ad69 100644 --- a/include/osmocom/gsm/protocol/gsm_03_41.h +++ b/include/osmocom/gsm/protocol/gsm_03_41.h @@ -1,3 +1,6 @@ +/*! \file gsm_03_41.h + * GSM TS 03.41 definitions also TS 23.041. */ + #pragma once #include @@ -8,8 +11,6 @@ #ifndef OSMO_IS_LITTLE_ENDIAN #define OSMO_IS_LITTLE_ENDIAN 0 #endif - -/* GSM TS 03.41 definitions also TS 23.041*/ #define GSM341_MAX_PAYLOAD (GSM412_MSG_LEN-sizeof(struct gsm341_ms_message)) #define GSM341_MAX_CHARS (GSM341_MAX_PAYLOAD*8/7) diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index dd3d4dc..13c9b64 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1,3 +1,6 @@ +/*! \file gsm_04_08.h + * GSM TS 04.08 definitions. */ + #pragma once #include @@ -6,7 +9,6 @@ #include #include -/* GSM TS 04.08 definitions */ struct gsm_lchan; /* Chapter 10.5.1.5 */ diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index def8dfc..13820a7 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_08_gprs.h */ + #ifndef _GSM48_GPRS_H #define _GSM48_GPRS_H diff --git a/include/osmocom/gsm/protocol/gsm_04_11.h b/include/osmocom/gsm/protocol/gsm_04_11.h index 651adca..31f25ac 100644 --- a/include/osmocom/gsm/protocol/gsm_04_11.h +++ b/include/osmocom/gsm/protocol/gsm_04_11.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_11.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_04_12.h b/include/osmocom/gsm/protocol/gsm_04_12.h index 30d6e4f..826e69b 100644 --- a/include/osmocom/gsm/protocol/gsm_04_12.h +++ b/include/osmocom/gsm/protocol/gsm_04_12.h @@ -1,8 +1,9 @@ +/*! \file gsm_04_12.h + * GSM TS 04.12 definitions for Short Message Service Cell Broadcast. */ + #pragma once #include - -/* GSM TS 04.12 definitions for Short Message Service Cell Broadcast */ #define GSM412_MSG_LEN 88 /* TS 04.12 Section 3.1 */ #define GSM412_BLOCK_LEN 22 /* TS 04.12 Section 3.1 */ diff --git a/include/osmocom/gsm/protocol/gsm_04_14.h b/include/osmocom/gsm/protocol/gsm_04_14.h index 421b56f..6f7d92c 100644 --- a/include/osmocom/gsm/protocol/gsm_04_14.h +++ b/include/osmocom/gsm/protocol/gsm_04_14.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_14.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_04_80.h b/include/osmocom/gsm/protocol/gsm_04_80.h index 2aebb46..e204c50 100644 --- a/include/osmocom/gsm/protocol/gsm_04_80.h +++ b/include/osmocom/gsm/protocol/gsm_04_80.h @@ -1,6 +1,7 @@ -#pragma once +/*! \file gsm_04_80.h + * GSM TS 04.80 definitions (Supplementary Services Specification, Formats and Coding). */ -/* GSM TS 04.80 definitions (Supplementary Services Specification, Formats and Coding) */ +#pragma once /* Section 3.4 */ #define GSM0480_MTYPE_RELEASE_COMPLETE 0x2A diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index c76cf3b..bc70b93 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -1,9 +1,8 @@ -#pragma once - -/* GSM Radio Signalling Link messages on the A-bis interface +/*! \file gsm_08_58.h + * GSM Radio Signalling Link messages on the A-bis interface. * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ - -/* (C) 2008 by Harald Welte +/* + * (C) 2008 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -22,13 +21,13 @@ * */ +#pragma once + #include /*! \addtogroup rsl * @{ - */ - -/*! \file gsm_08_58.h */ + * \file gsm_08_58.h */ /*! RSL common header */ struct abis_rsl_common_hdr { diff --git a/include/osmocom/gsm/protocol/gsm_09_02.h b/include/osmocom/gsm/protocol/gsm_09_02.h index 3f68b45..0b54fb7 100644 --- a/include/osmocom/gsm/protocol/gsm_09_02.h +++ b/include/osmocom/gsm/protocol/gsm_09_02.h @@ -1,7 +1,8 @@ +/*! \file gsm_09_02.h + * GSM TS 09.02 definitions (MAP). */ + #ifndef PROTO_GSM_09_02_H #define PROTO_GSM_09_02_H - -/* GSM TS 09.02 definitions (MAP) */ /* Section 17.7.4 */ /* SS-Status */ diff --git a/include/osmocom/gsm/protocol/gsm_12_21.h b/include/osmocom/gsm/protocol/gsm_12_21.h index 1bdee9c..3ef3603 100644 --- a/include/osmocom/gsm/protocol/gsm_12_21.h +++ b/include/osmocom/gsm/protocol/gsm_12_21.h @@ -1,9 +1,5 @@ -#pragma once - -/* GSM Network Management messages on the A-bis interface - * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ - -/* (C) 2008-2009 by Harald Welte +/* + * (C) 2008-2009 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -22,11 +18,11 @@ * */ +#pragma once + /*! \addtogroup oml * @{ - */ - -/*! \file gsm_12_21.h */ + * \file gsm_12_21.h */ #include #include diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index a2109b6..94243fe 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -1,3 +1,5 @@ +/*! \file gsm_23_003.h */ + #pragma once /* Chapter 2.2 */ diff --git a/include/osmocom/gsm/protocol/gsm_44_318.h b/include/osmocom/gsm/protocol/gsm_44_318.h index 5d7f878..76e8396 100644 --- a/include/osmocom/gsm/protocol/gsm_44_318.h +++ b/include/osmocom/gsm/protocol/gsm_44_318.h @@ -1,8 +1,9 @@ +/*! \file gsm_44_318.h + * Definitions according to 3GPP TS 44.318 6.8.0 Release 6. */ + #pragma once #include - -/* Definitions according to 3GPP TS 44.318 6.8.0 Release 6 */ /* Table 11.1.1.2.1: Protocol Discriminator */ enum gan_pdisc { diff --git a/include/osmocom/gsm/protocol/ipaccess.h b/include/osmocom/gsm/protocol/ipaccess.h index ba6cb3b..0f5d54f 100644 --- a/include/osmocom/gsm/protocol/ipaccess.h +++ b/include/osmocom/gsm/protocol/ipaccess.h @@ -1,3 +1,5 @@ +/*! \file ipaccess.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/smpp34_osmocom.h b/include/osmocom/gsm/protocol/smpp34_osmocom.h index cff6adb..7c72ac8 100644 --- a/include/osmocom/gsm/protocol/smpp34_osmocom.h +++ b/include/osmocom/gsm/protocol/smpp34_osmocom.h @@ -1,5 +1,7 @@ +/*! \file smpp34_osmocom.h + * Osmocom SMPP extensions. */ + #pragma once -/* Osmocom SMPP extensions */ /* Osmocom specific new TLV definitions */ diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 93e27a1..3d9c66f 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -7,9 +7,7 @@ /*! \defgroup rsl RSL * @{ - */ - -/*! \file rsl.h */ + * \file rsl.h */ void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type); diff --git a/include/osmocom/gsm/rxlev_stat.h b/include/osmocom/gsm/rxlev_stat.h index 7183b17..7aa35cd 100644 --- a/include/osmocom/gsm/rxlev_stat.h +++ b/include/osmocom/gsm/rxlev_stat.h @@ -1,3 +1,5 @@ +/*! \file rxlev_stat.h */ + #pragma once #define NUM_RXLEVS 32 diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index f3e0f22..8e26f99 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -1,3 +1,5 @@ +/*! \file sysinfo.h */ + #pragma once #include diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index fa3b656..c356840 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -9,8 +9,7 @@ /*! \defgroup tlv GSM L3 compatible TLV parser * @{ - */ -/*! \file tlv.h */ + * \file tlv.h */ /* Terminology / wording tag length value (in bits) diff --git a/include/osmocom/sim/class_tables.h b/include/osmocom/sim/class_tables.h index ad89d94..d5be39d 100644 --- a/include/osmocom/sim/class_tables.h +++ b/include/osmocom/sim/class_tables.h @@ -1,7 +1,6 @@ -#pragma once - -/* simtrace - tables determining APDU case for card emulation - * +/*! \file class_tables.h + * simtrace - tables determining APDU case for card emulation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -18,6 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#pragma once + #include struct osim_cla_ins_case { diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h index eb95480..680cad1 100644 --- a/include/osmocom/sim/sim.h +++ b/include/osmocom/sim/sim.h @@ -1,3 +1,7 @@ +/*! \file sim.h + * Routines for helping with SIM (ISO/IEC 7816-4 more generally) communication. + */ + #ifndef _OSMOCOM_SIM_H #define _OSMOCOM_SIM_H @@ -5,11 +9,6 @@ #include #define APDU_HDR_LEN 5 - -/*! - * \file sim.h - * Routines for helping with SIM (ISO/IEC 7816-4 more generally) communication. - */ /*! command-response pairs cases * diff --git a/include/osmocom/vty/buffer.h b/include/osmocom/vty/buffer.h index 56c28f0..b5cce8a 100644 --- a/include/osmocom/vty/buffer.h +++ b/include/osmocom/vty/buffer.h @@ -1,5 +1,6 @@ +/*! \file buffer.h + * Buffering to output and input. */ /* - * Buffering to output and input. * Copyright (C) 1998 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index dba76ef..2444eb8 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -1,5 +1,6 @@ +/*! \file command.h + * Zebra configuration command interface routine. */ /* - * Zebra configuration command interface routine * Copyright (C) 1997, 98 Kunihiro Ishiguro * * This file is part of GNU Zebra. @@ -28,8 +29,7 @@ /*! \defgroup command VTY Command * @{ - */ -/*! \file command.h */ + * \file command.h */ /*! Host configuration variable */ struct host { diff --git a/include/osmocom/vty/logging.h b/include/osmocom/vty/logging.h index 544d117..9bafb98 100644 --- a/include/osmocom/vty/logging.h +++ b/include/osmocom/vty/logging.h @@ -1,3 +1,5 @@ +/*! \file logging.h */ + #pragma once #define LOGGING_STR "Configure log message to this terminal\n" diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index b3fb644..545955c 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -1,3 +1,5 @@ +/*! \file misc.h */ + #pragma once #include diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index a6043b3..8f8ef75 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -1,6 +1,4 @@ -#pragma once - -/* +/*! \file ports.h * TCP port numbers used for VTY interfaces in osmocom projects. See also the * osmocom wiki as well as the osmo-gsm-manuals, which should all be kept in * sync with this file: @@ -8,6 +6,8 @@ * https://git.osmocom.org/osmo-gsm-manuals/tree/common/chapters/port_numbers.adoc */ +#pragma once + /* 4238 used by osmo-bts control interface */ #define OSMO_VTY_PORT_STP 4239 #define OSMO_VTY_PORT_PCU 4240 /* also: osmo_pcap_client */ diff --git a/include/osmocom/vty/stats.h b/include/osmocom/vty/stats.h index 3851b4d..7629928 100644 --- a/include/osmocom/vty/stats.h +++ b/include/osmocom/vty/stats.h @@ -1,3 +1,5 @@ +/*! \file stats.h */ + #pragma once void osmo_stats_vty_add_cmds(); diff --git a/include/osmocom/vty/telnet_interface.h b/include/osmocom/vty/telnet_interface.h index bca9156..d653466 100644 --- a/include/osmocom/vty/telnet_interface.h +++ b/include/osmocom/vty/telnet_interface.h @@ -1,5 +1,7 @@ -/* minimalistic telnet/network interface it might turn into a wire interface */ -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file telnet_interface.h + * minimalistic telnet/network interface it might turn into a wire interface */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -27,9 +29,7 @@ /*! \defgroup telnet_interface Telnet Interface * @{ - */ - -/*! \file telnet_interface.h */ + * \file telnet_interface.h */ /*! A telnet connection */ struct telnet_connection { diff --git a/include/osmocom/vty/vector.h b/include/osmocom/vty/vector.h index c00804d..0a639ad 100644 --- a/include/osmocom/vty/vector.h +++ b/include/osmocom/vty/vector.h @@ -1,5 +1,6 @@ +/*! \file vector.h + * Generic vector interface header. */ /* - * Generic vector interface header. * Copyright (C) 1997, 98 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index d59f5d4..544e1fa 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -5,8 +5,7 @@ /*! \defgroup vty VTY (Virtual TTY) interface * @{ - */ -/*! \file vty.h */ + * \file vty.h */ /* GCC have printf type attribute check. */ #ifdef __GNUC__ diff --git a/src/application.c b/src/application.c index e7c8e0f..aec3fd7 100644 --- a/src/application.c +++ b/src/application.c @@ -1,4 +1,5 @@ -/* Utility functions to setup applications */ +/*! \file application.c + * Routines for helping with the osmocom application setup. */ /* * (C) 2010 by Harald Welte * (C) 2011 by Holger Hans Peter Freyther @@ -19,10 +20,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - */ - -/*! \file application.c - * Routines for helping with the osmocom application setup. */ /*! \mainpage libosmocore Documentation diff --git a/src/backtrace.c b/src/backtrace.c index 0240a75..5ce7482 100644 --- a/src/backtrace.c +++ b/src/backtrace.c @@ -1,3 +1,5 @@ +/*! \file backtrace.c + * Routines related to generating call back traces. */ /* * (C) 2009 by Holger Hans Peter Freyther * (C) 2012 by Harald Welte @@ -18,10 +20,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - */ - -/*! \file backtrace.c - * Routines realted to generating call back traces */ #include diff --git a/src/bitcomp.c b/src/bitcomp.c index acf165e..94f60eb 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -1,6 +1,7 @@ -/* bit compression routines */ - -/* (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev +/*! \file bitcomp.c + * Osmocom bit compression routines */ +/* + * (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev * * All Rights Reserved * @@ -22,11 +23,7 @@ /*! \defgroup bitcomp Bit compression * @{ - */ - -/*! \file bitcomp.c - * Osmocom bit compression routines - */ + * \file bitcomp.c */ #include #include diff --git a/src/bits.c b/src/bits.c index 45ac8e2..af09441 100644 --- a/src/bits.c +++ b/src/bits.c @@ -26,11 +26,9 @@ /*! \addtogroup bits * @{ - * Osmocom bit level support code - */ - -/*! \file bits.c */ - + * Osmocom bit level support code. + * + * \file bits.c */ /*! convert unpacked bits to packed bits, return length in bytes * \param[out] out output buffer of packed bits diff --git a/src/bitvec.c b/src/bitvec.c index 8ed7296..f07b42c 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -1,5 +1,3 @@ -/* bit vector utility routines */ - /* (C) 2009 by Harald Welte * (C) 2012 Ivan Klyuchnikov * (C) 2015 by Sysmocom s.f.m.c. GmbH @@ -24,10 +22,17 @@ /*! \addtogroup bitvec * @{ - * Osmocom bit vector abstraction - */ - -/*! \file bitvec.c */ + * Osmocom bit vector abstraction utility routines. + * + * These functions assume a MSB (most significant bit) first layout of the + * bits, so that for instance the 5 bit number abcde (a is MSB) can be + * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count + * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). + * Note that there are other incompatible encodings, like it is used + * for the EGPRS RLC data block headers (there the bits are numbered from LSB + * to MSB). + * + * \file bitvec.c */ #include #include diff --git a/src/codec/gsm610.c b/src/codec/gsm610.c index df56583..d5a2110 100644 --- a/src/codec/gsm610.c +++ b/src/codec/gsm610.c @@ -1,5 +1,5 @@ -/* GSM 06.10 - GSM FR codec */ - +/*! \file gsm610.c + * GSM 06.10 - GSM FR codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c index 3064748..b1a0b31 100644 --- a/src/codec/gsm620.c +++ b/src/codec/gsm620.c @@ -1,5 +1,5 @@ -/* GSM 06.20 - GSM HR codec */ - +/*! \file gsm620.c + * GSM 06.20 - GSM HR codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm660.c b/src/codec/gsm660.c index 6c9215f..2f5c6a2 100644 --- a/src/codec/gsm660.c +++ b/src/codec/gsm660.c @@ -1,5 +1,5 @@ -/* GSM 06.60 - GSM EFR Codec */ - +/*! \file gsm660.c + * GSM 06.60 - GSM EFR Codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c index 74655bf..1ee74d0 100644 --- a/src/codec/gsm690.c +++ b/src/codec/gsm690.c @@ -1,5 +1,5 @@ -/* GSM 06.90 - GSM AMR Codec */ - +/*! \file gsm690.c + * GSM 06.90 - GSM AMR Codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index bb86b2c..5213dc5 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -100,9 +100,8 @@ * various other modules (mapping, parity, interleaving) in order to * implement the complete channel coding (and decoding) chain for the * various channel types as defined in TS 05.03 / 45.003. - */ - -/*! \file gsm0503_coding.c */ + * + * \file gsm0503_coding.c */ /* * EGPRS coding limits diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 19e6847..b42f242 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -29,16 +29,12 @@ /*! \addtogroup interleaving * @{ - * GSM TS 05.03 interleaving + * GSM TS 05.03 interleaving * - * This module contains interleaving / de-interleaving routines for - * various channel types, as defined in 3GPP TS 05.03 / 45.003 - */ - -/*! \file gsm0503_interleaving.c */ - -/* - * GSM xCCH interleaving and burst mapping + * This module contains interleaving / de-interleaving routines for + * various channel types, as defined in 3GPP TS 05.03 / 45.003. + * + * GSM xCCH interleaving and burst mapping: * * Interleaving: * @@ -57,7 +53,30 @@ * e(B, 58) = h_n(B) * * Where hl(B) and hn(B) are bits in burst B indicating flags. - */ + * + * GSM TCH HR/AHS interleaving and burst mapping: + * + * Interleaving: + * + * Given 288 coded input bits, form 4 blocks of 114 bits, + * where even bits of the first 2 blocks and odd bits of the last 2 blocks + * are used: + * + * i(B, j) = c(n, k) k = 0, ..., 227 + * n = 0, ..., N, N + 1, ... + * B = B_0 + 2n + b + * j, b = table[k]; + * + * Mapping on Burst: + * + * e(B, j) = i(B, j) + * e(B, 59 + j) = i(B, 57 + j) j = 0, ..., 56 + * e(B, 57) = h_l(B) + * e(B, 58) = h_n(B) + * + * Where hl(B) and hn(B) are bits in burst B indicating flags. + * + * \file gsm0503_interleaving.c */ /*! De-Interleave burst bits according to TS 05.03 4.1.4 * \param[out] cB caller-allocated output buffer for 456 soft coded bits @@ -632,30 +651,6 @@ iB[B * 114 + j] = cB[k]; } } - -/* - * GSM TCH HR/AHS interleaving and burst mapping - * - * Interleaving: - * - * Given 288 coded input bits, form 4 blocks of 114 bits, - * where even bits of the first 2 blocks and odd bits of the last 2 blocks - * are used: - * - * i(B, j) = c(n, k) k = 0, ..., 227 - * n = 0, ..., N, N + 1, ... - * B = B_0 + 2n + b - * j, b = table[k]; - * - * Mapping on Burst: - * - * e(B, j) = i(B, j) - * e(B, 59 + j) = i(B, 57 + j) j = 0, ..., 56 - * e(B, 57) = h_l(B) - * e(B, 58) = h_n(B) - * - * Where hl(B) and hn(B) are bits in burst B indicating flags. - */ /*! GSM TCH HR/AHS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 228 unpacked output bits diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 15fd1b6..d414769 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -32,9 +32,8 @@ * * This module contains burst mapping routines as specified in 3GPP TS * 05.03 / 45.003. - */ - -/*! \file gsm0503_mapping.c */ + * + * \file gsm0503_mapping.c */ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn) diff --git a/src/coding/gsm0503_parity.c b/src/coding/gsm0503_parity.c index cc81702..b57caa3 100644 --- a/src/coding/gsm0503_parity.c +++ b/src/coding/gsm0503_parity.c @@ -31,9 +31,8 @@ * * This module contains parity/crc code definitions for the various * parity/crc schemes as defined in 3GPP TS 05.03 / 45.003 - */ - -/*! \file gsm0503_parity.c */ + * + * \file gsm0503_parity.c */ /*! GSM (SACCH) parity (FIRE code) * diff --git a/src/coding/gsm0503_tables.c b/src/coding/gsm0503_tables.c index 32d12ea..dda8cad 100644 --- a/src/coding/gsm0503_tables.c +++ b/src/coding/gsm0503_tables.c @@ -27,14 +27,13 @@ /*! \addtogroup tables * @{ * - * GSM TS 05.03 tables + * GSM TS 05.03 tables. * * This module contains various tables defining parts of 3GPP TS 05.03 * / 45.003, primarily for the purpose of (de)puncturing, interleaving, * etc. - */ - -/*! \file gsm0503_tables.c */ + * + * \file gsm0503_tables.c */ const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8] = { { 1,1, 1,1, 1,1, 1,1 }, diff --git a/src/conv.c b/src/conv.c index 38ce173..420acca 100644 --- a/src/conv.c +++ b/src/conv.c @@ -1,8 +1,6 @@ +/*! \file conv.c + * Generic convolutional encoding / decoding. */ /* - * conv.c - * - * Generic convolutional encoding / decoding - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,10 +22,10 @@ /*! \addtogroup conv * @{ - * Osmocom convolutional encoder and decoder - */ + * Osmocom convolutional encoder and decoder. + * + * \file conv.c */ -/*! \file conv.c */ #include "config.h" #ifdef HAVE_ALLOCA_H #include diff --git a/src/conv_acc.c b/src/conv_acc.c index 13b220b..048bbb1 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -1,6 +1,6 @@ +/*! \file conv_acc.c + * Accelerated Viterbi decoder implementation. */ /* - * Accelerated Viterbi decoder implementation - * * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_generic.c b/src/conv_acc_generic.c index a4787e3..228f3e2 100644 --- a/src/conv_acc_generic.c +++ b/src/conv_acc_generic.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_generic.c * Accelerated Viterbi decoder implementation - * for generic architectures without SSE support - * + * for generic architectures without SSE support. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse.c b/src/conv_acc_sse.c index bcc9d48..e9bbde1 100644 --- a/src/conv_acc_sse.c +++ b/src/conv_acc_sse.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_sse.c * Accelerated Viterbi decoder implementation - * for architectures with only SSE3 available - * + * for architectures with only SSE3 available. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse_avx.c b/src/conv_acc_sse_avx.c index 2ad353a..c399719 100644 --- a/src/conv_acc_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_sse_avx.c * Accelerated Viterbi decoder implementation - * for architectures with both SSE3 and AVX2 support - * + * for architectures with both SSE3 and AVX2 support. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index a62f910..e6eaaa6 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -1,8 +1,8 @@ -/* - * Accelerated Viterbi decoder implementation +/*! \file conv_acc_sse_impl.h + * Accelerated Viterbi decoder implementation: * Actual definitions which are being included - * from both conv_acc_sse.c and conv_acc_sse_avx.c - * + * from both conv_acc_sse.c and conv_acc_sse_avx.c. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/crc16.c b/src/crc16.c index 7d523b6..b5cb956 100644 --- a/src/crc16.c +++ b/src/crc16.c @@ -1,4 +1,4 @@ -/* +/*! \file crc16.c * This was copied from the linux kernel and adjusted for our types. */ /* diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index 1a69e85..b04fa68 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -1,8 +1,6 @@ +/*! \file crcXXgen.c + * Osmocom generic CRC routines (for max XX bits poly). */ /* - * crcXXgen.c - * - * Generic CRC routines (for max XX bits poly) - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,12 +22,9 @@ /*! \addtogroup crcgen * @{ - * \brief Osmocom generic CRC routines - */ - -/*! \file crcXXgen.c - * Osmocom generic CRC routines (for max XX bits poly) - */ + * Osmocom generic CRC routines. + * + * \file crcXXgen.c.tpl */ #include diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index d706995..836bb71 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -1,5 +1,6 @@ -/* SNMP-like status interface - * +/*! \file control_cmd.c + * SNMP-like status interface. */ +/* * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves * diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 5d04cdf..47efb25 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -1,5 +1,6 @@ -/* SNMP-like status interface - * +/*! \file control_if.c + * SNMP-like status interface. */ +/* * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves * diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index a67dbe2..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -1,5 +1,6 @@ -/* VTY configuration for Control interface - * +/*! \file control_vty.c + * VTY configuration for Control interface. */ +/* * (C) 2016 by sysmocom s.m.f.c. GmbH * * All Rights Reserved diff --git a/src/ctrl/fsm_ctrl_commands.c b/src/ctrl/fsm_ctrl_commands.c index 6c3ecde..38fbd1e 100644 --- a/src/ctrl/fsm_ctrl_commands.c +++ b/src/ctrl/fsm_ctrl_commands.c @@ -1,3 +1,5 @@ +/*! \file fsm_ctrl_commands.c */ + #include #include diff --git a/src/fsm.c b/src/fsm.c index ecf7371..d0e6150 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -1,5 +1,6 @@ -/* Osmocom generic Finite State Machine implementation - * +/*! \file fsm.c + * Osmocom generic Finite State Machine implementation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -81,9 +82,8 @@ * * In order to attach private state to the \ref osmo_fsm_inst, it * offers an opaque priv pointer. - */ - -/*! \file fsm.c */ + * + * \file fsm.c */ LLIST_HEAD(osmo_g_fsms); static bool fsm_log_addr = true; diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c index 5848a11..5de5135 100644 --- a/src/gb/common_vty.c +++ b/src/gb/common_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC VTY common helpers */ -/* (C) 2009-2012 by Harald Welte +/*! \file common_vty.c + * OpenBSC VTY common helpers. */ +/* + * (C) 2009-2012 by Harald Welte * (C) 2009-2010 by Holger Hans Peter Freyther * All Rights Reserved * diff --git a/src/gb/common_vty.h b/src/gb/common_vty.h index 8c6b9ab..a0674a7 100644 --- a/src/gb/common_vty.h +++ b/src/gb/common_vty.h @@ -1,3 +1,5 @@ +/*! \file common_vty.h */ + #include #include diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 142f589..518198f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index f41c4a4..d9f04c5 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp_bss.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c index 88916c1..78a11a3 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp_util.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f3f354c..703d130 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -1,6 +1,7 @@ -/* VTY interface for our GPRS BSS Gateway Protocol (BSSGP) implementation */ - -/* (C) 2010 by Harald Welte +/*! \file gprs_bssgp_vty.c + * VTY interface for our GPRS BSS Gateway Protocol (BSSGP) implementation. */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 51d1c3c..d20ed23 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1,7 +1,8 @@ -/* GPRS Networks Service (NS) messages on the Gb interface - * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) */ - -/* (C) 2009-2012 by Harald Welte +/*! \file gprs_ns.c + * GPRS Networks Service (NS) messages on the Gb interface. + * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05). */ +/* + * (C) 2009-2012 by Harald Welte * * All Rights Reserved * @@ -22,11 +23,7 @@ /*! \addtogroup libgb * @{ - */ - -/*! \file gprs_ns.c */ - -/*! + * * GPRS Networks Service (NS) messages on the Gb interface * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * @@ -36,30 +33,31 @@ * do much, apart from providing congestion notification and status indication. * * Terms: - * NS Network Service - * NSVC NS Virtual Connection - * NSEI NS Entity Identifier - * NSVL NS Virtual Link - * NSVLI NS Virtual Link Identifier - * BVC BSSGP Virtual Connection - * BVCI BSSGP Virtual Connection Identifier - * NSVCG NS Virtual Connection Goup - * Blocked NS-VC cannot be used for user traffic - * Alive Ability of a NS-VC to provide communication * - * There can be multiple BSSGP virtual connections over one (group of) NSVC's. BSSGP will + * NS Network Service + * NSVC NS Virtual Connection + * NSEI NS Entity Identifier + * NSVL NS Virtual Link + * NSVLI NS Virtual Link Identifier + * BVC BSSGP Virtual Connection + * BVCI BSSGP Virtual Connection Identifier + * NSVCG NS Virtual Connection Goup + * Blocked NS-VC cannot be used for user traffic + * Alive Ability of a NS-VC to provide communication + * + * There can be multiple BSSGP virtual connections over one (group of) NSVC's. BSSGP will * therefore identify the BSSGP virtual connection by a BVCI passed down to NS. * NS then has to firgure out which NSVC's are responsible for this BVCI. * Those mappings are administratively configured. - */ - -/* This implementation has the following limitations: - * o Only one NS-VC for each NSE: No load-sharing function - * o NSVCI 65535 and 65534 are reserved for internal use - * o Only UDP is supported as of now, no frame relay support - * o The IP Sub-Network-Service (SNS) as specified in 48.016 is not implemented - * o There are no BLOCK and UNBLOCK timers (yet?) - */ + * + * This implementation has the following limitations: + * - Only one NS-VC for each NSE: No load-sharing function + * - NSVCI 65535 and 65534 are reserved for internal use + * - Only UDP is supported as of now, no frame relay support + * - The IP Sub-Network-Service (SNS) as specified in 48.016 is not implemented + * - There are no BLOCK and UNBLOCK timers (yet?) + * + * \file gprs_ns.c */ #include #include diff --git a/src/gb/gprs_ns_frgre.c b/src/gb/gprs_ns_frgre.c index 285a9a0..52145ff 100644 --- a/src/gb/gprs_ns_frgre.c +++ b/src/gb/gprs_ns_frgre.c @@ -1,9 +1,9 @@ -/* GPRS Networks Service (NS) messages on the Gb interface - * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) */ - -/* NS-over-FR-over-GRE implementation */ - -/* (C) 2009-2010 by Harald Welte +/*! \file gprs_ns_frgre.c + * NS-over-FR-over-GRE implementation. + * GPRS Networks Service (NS) messages on the Gb interface, + * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05). */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index bdccb3f..e320ba2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -1,6 +1,7 @@ -/* VTY interface for our GPRS Networks Service (NS) implementation */ - -/* (C) 2009-2010 by Harald Welte +/*! \file gprs_ns_vty.c + * VTY interface for our GPRS Networks Service (NS) implementation. */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/a5.c b/src/gsm/a5.c index f21554f..e906b6d 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -1,12 +1,11 @@ -/* - * a5.c - * - * Full reimplementation of A5/1,2 (split and threadsafe) +/*! \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 * * All Rights Reserved @@ -29,9 +28,8 @@ /*! \addtogroup crypto * @{ * Osmocom GSM/GPRS ciphering algorithm implementation - */ - -/*! \file gsm/a5.c */ + * + * \file gsm/a5.c */ #include #include diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 287973b..c59ebb7 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -1,7 +1,5 @@ -/* GSM Network Management (OML) messages on the A-bis interface - * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ - -/* (C) 2008-2011 by Harald Welte +/* + * (C) 2008-2011 by Harald Welte * * All Rights Reserved * @@ -22,11 +20,10 @@ /*! \addtogroup oml * @{ - * GSM Network Management (OML) messages on the A-bis interface + * GSM Network Management (OML) messages on the A-bis interface. * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 - */ - -/*! \file abis_nm.c */ + * + * \file abis_nm.c */ #include #include diff --git a/src/gsm/apn.c b/src/gsm/apn.c index ccf36b9..8d4b2bf 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -1,3 +1,5 @@ +/*! \file apn.c */ + #include #include #include diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index 3b645d2..1dddef3 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -1,7 +1,7 @@ - -/* GSM/GPRS/3G authentication core infrastructure */ - -/* (C) 2010-2011 by Harald Welte +/*! \file auth_comp128v1.c + * GSM/GPRS/3G authentication core infrastructure */ +/* + * (C) 2010-2011 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index b0900af..4d23769 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -1,9 +1,8 @@ -/* registers COMP128 version 2 and 3 A3/A8 algorithms for the - * GSM/GPRS/3G authentication core infrastructure - * - */ - -/* (C) 2010-2011 by Harald Welte +/*! \file auth_comp128v23.c + * registers COMP128 version 2 and 3 A3/A8 algorithms for the + * GSM/GPRS/3G authentication core infrastructure. */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2013 by K?vin Redon * * All Rights Reserved diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 1bdd4a8..4156695 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -1,5 +1,3 @@ -/* GSM/GPRS/3G authentication core infrastructure */ - /* (C) 2010-2012 by Harald Welte * * All Rights Reserved @@ -33,9 +31,8 @@ /*! \addtogroup auth * @{ * GSM/GPRS/3G authentication core infrastructure - */ - -/* \file auth_core.c */ + * + * \file auth_core.c */ static LLIST_HEAD(osmo_auths); diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 41e538d..8d50990 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -1,6 +1,7 @@ -/* GSM/GPRS/3G authentication core infrastructure */ - -/* (C) 2011 by Harald Welte +/*! \file auth_milenage.c + * GSM/GPRS/3G authentication core infrastructure */ +/* + * (C) 2011 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c index 78f0e07..0fcc67d 100644 --- a/src/gsm/comp128.c +++ b/src/gsm/comp128.c @@ -1,6 +1,5 @@ -/* - * COMP128 implementation - * +/*! \file comp128.c + * COMP128 v1; common/old GSM Authentication Algorithm (A3/A8). * * This code is inspired by original code from : * Marc Briceno , Ian Goldberg , @@ -11,7 +10,38 @@ * A comment snippet from the original code is included below, it describes * where the doc came from and how the algorithm was reverse engineered. * + * This code derived from a leaked document from the GSM standards. + * Some missing pieces were filled in by reverse-engineering a working SIM. + * We have verified that this is the correct COMP128 algorithm. * + * The first page of the document identifies it as + * + * _Technical Information: GSM System Security Study_. + * 10-1617-01, 10th June 1988. + * + * The bottom of the title page is marked + * + * Racal Research Ltd. + * Worton Drive, Worton Grange Industrial Estate, + * Reading, Berks. RG2 0SB, England. + * Telephone: Reading (0734) 868601 Telex: 847152 + * + * The relevant bits are in Part I, Section 20 (pages 66--67). Enjoy! + * + * Note: There are three typos in the spec (discovered by + * reverse-engineering). + * - First, "z = (2 * x[n] + x[n]) mod 2^(9-j)" should clearly read + * "z = (2 * x[m] + x[n]) mod 2^(9-j)". + * - Second, the "k" loop in the "Form bits from bytes" section is severely + * botched: the k index should run only from 0 to 3, and clearly the range + * on "the (8-k)th bit of byte j" is also off (should be 0..7, not 1..8, + * to be consistent with the subsequent section). + * - Third, SRES is taken from the first 8 nibbles of x[], not the last 8 as + * claimed in the document. (And the document doesn't specify how Kc is + * derived, but that was also easily discovered with reverse engineering.) + * All of these typos have been corrected in the following code. + */ +/* * (C) 2009 by Sylvain Munaut * * All Rights Reserved @@ -32,49 +62,12 @@ * */ -/* - * --- SNIP --- - * - * This code derived from a leaked document from the GSM standards. - * Some missing pieces were filled in by reverse-engineering a working SIM. - * We have verified that this is the correct COMP128 algorithm. - * - * The first page of the document identifies it as - * _Technical Information: GSM System Security Study_. - * 10-1617-01, 10th June 1988. - * The bottom of the title page is marked - * Racal Research Ltd. - * Worton Drive, Worton Grange Industrial Estate, - * Reading, Berks. RG2 0SB, England. - * Telephone: Reading (0734) 868601 Telex: 847152 - * The relevant bits are in Part I, Section 20 (pages 66--67). Enjoy! - * - * Note: There are three typos in the spec (discovered by - * reverse-engineering). - * First, "z = (2 * x[n] + x[n]) mod 2^(9-j)" should clearly read - * "z = (2 * x[m] + x[n]) mod 2^(9-j)". - * Second, the "k" loop in the "Form bits from bytes" section is severely - * botched: the k index should run only from 0 to 3, and clearly the range - * on "the (8-k)th bit of byte j" is also off (should be 0..7, not 1..8, - * to be consistent with the subsequent section). - * Third, SRES is taken from the first 8 nibbles of x[], not the last 8 as - * claimed in the document. (And the document doesn't specify how Kc is - * derived, but that was also easily discovered with reverse engineering.) - * All of these typos have been corrected in the following code. - * - * --- /SNIP --- - */ - #include #include /*! \addtogroup auth * @{ - */ - -/*! \file comp128.c - * COMP128 v1; common/old GSM Authentication Algorithm (A3/A8) - */ + * \file comp128.c */ /* The compression tables (just copied ...) */ static const uint8_t table_0[512] = { diff --git a/src/gsm/comp128v23.c b/src/gsm/comp128v23.c index 1797ebc..12f8a4c 100644 --- a/src/gsm/comp128v23.c +++ b/src/gsm/comp128v23.c @@ -1,11 +1,11 @@ -/* COMP128 version 2 and 3 implementation +/*! \file comp128v23.c + * COMP128 version 2 and 3 implementation, common algorithm used for GSM Authentication (A3/A8). * * This code is a C conversion of the original code from * http://www.hackingprojects.net/ - * */ - -/* (C) 2013 by K?vin Redon +/* + * (C) 2013 by K?vin Redon * * All Rights Reserved * @@ -30,11 +30,7 @@ /*! \addtogroup auth * @{ - */ - -/*! \file comp128v23.c - * COMP128 v2 / v3; Common Algorithm used for GSM Authentication (A3/A8) - */ + * \file comp128v23.c */ static const uint8_t table0[256] = { 197, 235, 60, 151, 98, 96, 3, 100, 248, 118, 42, 117, 172, 211, 181, 203, 61, diff --git a/src/gsm/gan.c b/src/gsm/gan.c index d357b7e..fae93f1 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -1,4 +1,7 @@ -/* (C) 2012 by Harald Welte +/*! \file gan.c + * Generic Access Network (GAN) / UMA according to TS 44.318. */ +/* + * (C) 2012 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -20,11 +23,6 @@ #include #include - -/*! \file gan.c - * Generic Access Network (GAN) / UMA according to TS 44.318 - */ - const struct value_string gan_msgt_vals[] = { { GA_MT_RC_DISCOVERY_REQUEST, "GA-RC DISCOVERY REQUEST" }, diff --git a/src/gsm/gea.c b/src/gsm/gea.c index d4e599c..d95c03e 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -1,8 +1,6 @@ +/*! \file gea.c + * Implementation of GEA3 and GEA4. */ /* - * gea.c - * - * Implementation of GEA3 and GEA4 - * * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved @@ -32,10 +30,7 @@ /*! \addtogroup crypto * @{ - */ - -/*! \file gsm/gea.c */ - + * \file gsm/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 diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index b833048..fc68c40 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -1,6 +1,7 @@ -/* GPRS LLC cipher core infrastructure */ - -/* (C) 2010 by Harald Welte +/*! \file gprs_cipher_core.c + * GPRS LLC cipher core infrastructure */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/gprs_gea.c b/src/gsm/gprs_gea.c index 836ee68..db3f2cc 100644 --- a/src/gsm/gprs_gea.c +++ b/src/gsm/gprs_gea.c @@ -1,8 +1,6 @@ +/*! \file gprs_gea.c + * GEA 3 & 4 plugin */ /* - * gprs_gea.c - * - * GEA 3 & 4 plugin - * * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index 4b32947..b213b26 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -1,13 +1,13 @@ +/*! \file gsm/gprs_rlc.c + * helper functions for (E)GPRS RLC according to 3GPP TS 44.060. + */ + #include #include #include #include #include - -/*! \file gsm/gprs_rlc.c - * helper functions for (E)GPRS RLC according to 3GPP TS 44.060 - */ #define EGPRS_CPS_TYPE1_TBL_SZ 29 #define EGPRS_CPS_TYPE2_TBL_SZ 8 diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 0e3e453..05a0b4a 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -1,3 +1,4 @@ +/*! \file gsm0341.c */ /* * (C) 2014 by Harald Welte * All Rights Reserved diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index dab83eb..7414e95 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_smc.c + * 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 */ - -/* (C) 2008 by Daniel Willmann + * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index d120f2d..67bb249 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_smr.c + * 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 */ - -/* (C) 2008 by Daniel Willmann +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index ef67930..7c7164c 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_utils.c + * 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 */ - -/* (C) 2008 by Daniel Willmann + * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010-2013 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0414.c b/src/gsm/gsm0414.c index 84d393d..616d7d9 100644 --- a/src/gsm/gsm0414.c +++ b/src/gsm/gsm0414.c @@ -1,3 +1,5 @@ +/*! \file gsm0414.c */ + #include #include diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 3c23f6f..557aa14 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -1,5 +1,5 @@ -/* Format functions for GSM 04.80 */ - +/*! \file gsm0480.c + * Format functions for GSM 04.80. */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2009 by Mike Haben diff --git a/src/gsm/gsm0502.c b/src/gsm/gsm0502.c index df1d8e9..6b69893 100644 --- a/src/gsm/gsm0502.c +++ b/src/gsm/gsm0502.c @@ -1,6 +1,7 @@ -/* Paging helper code */ - -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file gsm0502.c + * Paging helper code */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index f595dd6..a8a5e45 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1,4 +1,6 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther +/*! \file gsm0808.c */ +/* + * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves * All Rights Reserved * diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 5cbc44c..26c07b1 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1,4 +1,6 @@ -/* (C) 2016 by Sysmocom s.f.m.c. GmbH +/*! \file gsm0808_utils.c */ +/* + * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Philipp Maier diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 227dbef..f69eee2 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -1,7 +1,8 @@ -/* GSM Mobile Radio Interface Layer 3 messages +/*! \file gsm48.c + * GSM Mobile Radio Interface Layer 3 messages * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * (C) 2008, 2009 by Holger Hans Peter Freyther * * All Rights Reserved diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index d3a868d..105acba 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -1,7 +1,8 @@ -/* GSM Mobile Radio Interface Layer 3 messages - * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008 by Harald Welte +/*! \file gsm48_ie.c + * GSM Mobile Radio Interface Layer 3 messages. + * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0. */ +/* + * (C) 2008 by Harald Welte * (C) 2009-2010 by Andreas Eversberg * * All Rights Reserved diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 7bcef4e..43da27e 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -1,4 +1,6 @@ -/* (C) 2009-2016 by Harald Welte +/*! \file gsm_04_08_gprs.c */ +/* + * (C) 2009-2016 by Harald Welte * (C) 2010 by On-Waves * (C) 2014-2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index fd16e98..5a4ceb3 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -1,3 +1,4 @@ +/*! \file gsm_utils.c */ /* * (C) 2008 by Daniel Willmann * (C) 2009,2013 by Holger Hans Peter Freyther diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 780198c..2629eb7 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -1,5 +1,5 @@ -/* Osmocom Generic Subscriber Update Protocol message encoder/decoder */ - +/*! \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 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 2c7cf58..bc84850 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -1,6 +1,7 @@ -/* OpenBSC Abis input driver for ip.access */ - -/* (C) 2009-2017 by Harald Welte +/*! \file ipa.c + * OpenBSC Abis input driver for ip.access */ +/* + * (C) 2009-2017 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * diff --git a/src/gsm/kasumi.c b/src/gsm/kasumi.c index d5d78a7..c3a028b 100644 --- a/src/gsm/kasumi.c +++ b/src/gsm/kasumi.c @@ -1,6 +1,7 @@ -/* Kasumi cipher and KGcore functions */ - -/* (C) 2013 by Max +/*! \file kasumi.c + * Kasumi cipher and KGcore functions. */ +/* + * (C) 2013 by Max * * All Rights Reserved * diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 4ad7556..166bf9a 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1,6 +1,7 @@ -/* LAPD core implementation */ - -/* (C) 2010-2011 by Harald Welte +/*! \file lapd_core.c + * LAPD core implementation */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2010-2011 by Andreas Eversberg * * All Rights Reserved @@ -23,12 +24,9 @@ /*! \addtogroup lapd * @{ - * Osmocom LAPD core, used for Q.921, LAPDm and others - */ - -/*! \file lapd_core.c */ - -/*! + * + * Osmocom LAPD core, used for Q.921, LAPDm and others. + * * Notes on Buffering: rcv_buffer, tx_queue, tx_hist, send_buffer, send_queue * * RX data is stored in the rcv_buffer (pointer). If the message is complete, it @@ -62,6 +60,7 @@ * will not trigger T200. It will be stoped, when T200 is started in MF EST * state. It will also be stoped when leaving MF EST state. * + * \file lapd_core.c */ /* Enable this to test content resolution on network side: diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 1152e0d..db950a6 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -1,6 +1,7 @@ -/* GSM LAPDm (TS 04.06) implementation */ - -/* (C) 2010-2011 by Harald Welte +/*! \file lapdm.c + * GSM LAPDm (TS 04.06) implementation. */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2010-2011 by Andreas Eversberg * * All Rights Reserved @@ -23,10 +24,7 @@ /*! \addtogroup lapdm * @{ - * GSM LAPDm (TS 04.06) implementation - */ - -/*! \file lapdm.c */ + * \file lapdm.c */ #include #include diff --git a/src/gsm/milenage/aes-encblock.c b/src/gsm/milenage/aes-encblock.c index 8f35caa..c4aa260 100644 --- a/src/gsm/milenage/aes-encblock.c +++ b/src/gsm/milenage/aes-encblock.c @@ -1,6 +1,6 @@ +/*! \file aes-encblock.c + * AES encrypt_block. */ /* - * AES encrypt_block - * * Copyright (c) 2003-2007, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes-internal-enc.c b/src/gsm/milenage/aes-internal-enc.c index 8726aa7..4c00f96 100644 --- a/src/gsm/milenage/aes-internal-enc.c +++ b/src/gsm/milenage/aes-internal-enc.c @@ -1,5 +1,5 @@ -/* - * AES (Rijndael) cipher - encrypt +/*! \file aes-internal-enc.c + * AES (Rijndael) cipher - encrypt. * * Modifications to public domain implementation: * - support only 128-bit keys @@ -8,7 +8,8 @@ * - added option (AES_SMALL_TABLES) for reducing code size by about 8 kB at * cost of reduced throughput (quite small difference on Pentium 4, * 10-25% when using -O1 or -O2 optimization) - * + */ +/* * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes-internal.c b/src/gsm/milenage/aes-internal.c index 4161220..60c520c 100644 --- a/src/gsm/milenage/aes-internal.c +++ b/src/gsm/milenage/aes-internal.c @@ -1,5 +1,5 @@ -/* - * AES (Rijndael) cipher +/*! \file aes-internal.c + * AES (Rijndael) cipher. * * Modifications to public domain implementation: * - support only 128-bit keys @@ -8,7 +8,8 @@ * - added option (AES_SMALL_TABLES) for reducing code size by about 8 kB at * cost of reduced throughput (quite small difference on Pentium 4, * 10-25% when using -O1 or -O2 optimization) - * + */ +/* * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes.h b/src/gsm/milenage/aes.h index 7e97f61..ce42b20 100644 --- a/src/gsm/milenage/aes.h +++ b/src/gsm/milenage/aes.h @@ -1,5 +1,6 @@ +/*! \file aes.h + * AES functions */ /* - * AES functions * Copyright (c) 2003-2006, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes_i.h b/src/gsm/milenage/aes_i.h index 5d89abc..6df019a 100644 --- a/src/gsm/milenage/aes_i.h +++ b/src/gsm/milenage/aes_i.h @@ -1,5 +1,6 @@ +/*! \file aes_i.h + * AES (Rijndael) cipher. */ /* - * AES (Rijndael) cipher * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes_wrap.h b/src/gsm/milenage/aes_wrap.h index afa1451..7d4d5d9 100644 --- a/src/gsm/milenage/aes_wrap.h +++ b/src/gsm/milenage/aes_wrap.h @@ -1,12 +1,13 @@ -/* - * AES-based functions +/*! \file aes_wrap.h + * AES-based functions. * * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) * - One-Key CBC MAC (OMAC1) hash with AES-128 * - AES-128 CTR mode encryption * - AES-128 EAX mode encryption/decryption * - AES-128 CBC - * + */ +/* * Copyright (c) 2003-2007, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/common.h b/src/gsm/milenage/common.h index aaf82b9..2aa50fb 100644 --- a/src/gsm/milenage/common.h +++ b/src/gsm/milenage/common.h @@ -1,3 +1,4 @@ +/*! \file common.h */ #include #include diff --git a/src/gsm/milenage/milenage.c b/src/gsm/milenage/milenage.c index b43f986..012b399 100644 --- a/src/gsm/milenage/milenage.c +++ b/src/gsm/milenage/milenage.c @@ -1,5 +1,6 @@ +/*! \file milenage.c + * 3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) */ /* - * 3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) * Copyright (c) 2006-2007 * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/milenage.h b/src/gsm/milenage/milenage.h index 6fb779c..1a4364d 100644 --- a/src/gsm/milenage/milenage.h +++ b/src/gsm/milenage/milenage.h @@ -1,5 +1,7 @@ +/*! \file milenage.h + * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208). + */ /* - * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) * Copyright (c) 2006-2007 * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/oap.c b/src/gsm/oap.c index 88c98f7..b07eafc 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -1,6 +1,7 @@ -/* Osmocom Authentication Protocol message encoder/decoder */ - -/* (C) 2015-2016 by sysmocom s.f.m.c. GmbH +/*! \file oap.c + * Osmocom Authentication Protocol message encoder/decoder */ +/* + * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Neels Hofmeyr diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 4a1f733..e33ea10 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -1,7 +1,5 @@ -/* GSM Radio Signalling Link messages on the A-bis interface - * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * * All Rights Reserved * @@ -30,10 +28,10 @@ /*! \addtogroup rsl * @{ - * GSM Radio Signalling Link (TS 08.58) - */ - -/*! \file rsl.c */ + * GSM Radio Signalling Link messages on the A-bis interface. + * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0. + * + * \file rsl.c */ /*! Size for RSL \ref msgb_alloc */ #define RSL_ALLOC_SIZE 200 diff --git a/src/gsm/rxlev_stat.c b/src/gsm/rxlev_stat.c index d226861..2ff0ac8 100644 --- a/src/gsm/rxlev_stat.c +++ b/src/gsm/rxlev_stat.c @@ -1,6 +1,7 @@ -/* Rx Level statistics */ - -/* (C) 2010 by Harald Welte +/*! \file rxlev_stat.c + * Rx Level statistics */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/sysinfo.c b/src/gsm/sysinfo.c index 201acfc..b73bb0c 100644 --- a/src/gsm/sysinfo.c +++ b/src/gsm/sysinfo.c @@ -1,7 +1,8 @@ -/* GSM 04.08 System Information (SI) encoding and decoding +/*! \file sysinfo.c + * GSM 04.08 System Information (SI) encoding and decoding. * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index d9072c9..b1b1034 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -39,9 +39,8 @@ * particular type. Types are e.g. TV (Tag + single byte value), Tag + * fixed-length value, TLV with 8bit length, TLV with 16bit length, TLV * with variable-length length field, etc. - */ - -/*! \file tlv_parser.c */ + * + * \file tlv_parser.c */ struct tlv_definition tvlv_att_def; struct tlv_definition vtvlv_gan_att_def; diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 62bbd57..561cdb3 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -1,4 +1,5 @@ -/* GSMTAP support code in libmsomcore */ +/*! \file gsmtap_util.c + * GSMTAP support code in libosmocore. */ /* * (C) 2010-2011 by Harald Welte * @@ -43,9 +44,9 @@ /*! \addtogroup gsmtap * @{ - * GSMTAP utility routines. Encapsulates GSM messages over UDP - */ -/*! \file gsmtap_util.c */ + * GSMTAP utility routines. Encapsulates GSM messages over UDP. + * + * \file gsmtap_util.c */ /*! convert RSL channel number to GSMTAP channel type diff --git a/src/logging.c b/src/logging.c index 964128b..c8b86b1 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1,6 +1,7 @@ -/* Debugging/Logging support code */ - -/* (C) 2008-2010 by Harald Welte +/*! \file logging.c + * Debugging/Logging support code. */ +/* + * (C) 2008-2010 by Harald Welte * (C) 2008 by Holger Hans Peter Freyther * All Rights Reserved * @@ -23,9 +24,8 @@ /* \addtogroup logging * @{ * libosmocore Logging sub-system - */ - -/* \file logging.c */ + * + * \file logging.c */ #include "../config.h" diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index 9e5884b..d0aa47b 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -1,6 +1,12 @@ -/* GSMTAP network logging support code */ - -/* (C) 2016 by Harald Welte +/*! \file logging_gsmtap.c + * libosmocore log output encapsulated in GSMTAP. + * + * Encapsulating the log output inside GSMTAP frames allows us to + * observer protocol traces (of Um, Abis, A or any other interface in + * the Osmocom world) with synchronous interspersed log messages. + */ +/* + * (C) 2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,15 +27,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file logging_gsmtap.c - * libosmocore log output encapsulated in GSMTAP - * - * Encapsulating the log output inside GSMTAP frames allows us to - * observer protocol traces (of Um, Abis, A or any other interface in - * the Osmocom world) with synchronous interspersed log messages. - */ + * \file logging_gsmtap.c */ #include "../config.h" diff --git a/src/logging_syslog.c b/src/logging_syslog.c index a80a31e..d0d6a96 100644 --- a/src/logging_syslog.c +++ b/src/logging_syslog.c @@ -1,6 +1,7 @@ -/* Syslog logging support code */ - -/* (C) 2011 by Harald Welte +/*! \file logging_syslog.c + * Syslog logging support code. */ +/* + * (C) 2011 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,11 +22,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file logging_syslog.c - * libosmocore logging output via syslog - */ + * \file logging_syslog.c */ #include "../config.h" diff --git a/src/loggingrb.c b/src/loggingrb.c index 64033fc..5127a2f 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -1,6 +1,7 @@ -/* Ringbuffer-backed logging support code */ - -/* (C) 2012-2013 by Katerina Barone-Adesi +/*! \file loggingrb.c + * Ringbuffer-backed logging support code. */ +/* + * (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,11 +22,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file loggingrb.c - * libosmocore logging backend for a ring-buffer of last log messages - */ + * \file loggingrb.c */ #include #include diff --git a/src/macaddr.c b/src/macaddr.c index 6a1588d..5c68d05 100644 --- a/src/macaddr.c +++ b/src/macaddr.c @@ -1,3 +1,5 @@ +/*! \file macaddr.c + * MAC address utility routines. */ /* * (C) 2013-2014 by Harald Welte * (C) 2014 by Holger Hans Peter Freyther @@ -22,11 +24,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file macaddr.c - * MAC address utility routines - */ + * \file macaddr.c */ #include "config.h" diff --git a/src/msgb.c b/src/msgb.c index bad98f4..2e9f4a2 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -20,6 +20,7 @@ /*! \addtogroup msgb * @{ + * * libosmocore message buffers, inspired by Linux kernel skbuff * * Inspired by the 'struct skbuff' of the Linux kernel, we implement a @@ -46,9 +47,9 @@ * * prepending (pushing) and appending (putting) data * * copying / resizing * * hex-dumping to a string for debug purposes + * + * \file msgb.c */ - -/*! \file msgb.c */ #include #include diff --git a/src/msgfile.c b/src/msgfile.c index bf36bf3..8517099 100644 --- a/src/msgfile.c +++ b/src/msgfile.c @@ -1,6 +1,6 @@ +/*! \file msgfile.c + * Parse a simple file with messages, e.g used for USSD messages. */ /* - * Parse a simple file with messages, e.g used for USSD messages - * * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * All Rights Reserved diff --git a/src/panic.c b/src/panic.c index 251fdad..2a8b1ae 100644 --- a/src/panic.c +++ b/src/panic.c @@ -1,4 +1,5 @@ -/* Panic handling */ +/*! \file panic.c + * Routines for panic handling. */ /* * (C) 2010 by Sylvain Munaut * @@ -22,11 +23,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file panic.c - * Routines for panic handling - */ + * \file panic.c */ #include #include diff --git a/src/plugin.c b/src/plugin.c index b6a5a48..264171c 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,7 @@ -/* plugin infrastructure */ - -/* (C) 2010 by Harald Welte +/*! \file plugin.c + * Routines for loading and managing shared library plug-ins. */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * @@ -22,12 +23,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file plugin.c - * Routines for loading and managing shared library plug-ins. - */ - + * \file plugin.c */ #include "../config.h" diff --git a/src/prim.c b/src/prim.c index f39527f..2035581 100644 --- a/src/prim.c +++ b/src/prim.c @@ -1,3 +1,5 @@ +/*! \file prim.c */ + #include #include diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index fe7f1ed..e89b8d5 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -1,7 +1,7 @@ -/* overly simplistic talloc replacement for deeply embedded +/*! \file pseudotalloc.c + * overly simplistic talloc replacement for deeply embedded * microcontrollers. Obviously this has none of the properties of real - * talloc, it is particualrly not hierarchical at all */ - + * talloc, it is particualrly not hierarchical at all. */ #include "talloc.h" #include diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index c7127de..b0b8e27 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -1,8 +1,9 @@ -#pragma once - -/* overly simplistic talloc replacement for deeply embedded +/*! \file talloc.h + * overly simplistic talloc replacement for deeply embedded * microcontrollers. Obviously this has none of the properties of real - * talloc, it is particualrly not hierarchical at all */ + * talloc, it is particualrly not hierarchical at all. */ + +#pragma once #include #include diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 068d491..2985bbb 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,5 +1,3 @@ -/* utility routines for keeping conters about events and the event rates */ - /* (C) 2009-2010 by Harald Welte * * All Rights Reserved @@ -22,11 +20,9 @@ /*! \addtogroup rate_ctr * @{ - * conters about events and their event rates - */ - -/*! \file rate_ctr.c */ - + * Counters about events and their event rates. + * + * \file rate_ctr.c */ #include #include diff --git a/src/select.c b/src/select.c index 575fd77..f7ee424 100644 --- a/src/select.c +++ b/src/select.c @@ -1,7 +1,9 @@ -/* select filedescriptor handling, taken from: +/*! \file select.c + * select filedescriptor handling. + * Taken from: * userspace logging daemon for the iptables ULOG target - * of the linux 2.4 netfilter subsystem. - * + * of the linux 2.4 netfilter subsystem. */ +/* * (C) 2000-2009 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -37,9 +39,8 @@ /*! \addtogroup select * @{ * select() loop abstraction - */ - -/*! \file select.c */ + * + * \file select.c */ static int maxfd = 0; static LLIST_HEAD(osmo_fds); diff --git a/src/sercomm.c b/src/sercomm.c index d02b39e..07b1aa0 100644 --- a/src/sercomm.c +++ b/src/sercomm.c @@ -1,5 +1,3 @@ -/* Serial communications layer, based on HDLC */ - /* (C) 2010,2017 by Harald Welte * * All Rights Reserved @@ -22,11 +20,9 @@ /*! \addtogroup sercomm * @{ - * Serial communications layer, based on HDLC - */ - -/*! \file sercomm.c - */ + * Serial communications layer, based on HDLC. + * + * \file sercomm.c */ #include "config.h" diff --git a/src/serial.c b/src/serial.c index b8c347b..dddad88 100644 --- a/src/serial.c +++ b/src/serial.c @@ -1,8 +1,6 @@ +/*! \file serial.c + * Utility functions to deal with serial ports */ /* - * serial.c - * - * Utility functions to deal with serial ports - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -25,9 +23,8 @@ /*! \addtogroup serial * @{ * Osmocom serial port helpers - */ - -/*! \file serial.c */ + * + * \file serial.c */ #include #include diff --git a/src/signal.c b/src/signal.c index 301b021..0c56465 100644 --- a/src/signal.c +++ b/src/signal.c @@ -1,5 +1,7 @@ -/* Generic signalling/notification infrastructure */ -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file signal.c + * Generic signalling/notification infrastructure. */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -27,10 +29,9 @@ /*! \addtogroup signal * @{ - * Generic signalling/notification infrastructure - */ - -/*! \file signal.c */ + * Generic signalling/notification infrastructure. + * + * \file signal.c */ void *tall_sigh_ctx; diff --git a/src/sim/card_fs_isim.c b/src/sim/card_fs_isim.c index 339e862..1073429 100644 --- a/src/sim/card_fs_isim.c +++ b/src/sim/card_fs_isim.c @@ -1,4 +1,5 @@ -/* 3GPP ISIM specific structures / routines */ +/*! \file card_fs_isim.c + * 3GPP ISIM specific structures / routines. */ /* * (C) 2014 by Harald Welte * diff --git a/src/sim/card_fs_sim.c b/src/sim/card_fs_sim.c index 432c945..1411129 100644 --- a/src/sim/card_fs_sim.c +++ b/src/sim/card_fs_sim.c @@ -1,4 +1,5 @@ -/* classic SIM card specific structures/routines */ +/*! \file card_fs_sim.c + * classic SIM card specific structures/routines. */ /* * (C) 2012-2014 by Harald Welte * diff --git a/src/sim/card_fs_tetra.c b/src/sim/card_fs_tetra.c index 657e55f..80f3284 100644 --- a/src/sim/card_fs_tetra.c +++ b/src/sim/card_fs_tetra.c @@ -1,4 +1,5 @@ -/* TETRA SIM card specific structures/routines */ +/*! \file card_fs_tetra.c + * TETRA SIM card specific structures/routines. */ /* * (C) 2014 by Harald Welte * diff --git a/src/sim/card_fs_uicc.c b/src/sim/card_fs_uicc.c index 27afe34..8ff8936 100644 --- a/src/sim/card_fs_uicc.c +++ b/src/sim/card_fs_uicc.c @@ -1,4 +1,5 @@ -/* ETSI UICC specific structures / routines */ +/*! \file card_fs_uicc.c + * ETSI UICC specific structures / routines. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/card_fs_usim.c b/src/sim/card_fs_usim.c index 22c193f..9e9fc87 100644 --- a/src/sim/card_fs_usim.c +++ b/src/sim/card_fs_usim.c @@ -1,4 +1,5 @@ -/* 3GPP USIM specific structures / routines */ +/*! \file card_fs_usim.c + * 3GPP USIM specific structures / routines. */ /* * (C) 2012-2014 by Harald Welte * diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index c3e18d8..fcf67f0 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -1,5 +1,6 @@ -/* simtrace - tables determining APDU case for card emulation - * +/*! \file class_tables.c + * simtrace - tables determining APDU case for card emulation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify diff --git a/src/sim/core.c b/src/sim/core.c index 15a1563..8da839c 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -1,4 +1,5 @@ -/* Core routines for SIM/UICC/USIM access */ +/*! \file core.c + * Core routines for SIM/UICC/USIM access. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/gsm_int.h b/src/sim/gsm_int.h index 54a2fbf..42ccca7 100644 --- a/src/sim/gsm_int.h +++ b/src/sim/gsm_int.h @@ -1,3 +1,5 @@ +/*! \file gsm_int.h */ + #include #include diff --git a/src/sim/reader.c b/src/sim/reader.c index e7169b5..f39829b 100644 --- a/src/sim/reader.c +++ b/src/sim/reader.c @@ -1,4 +1,5 @@ -/* Card reader abstraction for libosmosim */ +/*! \file reader.c + * Card reader abstraction for libosmosim. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/reader_pcsc.c b/src/sim/reader_pcsc.c index f020142..5b29638 100644 --- a/src/sim/reader_pcsc.c +++ b/src/sim/reader_pcsc.c @@ -1,4 +1,5 @@ -/* PC/SC Card reader backend for libosmosim */ +/*! \file reader_pcsc.c + * PC/SC Card reader backend for libosmosim. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/sim_int.h b/src/sim/sim_int.h index 7b07b83..885011e 100644 --- a/src/sim/sim_int.h +++ b/src/sim/sim_int.h @@ -1,3 +1,5 @@ +/*! \file sim_int.h */ + #ifndef _SIM_INT_H #include diff --git a/src/socket.c b/src/socket.c index f033912..b74edd4 100644 --- a/src/socket.c +++ b/src/socket.c @@ -23,10 +23,9 @@ /*! \addtogroup socket * @{ - * Osmocom socket convenience functions - */ - -/*! \file socket.c */ + * Osmocom socket convenience functions. + * + * \file socket.c */ #ifdef HAVE_SYS_SOCKET_H diff --git a/src/stat_item.c b/src/stat_item.c index 3b67ba0..c073a3e 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -1,6 +1,7 @@ -/* utility routines for keeping conters about events and the event rates */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH +/*! \file stat_item.c + * utility routines for keeping conters about events and the event rates. */ +/* + * (C) 2015 by Sysmocom s.f.m.c. GmbH * (C) 2009-2010 by Harald Welte * * All Rights Reserved @@ -23,10 +24,7 @@ /*! \addtogroup osmo_stat_item * @{ - */ - -/*! \file stat_item.c */ - + * \file stat_item.c */ #include #include diff --git a/src/statistics.c b/src/statistics.c index ad069ce..fc808f5 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -1,6 +1,7 @@ -/* utility routines for keeping some statistics */ - -/* (C) 2009 by Harald Welte +/*! \file statistics.c + * utility routines for keeping some statistics. */ +/* + * (C) 2009 by Harald Welte * * All Rights Reserved * diff --git a/src/stats.c b/src/stats.c index a523259..b39ec53 100644 --- a/src/stats.c +++ b/src/stats.c @@ -1,3 +1,4 @@ +/*! \file stats.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 342bb88..6e7be73 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -1,3 +1,4 @@ +/*! \file stats_statsd.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/strrb.c b/src/strrb.c index 0c56be2..6bfb179 100644 --- a/src/strrb.c +++ b/src/strrb.c @@ -1,7 +1,21 @@ -/* Ringbuffer implementation, tailored for logging. +/*! \file strrb.c + * Ringbuffer implementation, tailored for logging. * This is a lossy ringbuffer. It keeps up to N of the newest messages, * overwriting the oldest as newer ones come in. * + * Ringbuffer assumptions, invarients, and notes: + * - start is the index of the first used index slot in the ring buffer. + * - end is the index of the next index slot in the ring buffer. + * - start == end => buffer is empty + * - Consequence: the buffer can hold at most size - 1 messages + * (if this were not the case, full and empty buffers would be indistinguishable + * given the conventions in this implementation). + * - Whenever the ringbuffer is full, start is advanced. The second oldest + * message becomes unreachable by valid indexes (end is not a valid index) + * and the oldest message is overwritten (if there was a message there, which + * is the case unless this is the first time the ringbuffer becomes full). + */ +/* * (C) 2012-2013, Katerina Barone-Adesi * All Rights Reserved * @@ -23,11 +37,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file strrb.c - * Lossy string ringbuffer for logging; keeps newest messages. - */ + * \file strrb.c */ #include #include @@ -35,19 +45,6 @@ #include #include - -/* Ringbuffer assumptions, invarients, and notes: - * - start is the index of the first used index slot in the ring buffer. - * - end is the index of the next index slot in the ring buffer. - * - start == end => buffer is empty - * - Consequence: the buffer can hold at most size - 1 messages - * (if this were not the case, full and empty buffers would be indistinguishable - * given the conventions in this implementation). - * - Whenever the ringbuffer is full, start is advanced. The second oldest - * message becomes unreachable by valid indexes (end is not a valid index) - * and the oldest message is overwritten (if there was a message there, which - * is the case unless this is the first time the ringbuffer becomes full). -*/ /*! Create an empty, initialized osmo_strrb. * \param[in] ctx The talloc memory context which should own this. @@ -57,7 +54,6 @@ * This function creates and initializes a ringbuffer. * Note that the ringbuffer stores at most rb_size - 1 messages. */ - struct osmo_strrb *osmo_strrb_create(TALLOC_CTX * ctx, size_t rb_size) { struct osmo_strrb *rb = NULL; diff --git a/src/timer.c b/src/timer.c index e18195a..bf46c24 100644 --- a/src/timer.c +++ b/src/timer.c @@ -27,9 +27,8 @@ /*! \addtogroup timer * @{ * Osmocom timer abstraction; modelled after linux kernel timers - */ - -/*! \file timer.c */ + * + * \file timer.c */ #include #include diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index b902796..734c894 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -22,10 +22,7 @@ /*! \addtogroup timer * @{ - */ - -/*! \file timer_gettimeofday.c - */ + * \file timer_gettimeofday.c */ #include #include diff --git a/src/utils.c b/src/utils.c index 2bd4c19..9e3414b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -34,9 +34,8 @@ /*! \addtogroup utils * @{ * various utility routines - */ - -/*! \file utils.c */ + * + * \file utils.c */ static char namebuf[255]; diff --git a/src/vty/buffer.c b/src/vty/buffer.c index 8862da9..1935aa1 100644 --- a/src/vty/buffer.c +++ b/src/vty/buffer.c @@ -1,5 +1,6 @@ +/*! \file buffer.c + * Buffering of output and input. */ /* - * Buffering of output and input. * Copyright (C) 1998 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/src/vty/command.c b/src/vty/command.c index a0824d3..33862c0 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -44,8 +44,8 @@ /*! \addtogroup command * @{ * VTY command handling - */ -/*! \file command.c */ + * + * \file command.c */ #define CONFIGFILE_MASK 022 diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index acc8ca6..345be66 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -1,5 +1,7 @@ -/* Osmocom FSM introspection via VTY */ -/* (C) 2016 by Harald Welte +/*! \file fsm_vty.c + * Osmocom FSM introspection via VTY. */ +/* + * (C) 2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 4cb1379..758f0b9 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC logging helper for the VTY */ -/* (C) 2009-2010 by Harald Welte +/*! \file logging_vty.c + * OpenBSC logging helper for the VTY. */ +/* + * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther * All Rights Reserved * diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 0557820..57cdd30 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC stats helper for the VTY */ -/* (C) 2009-2010 by Harald Welte +/*! \file stats_vty.c + * OpenBSC stats helper for the VTY. */ +/* + * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther * (C) 2015 by Sysmocom s.f.m.c. GmbH * All Rights Reserved diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index d59516c..f82a7ff 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -1,4 +1,5 @@ -/* minimalistic telnet/network interface it might turn into a wire interface */ +/*! \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 * @@ -44,8 +45,8 @@ * access. This telnet server gets linked into each libosmovty-using * process in order to enable interactive command-line introspection, * interaction and configuration. - */ -/*! \file telnet_interface.c */ + * + * \file telnet_interface.c */ /* per connection data */ LLIST_HEAD(active_connections); diff --git a/src/vty/utils.c b/src/vty/utils.c index 267d76e..9d1bdf9 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -1,6 +1,7 @@ -/* utility routines for printing common objects in the Osmocom world */ - -/* (C) 2009-2010 by Harald Welte +/*! \file utils.c + * Utility routines for printing common objects in the Osmocom world. */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * @@ -35,8 +36,6 @@ #include #include - -/* \file utils.c */ /*! \addtogroup rate_ctr * @{ diff --git a/src/vty/vector.c b/src/vty/vector.c index c21bca7..ee07cbd 100644 --- a/src/vty/vector.c +++ b/src/vty/vector.c @@ -1,4 +1,6 @@ -/* Generic vector interface routine +/*! \file vector.c + * Generic vector interface routine. */ +/* * Copyright (C) 1997 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/src/vty/vty.c b/src/vty/vty.c index 6e60eb7..644d4ed 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -68,8 +68,7 @@ /* \addtogroup vty * @{ - */ -/*! \file vty.c */ + * \file vty.c */ #define SYSCONFDIR "/usr/local/etc" diff --git a/src/write_queue.c b/src/write_queue.c index d929774..203815b 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -1,4 +1,3 @@ -/* Generic write queue implementation */ /* * (C) 2010-2016 by Holger Hans Peter Freyther * (C) 2010 by On-Waves @@ -27,10 +26,9 @@ /*! \addtogroup write_queue * @{ - * write queue for writing \ref msgb to sockets/fd's - */ - -/*! \file write_queue.c */ + * Write queue for writing \ref msgb to sockets/fds. + * + * \file write_queue.c */ /*! Select loop function for write queue handling * \param[in] fd osmocom file descriptor diff --git a/utils/osmo-arfcn.c b/utils/osmo-arfcn.c index 5103c97..61108f8 100644 --- a/utils/osmo-arfcn.c +++ b/utils/osmo-arfcn.c @@ -1,4 +1,5 @@ -/* Utility program for ARFCN / frequency calculations */ +/*! \file osmo-arfcn.c + * Utility program for ARFCN / frequency calculations. */ /* * (C) 2011 by Harald Welte * diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 6b1e623..76c4927 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -1,6 +1,7 @@ -/* GSM/GPRS/3G authentication testing tool */ - -/* (C) 2010-2012 by Harald Welte +/*! \file osmo-auc-gen.c + * GSM/GPRS/3G authentication testing tool. */ +/* + * (C) 2010-2012 by Harald Welte * * All Rights Reserved * -- To view, visit https://gerrit.osmocom.org/2987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 02:54:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 02:54:02 +0000 Subject: [PATCH] libosmocore[master]: doxygen: config: one enum val per line Message-ID: Review at https://gerrit.osmocom.org/2988 doxygen: config: one enum val per line In the generated API doc, do not print multiple enum values on the same line, because this makes the lists pretty much unreadable. Change-Id: I63d6f42567f532851e19eb8a6c842e418ce666af --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gsm.in M Doxyfile.vty.in 5 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/2988/1 diff --git a/Doxyfile.codec.in b/Doxyfile.codec.in index 2ce5bfb..9254114 100644 --- a/Doxyfile.codec.in +++ b/Doxyfile.codec.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in index 438dc39..60cb74b 100644 --- a/Doxyfile.coding.in +++ b/Doxyfile.coding.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.core.in b/Doxyfile.core.in index d5dd85e..90ebe84 100644 --- a/Doxyfile.core.in +++ b/Doxyfile.core.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index 9f02a27..24f1ad2 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.vty.in b/Doxyfile.vty.in index d440d56..6ddb12f 100644 --- a/Doxyfile.vty.in +++ b/Doxyfile.vty.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. -- To view, visit https://gerrit.osmocom.org/2988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63d6f42567f532851e19eb8a6c842e418ce666af Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 20 06:26:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 20 Jun 2017 06:26:39 +0000 Subject: libosmocore[master]: configure.ac: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 5: I didn't. Can you give me some info on how to test that? Do I need a debian based system? -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 20 06:29:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 20 Jun 2017 06:29:49 +0000 Subject: libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions In-Reply-To: References: Message-ID: Patch Set 1: The point is having a build of libosmocore with -Wall and -Werror in order to have a clean build log and no new warnings. This is the only compiler bug with the current running jenkins setup, and it's not changing lots of stuff or behaviour, so I'd like this to go in so we can push the whole patchset and enable -Wall -Werror. -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 20 07:10:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 20 Jun 2017 07:10:19 +0000 Subject: libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions In-Reply-To: References: Message-ID: Patch Set 1: I created a new issue in redmine to track this problem so we don't need to fix further related issues. https://osmocom.org/issues/2332 -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 20 08:15:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 08:15:51 +0000 Subject: libosmocore[master]: gitignore some tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 20 08:20:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 20 Jun 2017 08:20:49 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#6). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 549 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/6 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..35d522b 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,6 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..60aec9a 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,502 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry * +addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if(entry) + return &entry->addr; + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + strcpy(entry->name,name); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + OSMO_ASSERT(entry); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + memset(&entry->addr.gt, 0, sizeof(entry->addr.gt)); + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-127>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + strcpy(entry->addr.gt.digits, argv[0]); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1441,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1453,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1477,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1501,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1575,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 6 Gerrit-Project: libosmo-sccp 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 Jun 20 09:32:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 09:32:37 +0000 Subject: libosmocore[master]: lapd_test.c: Convert compilation warning to level message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Would be nice to also make a ticket and add reference to this ticket into message. -- To view, visit https://gerrit.osmocom.org/2953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Tue Jun 20 09:32:48 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 20 Jun 2017 09:32:48 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#7). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 562 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/7 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..35d522b 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,6 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..ce47667 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,515 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry * +addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Pick an SCCP address from the addressbook by its name */ +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if(entry) + return &entry->addr; + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + osmo_strlcpy(entry->name, name, sizeof(entry->name)); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup,&entry->addr.ip,sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip,ip_addr_backup,sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup,&entry->addr.ip,sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip,ip_addr_backup,sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove global title from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + entry->addr.gt = (struct osmo_sccp_gt){}; + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-127>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title digits of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + + osmo_strlcpy(entry->addr.gt.digits, argv[0], sizeof(entry->addr.gt.digits)); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1454,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1466,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1490,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1514,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1588,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 7 Gerrit-Project: libosmo-sccp 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 Jun 20 09:34:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 09:34:39 +0000 Subject: libosmocore[master]: timer_gettimeofday.c: Fix implicit use of timeradd In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Tue Jun 20 09:41:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 09:41:58 +0000 Subject: libosmocore[master]: Fix warnings: tolower() and similar require uchar In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Tue Jun 20 10:02:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 10:02:12 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper 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/2894 to look at the new patch set (#9). Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh A contrib/jenkins_common.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 36 insertions(+), 80 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/9 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..bde9f38 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,33 +1,14 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..0f926c9 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..ed1edbc 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,31 +1,14 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" - -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..bce0690 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 20 10:02:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 10:02:12 +0000 Subject: [PATCH] osmo-bts[master]: Use generic L1 headers helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2974 to look at the new patch set (#2). Use generic L1 headers helper Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 --- M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 9 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/2974/2 diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a0eef43..fa49979 100644 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -11,15 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d litecell15-fw; -then - git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git -fi - -cd litecell15-fw -git fetch origin -git reset --hard origin/$FIRMWARE_VERSION - +osmo-layer1-headers.sh lc15 $FIRMWARE_VERSION cd "$base" set +x @@ -31,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 $MAKE "$PARALLEL_MAKE" $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 0f926c9..0bcb3df 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -11,20 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct $FIRMWARE_VERSION cd "$base" set +x @@ -36,10 +23,10 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index ed1edbc..0981f5e 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -11,19 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct $FIRMWARE_VERSION cd "$base" set +x @@ -38,7 +26,7 @@ configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ - --with-octsdr-2g=$deps/layer1-api/ \ + --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index bce0690..95518a5 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -11,22 +11,9 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh sysmo $FIRMWARE_VERSION mkdir -p "$inst/include/sysmocom/femtobts" cp include/*.h "$inst/include/sysmocom/femtobts/" - cd "$base" set +x -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 20 10:11:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 10:11:42 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: > Max, please pay attention! Ironically, that's exactly the comment I wanted to use as a reply for your review. > calling a script that is missing here Because it was already added by the previous commit. > script is instead added in another patch Yes, exactly - just like every other script modified by this commit were added by some previous commit some time before this one. > I would welcome if you could focus on the actual task instead The actual task was already solved 1 week ago, now I'm just patiently follow-up on your nitpicking. > This is getting dragged on for way too long The only reason for this is your self-conflicting reviews: at first you want lc15-commit to be before common commit, but when I make this change you don't like that lc15 commit is self-contained with all the parts it's used in 1 commit, so now I've changed the order again hoping that it'll simplify your job as a reviewer. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Tue Jun 20 10:38:39 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 20 Jun 2017 10:38:39 +0000 Subject: libosmocore[master]: timer_gettimeofday.c: Fix implicit use of timeradd In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 20 12:54:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 12:54:15 +0000 Subject: [PATCH] osmo-bts[master]: Use generic L1 headers helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2974 to look at the new patch set (#3). Use generic L1 headers helper Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 --- M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 10 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/2974/3 diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a0eef43..c9173bf 100644 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -11,15 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d litecell15-fw; -then - git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git -fi - -cd litecell15-fw -git fetch origin -git reset --hard origin/$FIRMWARE_VERSION - +osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" set +x @@ -31,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 $MAKE "$PARALLEL_MAKE" $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 0f926c9..6ad5358 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -11,20 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" set +x @@ -36,10 +23,10 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index ed1edbc..a32c8f8 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -11,19 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" set +x @@ -38,7 +26,7 @@ configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ - --with-octsdr-2g=$deps/layer1-api/ \ + --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index bce0690..227f249 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -11,22 +11,9 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" -cp include/*.h "$inst/include/sysmocom/femtobts/" - +ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" set +x -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 20 12:57:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 12:57:35 +0000 Subject: libosmocore[master]: configure.ac: Enable -Wall by default In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Tue Jun 20 13:00:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 13:00:53 +0000 Subject: libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/2830/7/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 658: * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ > and again, as I said before, you have to move this up and join with the mai correction: other than with the enum, this comment is automatically joined with above API doc and can stay here as-is. -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Tue Jun 20 15:38:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 20 Jun 2017 15:38:46 +0000 Subject: libosmocore[master]: configure.ac: Enable -Wall by default In-Reply-To: References: Message-ID: Patch Set 4: Shouldn't this be the 1st patch in the series? We enable all the warnings, fix them and than turn any future warning into error, no? -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Tue Jun 20 23:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 23:20:48 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: > Because it was already added by the previous commit. Thanks for this comment, I was for some reason assuming that you were removing the code dup first and later adding the lc15 script (in which case the undup script would have been missing). Makes more sense now, but would have helped to indicate this sooner. > > script is instead added in another patch > > Yes, exactly - just like every other script modified by this commit > were added by some previous commit some time before this one. Really, Max? I am not trying to make your life harder, I am trying to indicate bad choices and discuss them in a frank way, and I always welcome being proved wrong. So please do so in clear terms. > > I would welcome if you could focus on the actual task instead > > The actual task was already solved 1 week ago, now I'm just > patiently follow-up on your nitpicking. It was solved badly, sorry. > > This is getting dragged on for way too long > > The only reason for this is your self-conflicting reviews: at first > you want lc15-commit to be before common commit, but when I make > this change you don't like that lc15 commit is self-contained with > all the parts it's used in 1 commit, so now I've changed the order > again hoping that it'll simplify your job as a reviewer. Let's keep to the actual subject matter. I was expecting you to commit one standalone lc15 script like the others, and then if you really have to also remove code dup across all the scripts, so that we can decide which parts of it to merge. Instead you decided to commit the lc15 *and* code dup removal script in one, i.e. already in a way forcing code undup on us, and then do the rest of the code undup in another patch. The code undup part isn't really needed, and I think it is a bad choice to mix the patches in this way. Yet my apologies for being confused by the patch ordering (which is hard to figure out on gerrit unfortunately). Frankly I would still prefer to have the code undup entirely separate from the lc15 script, but given where this has taken us, I don't really want to keep you up any longer. I still disagree, but would not veto someone else's +2, for the sake of getting somewhere. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Tue Jun 20 23:26:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 23:26:56 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: -Code-Review > I hate to repeat myself. The jenkins_common.sh belongs in the other > patch. Argh, you explained the ordering earlier which I missed because our discussion was spread across to patches... sorry about that. -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Jun 20 23:27:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 20 Jun 2017 23:27:28 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: > more sense now, but would have helped to indicate this sooner. Argh, you explained the ordering earlier which I missed because our discussion was spread across to patches... sorry about that. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Wed Jun 21 08:33:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 08:33:18 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: FYI: I've created OS#2334 to track jenkins build slave package updates. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 09:58:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 09:58:47 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: The patch order is also visible in top right corner of web UI in "Related changes". I do agree though that it would be easier if gerrit would automatically mark patches submitted together explicitly like [1/3]. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Wed Jun 21 12:03:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 12:03:22 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: Code-Review-1 (4 comments) Again apologies, in my last comment I didn't notice that the patches are now independent. Still there is no way to commit the lc15 without the code undup, which I would have liked to do now. I would accept both at this point, but there's still a problem here, s.b... https://gerrit.osmocom.org/#/c/2894/9/contrib/jenkins_bts_trx.sh File contrib/jenkins_bts_trx.sh: Line 25 osmo-pcu removed here Line 24: --with-osmo-pcu=$deps/osmo-pcu/include \ this needs osmo-pcu https://gerrit.osmocom.org/#/c/2894/9/contrib/jenkins_oct_and_bts_trx.sh File contrib/jenkins_oct_and_bts_trx.sh: Line 25 pcu gone Line 40: --with-osmo-pcu=$deps/osmo-pcu/include \ pcu needed -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Wed Jun 21 12:07:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 12:07:11 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 9: Hmm... you're right. It's weird that it doesn't cause build failure. -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Wed Jun 21 12:11:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 12:11:43 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper 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/2894 to look at the new patch set (#10). Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh A contrib/jenkins_common.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 36 insertions(+), 74 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/10 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..84c572c 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,33 +1,17 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$base" set +x echo diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..0f926c9 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..d57c9eb 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,31 +1,17 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis - -cd "$deps" # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$deps" if ! test -d layer1-api; diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..bce0690 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 10 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 21 12:20:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 12:20:54 +0000 Subject: [PATCH] osmo-bts[master]: Move common steps into common jenkins helper 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/2894 to look at the new patch set (#11). Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh A contrib/jenkins_common.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 36 insertions(+), 69 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/2894/11 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca..076a4ff 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,21 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") osmo-build-dep.sh libosmo-abis @@ -23,9 +14,6 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$base" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..0f926c9 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..132c2e0 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,21 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") osmo-build-dep.sh libosmo-abis @@ -24,10 +15,6 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$deps" if ! test -d layer1-api; then git clone git://git.osmocom.org/octphy-2g-headers layer1-api diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..bce0690 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 11 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 21 12:20:54 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 12:20:54 +0000 Subject: [PATCH] osmo-bts[master]: Use generic L1 headers helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2974 to look at the new patch set (#5). Use generic L1 headers helper Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 --- M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 10 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/2974/5 diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a0eef43..c9173bf 100644 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -11,15 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d litecell15-fw; -then - git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git -fi - -cd litecell15-fw -git fetch origin -git reset --hard origin/$FIRMWARE_VERSION - +osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" set +x @@ -31,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 $MAKE "$PARALLEL_MAKE" $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 0f926c9..6ad5358 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -11,20 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" set +x @@ -36,10 +23,10 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 132c2e0..a8a8004 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -15,18 +15,7 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" @@ -42,7 +31,7 @@ configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ - --with-octsdr-2g=$deps/layer1-api/ \ + --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index bce0690..227f249 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -11,22 +11,9 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" -cp include/*.h "$inst/include/sysmocom/femtobts/" - +ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" set +x -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 21 12:56:42 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 12:56:42 +0000 Subject: [MERGED] libosmocore[master]: vty: additional nodes for sccp-address configuration In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: vty: additional nodes for sccp-address configuration ...................................................................... vty: additional nodes for sccp-address configuration The planned sccp-addressbook implementation in libosmo-sccp requires two additional VTY nodes. See also in libosmo-sccp.git: Change-Id I068ed7f7d113dab88424a9d47bab7fc703bb7942 Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 --- M TODO-RELEASE M include/osmocom/vty/command.h 2 files changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index a23fcea..1964cff 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,4 @@ 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 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index b39bbf7..62989c1 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -92,13 +92,13 @@ L_CS7_RTABLE_NODE, /*!< \brief SS7 Routing Table */ L_CS7_LINK_NODE, /*!< \brief SS7 Link */ L_CS7_LINKSET_NODE, /*!< \brief SS7 Linkset */ + L_CS7_SCCPADDR_NODE, /*!< \brief SS7 SCCP Address */ + L_CS7_SCCPADDR_GT_NODE, /*!< \brief SS7 SCCP Global Title */ /* * When adding new nodes to the libosmocore project, these nodes can be * used to avoid ABI changes for unrelated projects. */ - RESERVED1_NODE, /*!< \brief Reserved for later extensions */ - RESERVED2_NODE, /*!< \brief Reserved for later extensions */ RESERVED3_NODE, /*!< \brief Reserved for later extensions */ _LAST_OSMOVTY_NODE -- To view, visit https://gerrit.osmocom.org/2922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore 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 Wed Jun 21 13:09:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:09:44 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Power off modem when resource is freed In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 For me this clearly should happen by simply calling self.set_powered(False) in Modem.cleanup(). The aim is to tear down all "things" after each test script, and Modem.cleanup() is called after each test. Am I missing something? -- To view, visit https://gerrit.osmocom.org/2697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibde7573267f1c63d075cf0147ed614a4b1ff46c8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Wed Jun 21 13:20:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:20:02 +0000 Subject: [PATCH] libosmocore[master]: doxygen: add missing gb API doc generation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2982 to look at the new patch set (#2). doxygen: add missing gb API doc generation Files in include/osmocom/gprs/ and src/gb/ are not included in any doxygen generated API docs. Add Doxyfile.gb.in and adjust configure.ac and Makefile.am. Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 --- M .gitignore A Doxyfile.gb.in M Makefile.am M configure.ac 4 files changed, 1,730 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/2982/2 diff --git a/.gitignore b/.gitignore index 89459f0..f26b699 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ Doxyfile.vty Doxyfile.codec Doxyfile.coding +Doxyfile.gb debian/autoreconf.after debian/autoreconf.before @@ -115,6 +116,7 @@ doc/vty/html doc/vty/doxygen_sqlite3.db doc/gsm +doc/gb doc/html.tar doc/*.tag tags diff --git a/Doxyfile.gb.in b/Doxyfile.gb.in new file mode 100644 index 0000000..36b4f2b --- /dev/null +++ b/Doxyfile.gb.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 = libosmogb + +# 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 Gb 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/gb + +# 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/gprs @srcdir@/src/gb + +# 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 = 1 + +# 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 = doc/libosmocore.tag=../../core/html + +# 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/libosmogb.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 3f6df9b..b8de3ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,11 +19,14 @@ html_DATA = $(top_builddir)/doc/html.tar +doc: $(html_DATA) + $(html_DATA): $(top_builddir)/doc/core/html/index.html \ $(top_builddir)/doc/gsm/html/index.html \ $(top_builddir)/doc/vty/html/index.html \ $(top_builddir)/doc/codec/html/index.html \ - $(top_builddir)/doc/coding/html/index.html + $(top_builddir)/doc/coding/html/index.html \ + $(top_builddir)/doc/gb/html/index.html cd $(top_builddir)/doc && tar cf html.tar */html $(top_builddir)/doc/core/html/index.html: $(SOURCES) Doxyfile.core @@ -50,13 +53,18 @@ mkdir -p doc/coding $(DOXYGEN) Doxyfile.coding +$(top_builddir)/doc/gb/html/index.html: $(SOURCES) Doxyfile.gb + @rm -rf doc/gb + mkdir -p doc/gb + $(DOXYGEN) Doxyfile.gb + install-data-hook: cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar uninstall-hook: - cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding} + cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,gb} -DX_CLEAN = doc/{core,gsm,vty,codec,coding}/html/search/* doc/{core,gsm,vty,codec,coding}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding}/doxygen_sqlite3.db doc/*.tag +DX_CLEAN = doc/{core,gsm,vty,codec,coding,gb}/html/search/* doc/{core,gsm,vty,codec,coding,gb}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding,gb}/doxygen_sqlite3.db doc/*.tag endif MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index 340a896..1e258a4 100644 --- a/configure.ac +++ b/configure.ac @@ -308,4 +308,5 @@ Doxyfile.vty Doxyfile.codec Doxyfile.coding + Doxyfile.gb Makefile) -- To view, visit https://gerrit.osmocom.org/2982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 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 Wed Jun 21 13:20:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:20:02 +0000 Subject: [PATCH] libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2983 to look at the new patch set (#2). doxygen: enable AUTOBRIEF, drop \brief Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gsm.in M Doxyfile.vty.in M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/application.h M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/defs.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/msgb.h M include/osmocom/core/panic.h M include/osmocom/core/prim.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/statistics.h M include/osmocom/core/strrb.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/sim.h M include/osmocom/vty/command.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/crc16.c M src/ctrl/control_if.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_ns.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/auth_core.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/panic.c M src/plugin.c M src/prim.c M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/core.c M src/socket.c M src/stat_item.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c 138 files changed, 1,542 insertions(+), 1,542 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/2983/2 -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 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 Wed Jun 21 13:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:26:45 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/2825/4/tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py File tests/auc/gen_ts_55_205_test_sets/pdftxt_2_c.py: Line 2 > since the code seems to work with python2 as well as python3, why not go fo I remember that in an unrelated patch this caused problems in the FreeBSD build slave. The solution then was to explicitly pick python2. I dimly remember that I suggested to just provide a symlink from python to python2 on the build slave, but I think Holger had a reason to not do so. -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 13:29:34 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator 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/2820 to look at the new patch set (#7). gsm0808: fix AoIP speech codec element parser/generator The implementation of the parser/generator for the speech codec information element slightly wrong, making it impossible to use it properly. (See also: 3GPP TS 48.008, 3.2.2.103) Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 136 insertions(+), 79 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/2820/7 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 7656c38..9e00d23 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -447,8 +447,6 @@ bool tf; uint8_t type; uint16_t cfg; - bool type_extended; - bool cfg_present; }; /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index bdd02e5..60fb91c 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -151,6 +151,32 @@ /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; uint8_t *old_tail; + bool type_extended; + + /* Note: Extended codec types are codec types that require 8 instead + * of 4 bit to fully specify the selected codec. In the following, + * we check if we work with an extended type or not. We also check + * if the codec type is valid at all. */ + switch(sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_FR3: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR1: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR4: + case GSM0808_SCT_HR6: + type_extended = false; + break; + case GSM0808_SCT_CSD: + type_extended = true; + break; + default: + /* Invalid codec type specified */ + OSMO_ASSERT(false); + break; + } old_tail = msg->tail; @@ -162,20 +188,37 @@ header |= (1 << 5); if (sc->tf) header |= (1 << 4); - if (sc->type_extended) { + + if (type_extended) { header |= 0x0f; msgb_put_u8(msg, header); + msgb_put_u8(msg, sc->type); } else { OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); - return (uint8_t) (msg->tail - old_tail); } - msgb_put_u8(msg, sc->type); - - if (sc->cfg_present) + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one + * or two octets, depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + default: + OSMO_ASSERT(sc->cfg == 0); + break; + } return (uint8_t) (msg->tail - old_tail); } @@ -244,21 +287,42 @@ if ((header & 0x0F) != 0x0F) { sc->type = (header & 0x0F); - return (int)(elem - old_elem); + } else { + sc->type = *elem; + elem++; + len--; } - sc->type = *elem; - elem++; - len--; - - sc->type_extended = true; - - if (len < 2) - return (int)(elem - old_elem); - - sc->cfg = osmo_load16be(elem); - elem += 2; - sc->cfg_present = true; + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one or + * two octets depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_HR1: + break; + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + if (len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: + if (len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + default: + /* Invalid codec type => malformed speech codec element! */ + return -EINVAL; + break; + } return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8304052..68771a4 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -49,19 +49,17 @@ scl->codec[0].pi = true; scl->codec[0].tf = true; - scl->codec[0].type = 0xab; - scl->codec[0].type_extended = true; - scl->codec[0].cfg_present = true; + scl->codec[0].type = GSM0808_SCT_FR3; scl->codec[0].cfg = 0xcdef; scl->codec[1].fi = true; scl->codec[1].pt = true; - scl->codec[1].type = 0x05; + scl->codec[1].type = GSM0808_SCT_FR2; scl->codec[2].fi = true; scl->codec[2].tf = true; - scl->codec[2].type = 0xf2; - scl->codec[2].type_extended = true; + scl->codec[2].type = GSM0808_SCT_CSD; + scl->codec[2].cfg = 0xc0; scl->len = 3; } @@ -89,8 +87,9 @@ static const uint8_t res[] = { 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, - 0xa5, 0x9f, 0xf2 + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, + 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg, *in_msg; @@ -282,9 +281,10 @@ static const uint8_t res2[] = { 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, 0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, - 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, - 0xef, 0xa5, 0x9f, 0xf2, GSM0808_IE_CALL_ID, 0xaa, 0xbb, 0xcc, - 0xdd }; + 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, + GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb, + 0xcc, 0xdd }; struct msgb *msg; struct gsm0808_channel_type ct; @@ -351,9 +351,9 @@ static const uint8_t res[] = { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04, - 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, 0x9a, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, - 0x9f, 0xf2 }; + 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90, + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg; memset(&sin, 0, sizeof(sin)); @@ -367,7 +367,7 @@ memset(&sc, 0, sizeof(sc)); sc.fi = true; sc.tf = true; - sc.type = 0x0a; + sc.type = GSM0808_SCT_HR1; setup_codec_list(&sc_list); @@ -400,11 +400,12 @@ { static const uint8_t res1[] = { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, - 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, + 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; static const uint8_t res2[] = { 0x00, 0x0f, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, - 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; uint8_t rr_res = 2; struct msgb *msg; struct gsm0808_speech_codec_list sc_list; @@ -574,7 +575,7 @@ memset(&enc_sc, 0, sizeof(enc_sc)); enc_sc.fi = true; enc_sc.pt = true; - enc_sc.type = 0x05; + enc_sc.type = GSM0808_SCT_FR2; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); @@ -589,6 +590,31 @@ } +static void test_gsm0808_enc_dec_speech_codec_with_cfg() +{ + struct gsm0808_speech_codec enc_sc; + struct gsm0808_speech_codec dec_sc; + struct msgb *msg; + uint8_t rc_enc; + int rc_dec; + + enc_sc.pi = true; + enc_sc.tf = true; + enc_sc.type = GSM0808_SCT_FR3; + enc_sc.cfg = 0xabcd; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); + OSMO_ASSERT(rc_enc == 5); + + rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + + OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() { struct gsm0808_speech_codec enc_sc; @@ -599,44 +625,15 @@ enc_sc.pi = true; enc_sc.tf = true; - enc_sc.type = 0xab; - enc_sc.type_extended = true; - enc_sc.cfg_present = true; - enc_sc.cfg = 0xcdef; + enc_sc.type = GSM0808_SCT_CSD; + enc_sc.cfg = 0xc0; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 6); + OSMO_ASSERT(rc_enc == 5); rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 4); - - OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); - - msgb_free(msg); -} - -static void test_gsm0808_enc_dec_speech_codec_ext() -{ - struct gsm0808_speech_codec enc_sc; - struct gsm0808_speech_codec dec_sc; - struct msgb *msg; - uint8_t rc_enc; - int rc_dec; - - enc_sc.fi = true; - enc_sc.tf = true; - enc_sc.type = 0xf2; - enc_sc.type_extended = true; - enc_sc.cfg_present = false; - enc_sc.cfg = 0x0000; - - msg = msgb_alloc(1024, "output buffer"); - rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 4); - - rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 2); + OSMO_ASSERT(rc_dec == 3); OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); @@ -655,19 +652,17 @@ enc_scl.codec[0].pi = true; enc_scl.codec[0].tf = true; - enc_scl.codec[0].type = 0xab; - enc_scl.codec[0].type_extended = true; - enc_scl.codec[0].cfg_present = true; + enc_scl.codec[0].type = GSM0808_SCT_FR3; enc_scl.codec[0].cfg = 0xcdef; enc_scl.codec[1].fi = true; enc_scl.codec[1].pt = true; - enc_scl.codec[1].type = 0x05; + enc_scl.codec[1].type = GSM0808_SCT_FR2; enc_scl.codec[2].fi = true; enc_scl.codec[2].tf = true; - enc_scl.codec[2].type = 0xf2; - enc_scl.codec[2].type_extended = true; + enc_scl.codec[2].type = GSM0808_SCT_CSD; + enc_scl.codec[2].cfg = 0xc0; enc_scl.len = 3; @@ -860,8 +855,8 @@ test_enc_dec_aoip_trasp_addr_v4(); test_enc_dec_aoip_trasp_addr_v6(); test_gsm0808_enc_dec_speech_codec(); - test_gsm0808_enc_dec_speech_codec_ext(); test_gsm0808_enc_dec_speech_codec_ext_with_cfg(); + test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_channel_type(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 13:29:34 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: Add info about coresponding codecs to permitted sp... 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/2938 to look at the new patch set (#6). cosmetic: Add info about coresponding codecs to permitted speech consts The constants in enum gsm0808_permitted_speech are not very expressive. Add comments indicating each constant's corresponding codec. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/2938/6 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5916823 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,15 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/*! \brief GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ + GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 13:29:34 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add default speech codec configuration 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/2829 to look at the new patch set (#7). gsm0808: add default speech codec configuration In an AoIP scenario, the speech codec list field specifies the codecs used in the RTP interface. This patch adds a table with default codec configurations that match the codec configurations that are also used on the air interface. Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/2829/7 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 9e00d23..d165330 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -449,6 +449,27 @@ uint16_t cfg; }; +/*! \brief Default speech codec configurations: Some codecs specified with + * struct gsm0808_speech_codec, require a configuration (cfg). The following + * default configuration will configure the codec (RTP) to match the + * configuration that is used on the air interface (Um). + * + * Default values for FR_AMR, HR_AMR and OHR_AMR: + * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred + * Configurations for the Adaptive Multi-Rate Codec Types + * + * Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: + * See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations + * for the Adaptive Multi-Rate - Wideband Codec Types */ +enum gsm0808_speech_codec_defaults { + GSM0808_SC_CFG_DEFAULT_FR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_HR_AMR = 0x073f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_FR_AMR_WB = 0x01, + GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB = 0x3f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01, +}; + /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ #define SPEECH_CODEC_MAXLEN 255 struct gsm0808_speech_codec_list { -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 13:29:34 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... 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/2830 to look at the new patch set (#8). gsm0808: add function to translate perm speech to speech codec type The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/8 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..9057273 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,5 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 60fb91c..f7062a5 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -645,4 +645,41 @@ return (int)(elem - old_elem); } +/*! \brief Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec. + * \param[in] perm_spch to be converted (see also gsm0808_permitted_speech) + * \returns GSM speech codec type; negative on error */ +int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) +{ + /*! The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + } + + /* Invalid input */ + return -EINVAL; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9613c4e..ccc5b9a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 13:29:34 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() 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/2831 to look at the new patch set (#8). gsm0808: add function gsm0808_extrapolate_speech_codec() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be extrapolated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 57 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/8 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 9057273..0c69e31 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -73,3 +73,5 @@ const uint8_t *elem, uint8_t len); int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch); +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index f7062a5..efa29a1 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -682,4 +682,58 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted speech + * parameter (channel type). + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value that is used to derive the speech codec info + * (see also: enum gsm0808_speech_codec_type in gsm0808_utils.h) + * \returns zero when successful; negative on error */ +int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_convert_to_speech_codec_type(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codec + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + default: + /* Note: Not all codec types specify a default setting, + * in this case, we just set the field to zero. */ + sc->cfg = 0; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:30:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 21 Jun 2017 13:30:00 +0000 Subject: osmo-hlr[master]: tests/auc: Don't require python3 In-Reply-To: References: Message-ID: Patch Set 4: I think we already have some tests disabled on FreeBSD in some project. If so, than we can do the same here (if the tests would actually fail of course). -- To view, visit https://gerrit.osmocom.org/2825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb59b79021b2c935b326496ed339f12e13c96b8e Gerrit-PatchSet: 4 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:30:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:30:56 +0000 Subject: libosmocore[master]: gsm0411_utils.c: Fix compilation warnings In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d6cb31f38721f79e2cf93f9b8e4776f3720aa07 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:32:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:32:06 +0000 Subject: libosmocore[master]: configure.ac: Enable -Wall by default In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Wed Jun 21 13:32:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:32:18 +0000 Subject: libosmocore[master]: configure.ac: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Wed Jun 21 13:33:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:33:07 +0000 Subject: libosmocore[master]: timer_gettimeofday.c: Fix implicit use of timeradd In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:35:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:35:25 +0000 Subject: libosmocore[master]: Fix warnings: tolower() and similar require uchar In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/2963/1/src/logging.c File src/logging.c: Line 850: name[j] = tolower((unsigned char) info->cat[i].name[j]); (usually no space in-between cast and casted value, in several places) -- To view, visit https://gerrit.osmocom.org/2963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:43:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:43:30 +0000 Subject: libosmocore[master]: pseudotalloc: Add poor implementation of talloc_asprintf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2961/1/src/pseudotalloc/pseudotalloc.c File src/pseudotalloc/pseudotalloc.c: Line 72: while (1) { since this is for an embedded libosmocore, it doesn't make sense to allow any size of string. I would use a smaller len (64? 128?) and simply not enlarge, being fine with truncated strings. (When it was truncated, we could write '[...]' to the end of the buf to indicate truncation.) Line 74: if (len < vsprintf(buf, fmt, args)) vsprintf() will write past the buffer's end! You have to use vsnprintf() with a size arg. -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Wed Jun 21 13:45:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:45:25 +0000 Subject: libosmocore[master]: lapd_test.c: Convert compilation warning to level message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Wed Jun 21 13:46:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:46:35 +0000 Subject: libosmocore[master]: fsm.c: Fix compilation warning: Use PRIu32 for uint32_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Wed Jun 21 13:46:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:46:53 +0000 Subject: libosmocore[master]: Fix compilation warnings: use correct log type for uint32_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1e3255800999669ca9619bfceb4124c773eff2d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:47:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:47:17 +0000 Subject: libosmocore[master]: osmo-sim-test.c: Remove unused functions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:48:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:48:10 +0000 Subject: libosmocore[master]: sercomm_test.c: return correctly in main In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:49:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:49:22 +0000 Subject: libosmocore[master]: pseudotalloc: Add poor implementation of talloc_asprintf In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2961/1//COMMIT_MSG Commit Message: Line 7: pseudotalloc: Add poor implementation of talloc_asprintf better word would be "simplistic". "poor" always means bad, we don't want to merge poor code. -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Wed Jun 21 13:51:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:51:13 +0000 Subject: libosmocore[master]: configure.ac: Enable -Wall by default In-Reply-To: References: Message-ID: Patch Set 4: It's not th efirst because I was first fixing the ones I got without -Wall, then enabled -Wall and continued fixing. Should not be any issue, the important one is -Werror which needs to be the last one. -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Wed Jun 21 13:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 13:51:20 +0000 Subject: libosmocore[master]: pseudotalloc: Add poor implementation of talloc_asprintf In-Reply-To: References: Message-ID: Patch Set 1: I agree with Neels' comments -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 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 Wed Jun 21 13:53:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 13:53:15 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Power off modem when resource is freed In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2697/2/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 122: 'origin' a log.Origin() instance which can be sued to log information. To sue someone means to take them to court. Ah! It's a typo! "used" lol -- To view, visit https://gerrit.osmocom.org/2697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibde7573267f1c63d075cf0147ed614a4b1ff46c8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester 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 Wed Jun 21 13:56:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:56:38 +0000 Subject: [MERGED] libosmocore[master]: lapd_test.c: Convert compilation warning to level message In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: lapd_test.c: Convert compilation warning to level message ...................................................................... lapd_test.c: Convert compilation warning to level message This way we clean the build of warnings completely and we can enable -Werror but we still see this FIXME message while compiling. Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd --- M tests/lapd/lapd_test.c 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/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.c index e322314..0dccaa4 100644 --- a/tests/lapd/lapd_test.c +++ b/tests/lapd/lapd_test.c @@ -358,7 +358,7 @@ /* Verify the added RSL_IE_L3_INFO but we have a bug here */ OSMO_ASSERT(msg->data[6] == RSL_IE_L3_INFO); - #warning "RSL_IE_L3_INFO 16 bit length is wrong" + #pragma message ("RSL_IE_L3_INFO 16 bit length is wrong") /* This should be okay but it is actually 0x0, 0x9c on ia-32 */ /* OSMO_ASSERT(msg->data[7] == 0x0 && msg->data[8] == 0x0); */ } else if (state->ms_read == 1) { -- To view, visit https://gerrit.osmocom.org/2953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Wed Jun 21 13:58:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:58:08 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp.c: Fix warning: implicit use of function Message-ID: Review at https://gerrit.osmocom.org/2989 osmo_ortp.c: Fix warning: implicit use of function Explicitly state that we are using an internal API from ortp, and define the function we are using to avoid printing a warning. Change-Id: I9cadcb31ce7ade3632d83753be97fdc9ea518b5b --- M src/trau/osmo_ortp.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/89/2989/1 diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 4e9df56..c4e9d53 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -199,6 +199,10 @@ return 0; } +/* Internal API coming from rtpsession_priv.h, used in osmo_rtcp_fd_cb */ +#pragma message ("Using internal ortp API: rtp_session_rtcp_rec") +int rtp_session_rtcp_recv(RtpSession * session); + static int osmo_rtcp_fd_cb(struct osmo_fd *fd, unsigned int what) { struct osmo_rtp_socket *rs = fd->data; @@ -360,7 +364,7 @@ /* initialize according to the RFC */ rtp_session_set_seq_number(rs->sess, random()); rs->tx_timestamp = random(); - + return rs; } -- To view, visit https://gerrit.osmocom.org/2989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9cadcb31ce7ade3632d83753be97fdc9ea518b5b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:58:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:58:08 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp.c: Fix warning: use updated ortp API Message-ID: Review at https://gerrit.osmocom.org/2990 osmo_ortp.c: Fix warning: use updated ortp API Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding ortp 0.22, the API is fixed and requests a pointer instead of an unsigned long. As we now require at least ortp 0.22 since libosmo-abis 15d9b7929d449e4138bcb003c614035bceadc3d1, we can safely assume the API will request a pointer instead of an unsigned long. Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb --- M src/trau/osmo_ortp.c 1 file changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/90/2990/1 diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c4e9d53..d31ce8e 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -349,17 +349,13 @@ rtp_session_set_jitter_compensation(rs->sess, 100); rtp_session_signal_connect(rs->sess, "ssrc_changed", - (RtpCallback) ortp_sig_cb_ssrc, - (unsigned long) rs); + (RtpCallback) ortp_sig_cb_ssrc, rs); rtp_session_signal_connect(rs->sess, "payload_type_changed", - (RtpCallback) ortp_sig_cb_pt, - (unsigned long) rs); + (RtpCallback) ortp_sig_cb_pt, rs); rtp_session_signal_connect(rs->sess, "network_error", - (RtpCallback) ortp_sig_cb_net, - (unsigned long) rs); + (RtpCallback) ortp_sig_cb_net, rs); rtp_session_signal_connect(rs->sess, "timestamp_jump", - (RtpCallback) ortp_sig_cb_ts, - (unsigned long) rs); + (RtpCallback) ortp_sig_cb_ts, rs); /* initialize according to the RFC */ rtp_session_set_seq_number(rs->sess, random()); -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:58:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:58:08 +0000 Subject: [PATCH] libosmo-abis[master]: configure.ac: Use -Wall in C(PP)FLAGS Message-ID: Review at https://gerrit.osmocom.org/2991 configure.ac: Use -Wall in C(PP)FLAGS Change-Id: I5033387e4a4206f7d34d1db3c6ede9255d199941 --- M configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/91/2991/1 diff --git a/configure.ac b/configure.ac index 9b2f189..ec0bf1b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,9 @@ AC_CONFIG_MACRO_DIR([m4]) +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " -- To view, visit https://gerrit.osmocom.org/2991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5033387e4a4206f7d34d1db3c6ede9255d199941 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:58:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:58:09 +0000 Subject: [PATCH] libosmo-abis[master]: configure.ac: Use -Werror in C(PP)FLAGS Message-ID: Review at https://gerrit.osmocom.org/2992 configure.ac: Use -Werror in C(PP)FLAGS Change-Id: Ic674bf28d781b9806dc023777e1fea4ee1a0257a --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/92/2992/1 diff --git a/configure.ac b/configure.ac index ec0bf1b..de77ed9 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_CONFIG_MACRO_DIR([m4]) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS+=" -Wall -Werror" +CPPFLAGS+=" -Wall -Werror" # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" -- To view, visit https://gerrit.osmocom.org/2992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic674bf28d781b9806dc023777e1fea4ee1a0257a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:09 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_scrc: Fix warning: uneeded constant evaulation Message-ID: Review at https://gerrit.osmocom.org/2993 sccp_scrc: Fix warning: uneeded constant evaulation translate function is always present in the same file, thus we can remove this check. Fixes following warning: warning: the address of ?translate? will always evaluate as ?true? [-Waddress] if (translate && As requested by Harald, leave a comment there stating that there are some checks missing and yet to be implemented. The translate function check was used for this purpose. Change-Id: I48a711f3a43496e2c0c637f34f56784f765938c4 --- M src/sccp_scrc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/93/2993/1 diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index 9a6a865..a4ce34c 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -348,7 +348,7 @@ } /* Called address includes SSN? */ if (called->presence & OSMO_SCCP_ADDR_T_SSN) { - if (translate && + if (/* TODO: check if we are doing global translation && */ (called->presence & OSMO_SCCP_ADDR_T_GT)) return scrc_translate_node_9(inst, xua, called); else -- To view, visit https://gerrit.osmocom.org/2993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48a711f3a43496e2c0c637f34f56784f765938c4 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:10 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_test_vty: Fix compilation warning: Unused variable Message-ID: Review at https://gerrit.osmocom.org/2994 sccp_test_vty: Fix compilation warning: Unused variable Instead of removing the variable, leave it there with unused attribute set because it is an example and gives extra information to potential readers of the function (it provides you with the actual type of void* _scu). Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab --- M examples/sccp_test_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/94/2994/1 diff --git a/examples/sccp_test_vty.c b/examples/sccp_test_vty.c index ddfbb27..d809fbc 100644 --- a/examples/sccp_test_vty.c +++ b/examples/sccp_test_vty.c @@ -117,7 +117,7 @@ static int testclnt_prim_cb(struct osmo_prim_hdr *oph, void *_scu) { - struct osmo_sccp_user *scu = _scu; + struct osmo_sccp_user *scu __attribute__((unused)) = _scu; struct osmo_scu_prim *scu_prim = (struct osmo_scu_prim *) oph; switch (OSMO_PRIM_HDR(&scu_prim->oph)) { -- To view, visit https://gerrit.osmocom.org/2994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:10 +0000 Subject: [PATCH] libosmo-sccp[master]: xua_internal.h: Add missing functions required by xua_test Message-ID: Review at https://gerrit.osmocom.org/2995 xua_internal.h: Add missing functions required by xua_test Change-Id: Ic97de20c567bf67c513a45060e1e96e4b67b2311 --- M src/xua_internal.h 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/95/2995/1 diff --git a/src/xua_internal.h b/src/xua_internal.h index bb54205..991110b 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -72,3 +72,8 @@ int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua); int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg); + +int osmo_isup_party_parse(char *out_digits, const uint8_t *in, + unsigned int in_num_bytes, bool odd); +int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, + const uint8_t *addr, unsigned int addrlen); -- To view, visit https://gerrit.osmocom.org/2995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic97de20c567bf67c513a45060e1e96e4b67b2311 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:10 +0000 Subject: [PATCH] libosmo-sccp[master]: stp_main.c: Add missing header Message-ID: Review at https://gerrit.osmocom.org/2996 stp_main.c: Add missing header stp_main uses osmo_fsm_vty_add_cmds which is defined in /osmocom/vty/misc.h Fixes 'implicit declaration of function' compilation warning. Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46 --- M stp/stp_main.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/96/2996/1 diff --git a/stp/stp_main.c b/stp/stp_main.c index 564ced5..074272b 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include -- To view, visit https://gerrit.osmocom.org/2996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:10 +0000 Subject: [PATCH] libosmo-sccp[master]: xua_test.c: remove useless keyword in struct declaration Message-ID: Review at https://gerrit.osmocom.org/2997 xua_test.c: remove useless keyword in struct declaration Fixes following warning: warning: useless storage class specifier in empty declaratio Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d --- M tests/xua/xua_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/97/2997/1 diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index d1aa564..da3ee95 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -54,7 +54,7 @@ /* SCCP Address Parsing */ -static struct sccp_addr_testcase { +struct sccp_addr_testcase { struct osmo_sccp_addr expected; uint8_t *bin; unsigned int bin_len; -- To view, visit https://gerrit.osmocom.org/2997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:10 +0000 Subject: [PATCH] libosmo-sccp[master]: configure.ac: Use -Wall in C(PP)FLAGS Message-ID: Review at https://gerrit.osmocom.org/2998 configure.ac: Use -Wall in C(PP)FLAGS Change-Id: I1e49427b8267bbdb05d0121971a56359dbecd690 --- M configure.ac 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/98/2998/1 diff --git a/configure.ac b/configure.ac index 3a05d54..36cbb59 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,9 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -73,4 +76,3 @@ examples/Makefile stp/Makefile Makefile) - -- To view, visit https://gerrit.osmocom.org/2998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e49427b8267bbdb05d0121971a56359dbecd690 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 21 Jun 2017 13:59:11 +0000 Subject: [PATCH] libosmo-sccp[master]: configure.ac: Use -Werror in C(PP)FLAGS Message-ID: Review at https://gerrit.osmocom.org/2999 configure.ac: Use -Werror in C(PP)FLAGS Change-Id: Ia753a3080ef54ac248dacce5cd692fdd38f7649a --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/99/2999/1 diff --git a/configure.ac b/configure.ac index 36cbb59..3c498c8 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS+=" -Wall -Werror" +CPPFLAGS+=" -Wall -Werror" AC_OUTPUT( libosmo-sigtran.pc -- To view, visit https://gerrit.osmocom.org/2999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia753a3080ef54ac248dacce5cd692fdd38f7649a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 21 13:59:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 13:59:55 +0000 Subject: libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/2924/7/src/osmo_ss7_vty.c File src/osmo_ss7_vty.c: Line 1250: memcpy(ip_addr_backup,&entry->addr.ip,sizeof(entry->addr.ip)); space, space, space. Please consider instructing your editor to do this for you, if you don't do this automatically. No need to spend time and attention on this, if it can be automatized. I see it quite frequently in your patches, but don't want to keep making a fuzz about it. Thanks! -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 7 Gerrit-Project: libosmo-sccp 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 Jun 21 15:48:47 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 15:48:47 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#8). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 584 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/8 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..2258b0d 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,9 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); + +char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, + const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..75b2431 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,534 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry * +addr_entry_by_name(const char *name, const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Lookup an SCCP address from the addressbook by its name. + * \param[in] lookup-name of the address to lookup + * \param[in] ss7 instance + * \returns SCCP address; NULL on error */ +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if(entry) + return &entry->addr; + + return NULL; +} + +/*! \brief Reverse lookup the lookup-name of a specified SCCP address. + * \param[in] name of the address to lookup + * \param[in] ss7 instance + * \returns char pointer to the lookup-name; NULL on error */ +char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, + const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { + if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) + return entry->name; + } + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + osmo_strlcpy(entry->name, name, sizeof(entry->name)); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup,&entry->addr.ip,sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip,ip_addr_backup,sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup,&entry->addr.ip,sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip,ip_addr_backup,sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove global title from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + entry->addr.gt = (struct osmo_sccp_gt){}; + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-127>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title digits of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + + osmo_strlcpy(entry->addr.gt.digits, argv[0], sizeof(entry->addr.gt.digits)); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1473,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1485,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1509,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1533,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1607,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 8 Gerrit-Project: libosmo-sccp 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 Jun 21 16:02:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 21 Jun 2017 16:02:16 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses 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/2924 to look at the new patch set (#9). sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 587 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/2924/9 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..2258b0d 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,9 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); + +char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, + const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..8e40474 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,537 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry *addr_entry_by_name(const char *name, + const struct osmo_ss7_instance + *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Lookup an SCCP address from the addressbook by its name. + * \param[in] lookup-name of the address to lookup + * \param[in] ss7 instance + * \returns SCCP address; NULL on error */ +struct osmo_sccp_addr *osmo_sccp_addr_by_name(const char *name, + const struct osmo_ss7_instance + *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if (entry) + return &entry->addr; + + return NULL; +} + +/*! \brief Reverse lookup the lookup-name of a specified SCCP address. + * \param[in] name of the address to lookup + * \param[in] ss7 instance + * \returns char pointer to the lookup-name; NULL on error */ +char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, + const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { + if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) + return entry->name; + } + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + osmo_strlcpy(entry->name, name, sizeof(entry->name)); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup, &entry->addr.ip, sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip, ip_addr_backup, sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup, &entry->addr.ip, sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip, ip_addr_backup, sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove global title from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + entry->addr.gt = (struct osmo_sccp_gt) {}; + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-127>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title digits of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + + osmo_strlcpy(entry->addr.gt.digits, argv[0], + sizeof(entry->addr.gt.digits)); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1476,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1488,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1512,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1536,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1610,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 9 Gerrit-Project: libosmo-sccp 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 Jun 21 17:54:09 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 21 Jun 2017 17:54:09 +0000 Subject: libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions In-Reply-To: References: Message-ID: Patch Set 1: I can confirm that the same warning appears when compiling with clang-4.0: warning: suggest braces around initialization of subobject [-Wmissing-braces] -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 20:15:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:15:05 +0000 Subject: osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 I think we should drop this, avoiding any unneccessary incompatibility between lc15 and sbts2100 -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 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-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 20:19:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:19:30 +0000 Subject: libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 9 Gerrit-Project: libosmo-sccp 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 Jun 21 20:19:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:19:35 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: add addressbook functionality for sccp addresses In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: add addressbook functionality for sccp addresses ...................................................................... sccp: add addressbook functionality for sccp addresses SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 --- M include/osmocom/sigtran/osmo_ss7.h M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7.c M src/osmo_ss7_vty.c 4 files changed, 587 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 7b0a607..741a7e3 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -89,6 +89,7 @@ uint8_t network_indicator; struct osmo_ss7_pc_fmt pc_fmt; bool permit_dyn_rkm_alloc; + struct llist_head sccp_address_book; } cfg; }; diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f378e5c..2258b0d 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,3 +247,9 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); + +struct osmo_sccp_addr * +osmo_sccp_addr_by_name(const char *name, const struct osmo_ss7_instance *ss7); + +char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, + const struct osmo_ss7_instance *ss7); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index d952ecd..78b22a7 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -352,6 +352,8 @@ llist_add(&inst->list, &osmo_ss7_instances); + INIT_LLIST_HEAD(&inst->cfg.sccp_address_book); + return inst; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 97b5cf0..8e40474 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -36,6 +36,7 @@ #include #include "xua_internal.h" +#include #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -891,6 +892,537 @@ return CMD_SUCCESS; } +/*********************************************************************** + * SCCP addressbook handling + ***********************************************************************/ + +/* SCCP addressbook */ +struct osmo_sccp_addr_entry { + struct llist_head list; + struct osmo_ss7_instance *inst; + char name[512]; + struct osmo_sccp_addr addr; +}; + +static struct cmd_node sccpaddr_node = { + L_CS7_SCCPADDR_NODE, + "%s(config-cs7-sccpaddr)# ", + 1, +}; + +static struct cmd_node sccpaddr_gt_node = { + L_CS7_SCCPADDR_GT_NODE, + "%s(config-cs7-sccpaddr-gt)# ", + 1, +}; + +/* Pick an SCCP address entry from the addressbook by its name */ +struct osmo_sccp_addr_entry *addr_entry_by_name(const char *name, + const struct osmo_ss7_instance + *inst) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + if (strcmp(entry->name, name) == 0) + return entry; + } + return NULL; +} + +/*! \brief Lookup an SCCP address from the addressbook by its name. + * \param[in] lookup-name of the address to lookup + * \param[in] ss7 instance + * \returns SCCP address; NULL on error */ +struct osmo_sccp_addr *osmo_sccp_addr_by_name(const char *name, + const struct osmo_ss7_instance + *ss7) +{ + struct osmo_sccp_addr_entry *entry; + + entry = addr_entry_by_name(name, ss7); + if (entry) + return &entry->addr; + + return NULL; +} + +/*! \brief Reverse lookup the lookup-name of a specified SCCP address. + * \param[in] name of the address to lookup + * \param[in] ss7 instance + * \returns char pointer to the lookup-name; NULL on error */ +char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr, + const struct osmo_ss7_instance *ss7) +{ + struct osmo_sccp_addr_entry *entry; + llist_for_each_entry(entry, &ss7->cfg.sccp_address_book, list) { + if (memcmp(&entry->addr, addr, sizeof(*addr)) == 0) + return entry->name; + } + + return NULL; +} + +/* Generate VTY configuration file snippet */ +static void write_sccp_addressbook(struct vty *vty, + const struct osmo_ss7_instance *inst) +{ + struct osmo_sccp_addr_entry *entry; + + if (llist_empty(&inst->cfg.sccp_address_book)) + return; + + /* FIXME: Add code to write IP-Addresses */ + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, " sccp-address %s%s", entry->name, VTY_NEWLINE); + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, " routing-indicator GT%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, " routing-indicator PC%s", VTY_NEWLINE); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); + break; + } + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, " point-code %s%s", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc), + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, " subsystem-number %u%s", entry->addr.ssn, + VTY_NEWLINE); + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, " global-title%s", VTY_NEWLINE); + vty_out(vty, " global-title-indicator %u%s", + entry->addr.gt.gti, VTY_NEWLINE); + vty_out(vty, " translation-type %u%s", + entry->addr.gt.tt, VTY_NEWLINE); + vty_out(vty, " numbering-plan-indicator %u%s", + entry->addr.gt.npi, VTY_NEWLINE); + vty_out(vty, " nature-of-address-indicator %u%s", + entry->addr.gt.nai, VTY_NEWLINE); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, " digits %s%s", + entry->addr.gt.digits, VTY_NEWLINE); + } + } +} + +/* List all addressbook entries */ +DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, + "show cs7 instance <0-15> sccp-addressbook", + SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") +{ + struct osmo_ss7_instance *inst; + struct osmo_sccp_addr_entry *entry; + int id = atoi(argv[0]); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + char ip_addr_str[INET6_ADDRSTRLEN]; +#endif + + inst = osmo_ss7_instance_find(id); + if (!inst) { + vty_out(vty, "No SS7 instance %d found%s", id, VTY_NEWLINE); + return CMD_WARNING; + } + + if (inst->cfg.description) + vty_out(vty, " description %s%s", inst->cfg.description, + VTY_NEWLINE); + + if (llist_empty(&inst->cfg.sccp_address_book)) { + vty_out(vty, "SCCP addressbook empty!%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "Name "); + vty_out(vty, "RI: "); + vty_out(vty, "PC: "); + vty_out(vty, "SSN: "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "IP-Address: "); +#endif + vty_out(vty, "GT:"); + vty_out(vty, "%s", VTY_NEWLINE); + + vty_out(vty, "------------ "); + vty_out(vty, "--- "); + vty_out(vty, "--------- "); + vty_out(vty, "---------- "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + vty_out(vty, "--------------------------------------- "); +#endif + vty_out(vty, "--------------------------------------- "); + vty_out(vty, "%s", VTY_NEWLINE); + + llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) { + vty_out(vty, "%-12s ", entry->name); + + /* RI */ + switch (entry->addr.ri) { + case OSMO_SCCP_RI_GT: + vty_out(vty, "GT "); + break; + case OSMO_SCCP_RI_SSN_PC: + vty_out(vty, "PC "); + break; + case OSMO_SCCP_RI_SSN_IP: + vty_out(vty, "IP "); + break; + default: + vty_out(vty, "ERR "); + break; + } + + /* PC */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) + vty_out(vty, "%-9s ", + osmo_ss7_pointcode_print(entry->inst, + entry->addr.pc)); + else + vty_out(vty, "(none) "); + + /* SSN */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_SSN) + vty_out(vty, "%-10u ", entry->addr.ssn); + else + vty_out(vty, "(none) "); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not + * supported, so we leave the related VTY options out for now */ + /* IP-Address */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv4) { + inet_ntop(AF_INET, &entry->addr.ip.v4, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else if (entry->addr.presence & OSMO_SCCP_ADDR_T_IPv6) { + inet_ntop(AF_INET6, &entry->addr.ip.v6, ip_addr_str, + INET6_ADDRSTRLEN); + vty_out(vty, "%-39s ", ip_addr_str); + } else + vty_out(vty, "(none) "); +#endif + /* GT */ + if (entry->addr.presence & OSMO_SCCP_ADDR_T_GT) { + vty_out(vty, "GTI:%u ", entry->addr.gt.gti); + vty_out(vty, "TT:%u ", entry->addr.gt.tt); + vty_out(vty, "NPI:%u ", entry->addr.gt.npi); + vty_out(vty, "NAI:%u ", entry->addr.gt.nai); + if (strlen(entry->addr.gt.digits)) + vty_out(vty, "%s ", entry->addr.gt.digits); + } else + vty_out(vty, "(none)"); + vty_out(vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, + "sccp-address NAME", + "Create/Modify an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + if (strlen(name) >= sizeof(entry->name)) { + vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + entry = addr_entry_by_name(name, inst); + + /* Create a new addressbook entry if we can not find an + * already existing entry */ + if (!entry) { + entry = talloc_zero(inst, struct osmo_sccp_addr_entry); + osmo_strlcpy(entry->name, name, sizeof(entry->name)); + llist_add_tail(&entry->list, &inst->cfg.sccp_address_book); + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + } + + entry->inst = (struct osmo_ss7_instance *)vty->index; + vty->node = L_CS7_SCCPADDR_NODE; + vty->index = entry; + + return CMD_SUCCESS; +} + +/* Create a new addressbook entry and switch nodes */ +DEFUN(cs7_sccpaddr_del, cs7_sccpaddr_del_cmd, + "no sccp-address NAME", + NO_STR "Delete an SCCP addressbook entry\n" "Name of the SCCP Address\n") +{ + struct osmo_ss7_instance *inst = (struct osmo_ss7_instance *)vty->index; + struct osmo_sccp_addr_entry *entry; + const char *name = argv[0]; + + entry = addr_entry_by_name(name, inst); + if (entry) { + llist_del(&entry->list); + talloc_free(entry); + } else { + vty_out(vty, "Addressbook entry not found!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +/* Set routing indicator of sccp address */ +DEFUN(cs7_sccpaddr_ri, cs7_sccpaddr_ri_cmd, + "routing-indicator (GT|PC|IP)", + "Add Routing Indicator\n" + "by global-title\n" "by point-code\n" "by ip-address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + switch (argv[0][0]) { + case 'G': + entry->addr.ri = OSMO_SCCP_RI_GT; + break; + case 'P': + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; + break; + case 'I': + entry->addr.ri = OSMO_SCCP_RI_SSN_IP; + break; + } + return CMD_SUCCESS; +} + +/* Set point-code number of sccp address */ +DEFUN(cs7_sccpaddr_pc, cs7_sccpaddr_pc_cmd, + "point-code POINT_CODE", "Add point-code Number\n" "PC\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = osmo_ss7_pointcode_parse(entry->inst, argv[0]); + return CMD_SUCCESS; +} + +/* Remove point-code number from sccp address */ +DEFUN(cs7_sccpaddr_pc_del, cs7_sccpaddr_pc_del_cmd, + "no point-code", NO_STR "Remove point-code Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_PC; + entry->addr.pc = 0; + return CMD_SUCCESS; +} + +/* Set subsystem number of sccp address */ +DEFUN(cs7_sccpaddr_ssn, cs7_sccpaddr_ssn_cmd, + "subsystem-number <0-4294967295>", "Add Subsystem Number\n" "SSN\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence |= OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Remove subsystem number from sccp address */ +DEFUN(cs7_sccpaddr_ssn_del, cs7_sccpaddr_ssn_del_cmd, + "no subsystem-number", NO_STR "Remove Subsystem Number\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_SSN; + entry->addr.ssn = 0; + return CMD_SUCCESS; +} + +#if 0 +/* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + +/* Set IP Address (V4) of sccp address */ +DEFUN(cs7_sccpaddr_ipv4, cs7_sccpaddr_ipv4_cmd, + "ip-address V4 A.B.C.D", + "Add IP-Address\n" "Protocol version 4\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup, &entry->addr.ip, sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + rc = inet_pton(AF_INET, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip, ip_addr_backup, sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Set IP Address (V6) of sccp address */ +DEFUN(cs7_sccpaddr_ipv6, cs7_sccpaddr_ipv6_cmd, + "ip-address V6 A:B:C:D:E:F:G:H", + "Add IP-Address\n" "Protocol version 6\n" "IP-Address digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + unsigned int rc; + uint8_t ip_addr_backup[sizeof(entry->addr.ip)]; + OSMO_ASSERT(entry); + + /* Create a backup of the existing IP-Address setting */ + memcpy(ip_addr_backup, &entry->addr.ip, sizeof(entry->addr.ip)); + + entry->addr.presence |= OSMO_SCCP_ADDR_T_IPv6; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + rc = inet_pton(AF_INET6, argv[1], &entry->addr.ip.v4); + if (rc <= 0) { + vty_out(vty, "Invalid IP-Address format!%s", VTY_NEWLINE); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + + /* In case of failure, make sure the previous IP-Address + * configuration is restored */ + memcpy(&entry->addr.ip, ip_addr_backup, sizeof(entry->addr.ip)); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +/* Remove IP Address from sccp address */ +DEFUN(cs7_sccpaddr_ip_del, cs7_sccpaddr_ip_del_cmd, + "no ip-address", NO_STR "Remove IP-Address\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv4; + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_IPv6; + memset(&entry->addr.ip, 0, sizeof(entry->addr.ip)); + return CMD_SUCCESS; +} +#endif + +/* Configure global title and switch nodes */ +DEFUN(cs7_sccpaddr_gt, cs7_sccpaddr_gt_cmd, + "global-title", "Add/Modify Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + entry->addr.presence |= OSMO_SCCP_ADDR_T_GT; + vty->node = L_CS7_SCCPADDR_GT_NODE; + return CMD_SUCCESS; +} + +/* Remove global title from sccp address */ +DEFUN(cs7_sccpaddr_gt_del, cs7_sccpaddr_gt_del_cmd, + "no global-title", NO_STR "Remove Global Title\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.presence &= ~OSMO_SCCP_ADDR_T_GT; + entry->addr.gt = (struct osmo_sccp_gt) {}; + return CMD_SUCCESS; +} + +/* Set global title inicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_gti, cs7_sccpaddr_gt_gti_cmd, + "global-title-indicator <0-15>", "Set Global Title Indicator\n" "GTI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.gti = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title translation type of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_tt, cs7_sccpaddr_gt_tt_cmd, + "translation-type <0-255>", "Set Global Title Translation Type\n" "TT\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.tt = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title numbering plan indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_npi, cs7_sccpaddr_gt_npi_cmd, + "numbering-plan-indicator <0-15>", + "Set Global Title Numbering Plan Indicator\n" "NPI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.npi = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title nature of address indicator of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_nai, cs7_sccpaddr_gt_nai_cmd, + "nature-of-address-indicator <0-127>", + "Set Global Title Nature of Address Indicator\n" "NAI\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + entry->addr.gt.nai = atoi(argv[0]); + return CMD_SUCCESS; +} + +/* Set global title digits of the sccp address gt */ +DEFUN(cs7_sccpaddr_gt_digits, cs7_sccpaddr_gt_digits_cmd, + "digits DIGITS", "Set Global Title Digits\n" "Number digits\n") +{ + struct osmo_sccp_addr_entry *entry = + (struct osmo_sccp_addr_entry *)vty->index; + OSMO_ASSERT(entry); + + if (strlen(argv[0]) > sizeof(entry->addr.gt.digits)) { + vty_out(vty, "Number too long!%s", VTY_NEWLINE); + return CMD_WARNING; + } + + memset(entry->addr.gt.digits, 0, sizeof(entry->addr.gt.digits)); + + osmo_strlcpy(entry->addr.gt.digits, argv[0], + sizeof(entry->addr.gt.digits)); + return CMD_SUCCESS; +} + +/*********************************************************************** + * Common + ***********************************************************************/ + static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst) { struct osmo_ss7_asp *asp; @@ -944,6 +1476,9 @@ llist_for_each_entry(oxs, &inst->xua_servers, list) write_one_xua(vty, oxs); + + /* Append SCCP Addressbook */ + write_sccp_addressbook(vty, inst); } @@ -953,6 +1488,7 @@ struct osmo_ss7_asp *asp; struct osmo_ss7_route_table *rtbl; struct osmo_xua_server *oxs; + struct osmo_sccp_addr_entry *entry; switch (vty->node) { case L_CS7_ASP_NODE: @@ -976,6 +1512,14 @@ vty->node = L_CS7_NODE; vty->index = oxs->inst; break; + case L_CS7_SCCPADDR_NODE: + entry = vty->index; + vty->node = L_CS7_NODE; + vty->index = entry->inst; + break; + case L_CS7_SCCPADDR_GT_NODE: + vty->node = L_CS7_SCCPADDR_NODE; + break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; @@ -992,6 +1536,8 @@ case L_CS7_RTABLE_NODE: case L_CS7_XUA_NODE: case L_CS7_AS_NODE: + case L_CS7_SCCPADDR_NODE: + case L_CS7_SCCPADDR_GT_NODE: return 1; default: return 0; @@ -1064,6 +1610,38 @@ install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); + + /* Commands for SCCP-Addressbook */ + install_node(&sccpaddr_node, NULL); + vty_install_default(L_CS7_SCCPADDR_NODE); + install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); + install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_del_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ip_del_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_del_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ri_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ssn_cmd); +#if 0 + /* FIXME: IP-Address based SCCP-Routing is currently not supported, + * so we leave the related VTY options out for now */ + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv4_cmd); + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_ipv6_cmd); +#endif + install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_gt_cmd); + install_node(&sccpaddr_gt_node, NULL); + vty_install_default(L_CS7_SCCPADDR_GT_NODE); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_gti_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_tt_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_npi_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_nai_cmd); + install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) -- To view, visit https://gerrit.osmocom.org/2924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942 Gerrit-PatchSet: 9 Gerrit-Project: libosmo-sccp 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 Jun 21 20:20:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:20:03 +0000 Subject: [MERGED] libosmocore[master]: gsm0408: update bearer capability speech version In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0408: update bearer capability speech version ...................................................................... gsm0408: update bearer capability speech version 3GPP TS 24.008 specifies two new speech versions for half rate and two new speech modes for full rate. This patch adds the relevant constants to enum gsm48_bcap_speech_ver in gsm_04_08.h Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index fef23d8..604a5df 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1620,13 +1620,18 @@ GSM48_BCAP_MT_AUTO_1 = 8, }; -/*! \brief GSM 04.08 Bearer Capability: Speech Version Indication */ +/*! \brief GSM 04.08 Bearer Capability: Speech Version Indication + * (See also 3GPP TS 24.008, Table 10.5.103) */ enum gsm48_bcap_speech_ver { GSM48_BCAP_SV_FR = 0, /*!< GSM FR V1 (GSM FR) */ GSM48_BCAP_SV_HR = 1, /*!< GSM HR V1 (GSM HR) */ GSM48_BCAP_SV_EFR = 2, /*!< GSM FR V2 (GSM EFR) */ GSM48_BCAP_SV_AMR_F = 4, /*!< GSM FR V3 (FR AMR) */ GSM48_BCAP_SV_AMR_H = 5, /*!< GSM HR V3 (HR_AMR) */ + GSM48_BCAP_SV_AMR_OFW = 6, /*!< GSM FR V4 (OFR AMR-WB) */ + GSM48_BCAP_SV_AMR_OHW = 7, /*!< GSM HR V4 (OHR AMR-WB) */ + GSM48_BCAP_SV_AMR_FW = 8, /*!< GSM FR V5 (FR AMR-WB) */ + GSM48_BCAP_SV_AMR_OH = 11, /*!< GSM HR V6 (OHR AMR) */ }; #define GSM48_TMSI_LEN 5 -- To view, visit https://gerrit.osmocom.org/2812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549 Gerrit-PatchSet: 9 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 Wed Jun 21 20:20:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:20:03 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: Add info about coresponding codecs to permitted sp... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: Add info about coresponding codecs to permitted speech consts ...................................................................... cosmetic: Add info about coresponding codecs to permitted speech consts The constants in enum gsm0808_permitted_speech are not very expressive. Add comments indicating each constant's corresponding codec. Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index e5e7e1e..5916823 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -391,14 +391,15 @@ GSM0808_SPEECH_PERM_NO_CHANGE = 0x1f, }; -/* GSM 08.08 3.2.2.11 Channel Type */ +/*! \brief GSM 08.08 3.2.2.11 Channel Type + * (see also 3GPP TS 48.008, section 3.2.2.11) */ enum gsm0808_permitted_speech { - GSM0808_PERM_FR1 = 0x01, - GSM0808_PERM_FR2 = 0x11, - GSM0808_PERM_FR3 = 0x21, - GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, - GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, - GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, + GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ + GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ + GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ + GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ + GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Jun 21 20:20:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:20:04 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: Add codec references to Speech Version Indication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: Add codec references to Speech Version Indication ...................................................................... cosmetic: Add codec references to Speech Version Indication Add the information which GSM Speech codec version coresponds to which bearer capability speech version. Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 124f8b7..fef23d8 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1620,13 +1620,13 @@ GSM48_BCAP_MT_AUTO_1 = 8, }; -/* GSM 04.08 Bearer Capability: Speech Version Indication */ +/*! \brief GSM 04.08 Bearer Capability: Speech Version Indication */ enum gsm48_bcap_speech_ver { - GSM48_BCAP_SV_FR = 0, - GSM48_BCAP_SV_HR = 1, - GSM48_BCAP_SV_EFR = 2, - GSM48_BCAP_SV_AMR_F = 4, - GSM48_BCAP_SV_AMR_H = 5, + GSM48_BCAP_SV_FR = 0, /*!< GSM FR V1 (GSM FR) */ + GSM48_BCAP_SV_HR = 1, /*!< GSM HR V1 (GSM HR) */ + GSM48_BCAP_SV_EFR = 2, /*!< GSM FR V2 (GSM EFR) */ + GSM48_BCAP_SV_AMR_F = 4, /*!< GSM FR V3 (FR AMR) */ + GSM48_BCAP_SV_AMR_H = 5, /*!< GSM HR V3 (HR_AMR) */ }; #define GSM48_TMSI_LEN 5 -- To view, visit https://gerrit.osmocom.org/2937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore 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 Jun 21 20:20:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:20:04 +0000 Subject: [MERGED] libosmocore[master]: gsm0808: add speech codec type constants In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0808: add speech codec type constants ...................................................................... gsm0808: add speech codec type constants The codec type to be set in member type in struct gsm0808_speech_codec has its own coding scheme to reference the used codec types. This patch declares an enum with valid speech codec types. Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 18 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 5916823..7656c38 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -397,9 +397,27 @@ GSM0808_PERM_FR1 = 0x01, /*!< GSM FR */ GSM0808_PERM_FR2 = 0x11, /*!< GSM EFR */ GSM0808_PERM_FR3 = 0x21, /*!< FR AMR */ + GSM0808_PERM_FR4 = 0x41, /*!< OFR AMR-WB */ + GSM0808_PERM_FR5 = 0x42, /*!< FR AMR-WB */ GSM0808_PERM_HR1 = GSM0808_PERM_FR1 | 0x4, /*!< GSM HR */ GSM0808_PERM_HR2 = GSM0808_PERM_FR2 | 0x4, /*!< (deprecated) */ GSM0808_PERM_HR3 = GSM0808_PERM_FR3 | 0x4, /*!< HR AMR */ + GSM0808_PERM_HR4 = 0x46, /*!< OHR AMR-WB */ + GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ +}; + +/*! \brief 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ +enum gsm0808_speech_codec_type { + GSM0808_SCT_FR1 = 0x0, /*!< GSM FR */ + GSM0808_SCT_FR2 = 0x2, /*!< GSM EFR */ + GSM0808_SCT_FR3 = 0x3, /*!< FR AMR */ + GSM0808_SCT_FR4 = 0xc, /*!< OFR AMR-WB */ + GSM0808_SCT_FR5 = 0x9, /*!< FR AMR-WB */ + GSM0808_SCT_HR1 = 0x1, /*!< GSM_HR */ + GSM0808_SCT_HR3 = 0x4, /*!< HR_AMR */ + GSM0808_SCT_HR4 = 0xd, /*!< OHR AMR-WB */ + GSM0808_SCT_HR6 = 0xb, /*!< OHR AMR */ + GSM0808_SCT_CSD = 0xfd, /*!< CSData (see also TS 26.103) */ }; /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ -- To view, visit https://gerrit.osmocom.org/2818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore 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 Jun 21 20:20:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:20:31 +0000 Subject: libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 7 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 Wed Jun 21 20:20:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:20:59 +0000 Subject: libosmocore[master]: gsm0808: add default speech codec configuration In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 7 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 Wed Jun 21 20:22:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:22:47 +0000 Subject: libosmocore[master]: gsm0808: add function to translate perm speech to speech cod... In-Reply-To: References: Message-ID: Patch Set 8: (1 comment) https://gerrit.osmocom.org/#/c/2830/8/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 653: int gsm0808_convert_to_speech_codec_type(uint8_t perm_spch) I would call it 'gsm0808_chan_type_to_speech_codec() to make it more clear. thanks. -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 8 Gerrit-Project: libosmocore 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 Jun 21 20:24:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:24:13 +0000 Subject: libosmocore[master]: gsm0808: add function gsm0808_extrapolate_speech_codec() In-Reply-To: References: Message-ID: Patch Set 8: (1 comment) https://gerrit.osmocom.org/#/c/2831/8/src/gsm/gsm0808_utils.c File src/gsm/gsm0808_utils.c: Line 691: int gsm0808_extrapolate_speech_codec(struct gsm0808_speech_codec *sc, name: what about gsm0808_speech_codec_from_chan_type() ? I think current name leaves it unclear from where/what it is extrapolated? -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore 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 Jun 21 20:24:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:24:34 +0000 Subject: osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Patch Set 11: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 11 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Jun 21 20:25:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:25:10 +0000 Subject: osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Patch Set 11: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 11 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte 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 Wed Jun 21 20:25:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:25:20 +0000 Subject: osmo-bts[master]: Use generic L1 headers helper In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 20:25:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:25:29 +0000 Subject: [MERGED] osmo-bts[master]: Use generic L1 headers helper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use generic L1 headers helper ...................................................................... Use generic L1 headers helper Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 --- M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 4 files changed, 10 insertions(+), 55 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a0eef43..c9173bf 100644 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -11,15 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d litecell15-fw; -then - git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git -fi - -cd litecell15-fw -git fetch origin -git reset --hard origin/$FIRMWARE_VERSION - +osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" set +x @@ -31,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 $MAKE "$PARALLEL_MAKE" $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 0f926c9..6ad5358 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -11,20 +11,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi - +osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" set +x @@ -36,10 +23,10 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 132c2e0..a8a8004 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -15,18 +15,7 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -if ! test -d layer1-api; -then - git clone git://git.osmocom.org/octphy-2g-headers layer1-api -fi -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" @@ -42,7 +31,7 @@ configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ - --with-octsdr-2g=$deps/layer1-api/ \ + --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index bce0690..227f249 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -11,22 +11,9 @@ osmo-build-dep.sh libosmo-abis cd "$deps" -if ! test -d layer1-api; -then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api -fi - -cd layer1-api -git fetch origin -if [ $FIRMWARE_VERSION = "master" ]; -then -git reset --hard origin/master -else -git reset --hard $FIRMWARE_VERSION -fi +osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" -cp include/*.h "$inst/include/sysmocom/femtobts/" - +ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" set +x -- To view, visit https://gerrit.osmocom.org/2974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 21 20:25:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:25:29 +0000 Subject: [MERGED] osmo-bts[master]: Move common steps into common jenkins helper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move common steps into common jenkins helper ...................................................................... Move common steps into common jenkins helper Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 --- M contrib/jenkins_bts_trx.sh A contrib/jenkins_common.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 36 insertions(+), 69 deletions(-) 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 dbd41ca..076a4ff 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,21 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") osmo-build-dep.sh libosmo-abis @@ -23,9 +14,6 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu - -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc cd "$base" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..824dd43 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" + +export deps inst + +mkdir -p "$deps" +rm -rf "$inst" + +cd "$deps" + +# Get libosmocore for verify_value_string_arrays_are_terminated.py +osmo-deps.sh libosmocore + +# Get OpenBSC for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 9f06888..0f926c9 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index 93aa47a..132c2e0 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,21 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") osmo-build-dep.sh libosmo-abis @@ -24,10 +15,6 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -# Get openbsc for gsm_data_shared.* -osmo-deps.sh openbsc - -cd "$deps" if ! test -d layer1-api; then git clone git://git.osmocom.org/octphy-2g-headers layer1-api diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index c6f109d..bce0690 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,25 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex - -base="$PWD" -deps="$base/deps" -inst="$deps/install" -export deps inst - -mkdir "$deps" || true -rm -rf "$inst" - -# Get the headers.. -cd "$deps" -git clone git://git.osmocom.org/openbsc || true -cd openbsc -git pull --rebase -cd "$base" +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/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" -- To view, visit https://gerrit.osmocom.org/2894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408 Gerrit-PatchSet: 12 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg 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 Jun 21 20:25:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:25:30 +0000 Subject: [MERGED] osmo-bts[master]: lc15: add jenkins helper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: add jenkins helper ...................................................................... lc15: add jenkins helper Add jenkins build helper for lc15 and separate header with BTS-agnostic functions. Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Related: SYS#3682 --- M contrib/jenkins_bts_model.sh A contrib/jenkins_lc15.sh 2 files changed, 41 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index 58eac5b..c44daa7 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -18,6 +18,10 @@ ./contrib/jenkins_oct.sh ;; + lc15) + ./contrib/jenkins_lc15.sh + ;; + trx) ./contrib/jenkins_bts_trx.sh ;; diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh new file mode 100644 index 0000000..a0eef43 --- /dev/null +++ b/contrib/jenkins_lc15.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# shellcheck source=contrib/jenkins_common.sh +. $(dirname "$0")/jenkins_common.sh + +osmo-build-dep.sh libosmocore + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmo-abis + +cd "$deps" +if ! test -d litecell15-fw; +then + git clone https://gitlab.com/nrw_litecell15/litecell15-fw.git +fi + +cd litecell15-fw +git fetch origin +git reset --hard origin/$FIRMWARE_VERSION + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-lc15 ===============================" +echo +set -x + +autoreconf --install --force +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/litecell15-fw/" --enable-litecell15 +$MAKE "$PARALLEL_MAKE" +$MAKE check || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/litecell15-fw/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/2891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132 Gerrit-PatchSet: 12 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 20:28:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:28:26 +0000 Subject: libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief In-Reply-To: References: Message-ID: Patch Set 2: we've had this discussion before, and I remember not being convinced about it. How does AUTOBRIEF decide which part is "brief" and which part is "verbose"? -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 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 Wed Jun 21 20:28:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:28:44 +0000 Subject: libosmocore[master]: doxygen: drop INPUT gsm/protocol, already part of gsm/ In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5dc22ca65740a88540dacc61c0742fede172de9c 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 Wed Jun 21 20:29:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:29:57 +0000 Subject: libosmocore[master]: doxygen: include all undocumented items in the API doc In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 slightly unrelated: we should probably disable the EXTRACT_STATIC part to avoid documenting functions that users of the library cannot call anyway? -- To view, visit https://gerrit.osmocom.org/2981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39f558ec0a33a61a1fcec0554f53c8e7668733de 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 Wed Jun 21 20:30:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:30:02 +0000 Subject: libosmocore[master]: doxygen: add missing gb API doc generation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 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 Wed Jun 21 20:30:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:30:51 +0000 Subject: libosmocore[master]: doxygen: linuxlist.h: fix some API doc to use doxygen Qt style In-Reply-To: References: Message-ID: Patch Set 2: the rationale of not changing this code is that it was inherited from the Linux kernel, and all related whitespace changes will make it more difficult to re-sync with a more recent kernel version of that file. So I'm a bit undecided here... -- To view, visit https://gerrit.osmocom.org/2984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ae25c9bc6b7504402e583a6ce77b037083dcb80 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 Wed Jun 21 20:30:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:30:59 +0000 Subject: libosmocore[master]: api doc typo fix in core/logging.h In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3f1cd5b10e7beccb61f370d7f8fa2666e56542cf 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 Wed Jun 21 20:31:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:31:16 +0000 Subject: libosmocore[master]: doxygen: various fixes in core/timer.h In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ea5b88cbe9cb54702429158bf47e768e04e8fe7 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 Wed Jun 21 20:45:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 21 Jun 2017 20:45:12 +0000 Subject: libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Ok, I read https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation now and it is the first full stop. Works for me. -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 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 Wed Jun 21 21:01:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 21:01:45 +0000 Subject: [PATCH] libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote Message-ID: Review at https://gerrit.osmocom.org/3000 osmo_sock_get_name(): clearly indicate local and remote In a string like 127.0.0.1:2905<->127.0.0.1:60661 it is hard to tell which is the local part. I'd have expected it on the left, but it is actually on the right. To avoid doubt and bypass bikesheds on which side should be what, clearly mark the two sides as remote and local. (r=127.0.0.1:2905<->l=127.0.0.1:60661) Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 --- M src/socket.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/3000/1 diff --git a/src/socket.c b/src/socket.c index 6fa05a8..940fc6f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -608,11 +608,11 @@ if (rc < 0) goto local_only; - return talloc_asprintf(ctx, "(%s:%s<->%s:%s)", hostbuf_r, portbuf_r, + return talloc_asprintf(ctx, "(r=%s:%s<->l=%s:%s)", hostbuf_r, portbuf_r, hostbuf_l, portbuf_l); local_only: - return talloc_asprintf(ctx, "(NULL<->%s:%s)", hostbuf_l, portbuf_l); + return talloc_asprintf(ctx, "(r=NULL<->l=%s:%s)", hostbuf_l, portbuf_l); } #endif /* HAVE_SYS_SOCKET_H */ -- To view, visit https://gerrit.osmocom.org/3000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 21:01:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 21:01:53 +0000 Subject: [PATCH] libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote Message-ID: Review at https://gerrit.osmocom.org/3001 osmo_sock_get_name(): clearly indicate local and remote In a string like (127.0.0.1:2905<->127.0.0.1:60661) it is hard to tell which is the local part. I'd have expected it on the left, but it is actually on the right. To avoid doubt and bypass bikesheds on which side should be what, clearly mark the two sides as remote and local. (remote=127.0.0.1:2905<->local=127.0.0.1:60661) Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 --- M src/socket.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/3001/1 diff --git a/src/socket.c b/src/socket.c index 6fa05a8..b1cfd8f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -608,11 +608,11 @@ if (rc < 0) goto local_only; - return talloc_asprintf(ctx, "(%s:%s<->%s:%s)", hostbuf_r, portbuf_r, + return talloc_asprintf(ctx, "(remote=%s:%s<->local=%s:%s)", hostbuf_r, portbuf_r, hostbuf_l, portbuf_l); local_only: - return talloc_asprintf(ctx, "(NULL<->%s:%s)", hostbuf_l, portbuf_l); + return talloc_asprintf(ctx, "(remote=NULL<->local=%s:%s)", hostbuf_l, portbuf_l); } #endif /* HAVE_SYS_SOCKET_H */ -- To view, visit https://gerrit.osmocom.org/3001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 21:02:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 21:02:39 +0000 Subject: libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Patch Set 1: Another contestant for this change is https://gerrit.osmocom.org/3000 -- let the votes decide which one wins. -- To view, visit https://gerrit.osmocom.org/3001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 21:02:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 21:02:53 +0000 Subject: libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Patch Set 1: Another contestant for this change is https://gerrit.osmocom.org/3001 -- let the votes decide which one wins. -- To view, visit https://gerrit.osmocom.org/3000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 Gerrit-PatchSet: 1 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 Wed Jun 21 21:04:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 21:04:44 +0000 Subject: libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 I prefer this one. -- To view, visit https://gerrit.osmocom.org/3001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 21 22:19:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 22:19:21 +0000 Subject: [PATCH] libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3001 to look at the new patch set (#2). osmo_sock_get_name(): clearly indicate local and remote In a string like (127.0.0.1:2905<->127.0.0.1:60661) it is hard to tell which is the local part. I'd have expected it on the left, but it is actually on the right. To avoid doubt and bypass bikesheds on which side should be what, clearly mark the two sides as remote and local. (remote=127.0.0.1:2905<->local=127.0.0.1:60661) Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 --- M src/socket.c M tests/socket/socket_test.c 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/3001/2 diff --git a/src/socket.c b/src/socket.c index 6fa05a8..b1cfd8f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -608,11 +608,11 @@ if (rc < 0) goto local_only; - return talloc_asprintf(ctx, "(%s:%s<->%s:%s)", hostbuf_r, portbuf_r, + return talloc_asprintf(ctx, "(remote=%s:%s<->local=%s:%s)", hostbuf_r, portbuf_r, hostbuf_l, portbuf_l); local_only: - return talloc_asprintf(ctx, "(NULL<->%s:%s)", hostbuf_l, portbuf_l); + return talloc_asprintf(ctx, "(remote=NULL<->local=%s:%s)", hostbuf_l, portbuf_l); } #endif /* HAVE_SYS_SOCKET_H */ diff --git a/tests/socket/socket_test.c b/tests/socket/socket_test.c index b56d50c..87b2da1 100644 --- a/tests/socket/socket_test.c +++ b/tests/socket/socket_test.c @@ -49,7 +49,7 @@ * as apparently that won't work on FreeBSD if there's only one * address (e.g. 127.0.0.1) assigned to the entire system, like * the Osmocom FreeBSD build slaves */ - OSMO_ASSERT(!strncmp(name, "(NULL<->", 7)); + OSMO_ASSERT(!strncmp(name, "(remote=NULL<->", 14)); talloc_free(name); /* expect it to be blocking */ rc = fcntl(fd, F_GETFL); @@ -87,7 +87,7 @@ * as apparently that won't work on FreeBSD if there's only one * address (e.g. 127.0.0.1) assigned to the entire system, like * the Osmocom FreeBSD build slaves */ - OSMO_ASSERT(!strncmp(name, "(NULL<->", 7)); + OSMO_ASSERT(!strncmp(name, "(remote=NULL<->", 14)); talloc_free(name); /* expect it to be blocking */ rc = fcntl(fd, F_GETFL); @@ -116,7 +116,7 @@ /* For some reason, on the jenkins.osmocom.org build slave with * FreeBSD 10 inside a jail, it fails. Works fine on laforge's * FreeBSD 10 or 11 VM at home */ - OSMO_ASSERT(!strncmp(name, "(127.0.0.1:53<->127.0.0.1", 25)); + OSMO_ASSERT(!strncmp(name, "(remote=127.0.0.1:53<->local=127.0.0.1", 38)); #endif talloc_free(name); -- To view, visit https://gerrit.osmocom.org/3001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id3e32de19fe07ed5b19ee5e67494926a511266b5 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 21 22:19:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 21 Jun 2017 22:19:44 +0000 Subject: [PATCH] libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3000 to look at the new patch set (#2). osmo_sock_get_name(): clearly indicate local and remote In a string like 127.0.0.1:2905<->127.0.0.1:60661 it is hard to tell which is the local part. I'd have expected it on the left, but it is actually on the right. To avoid doubt and bypass bikesheds on which side should be what, clearly mark the two sides as remote and local. (r=127.0.0.1:2905<->l=127.0.0.1:60661) Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 --- M src/socket.c M tests/socket/socket_test.c 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/3000/2 diff --git a/src/socket.c b/src/socket.c index 6fa05a8..940fc6f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -608,11 +608,11 @@ if (rc < 0) goto local_only; - return talloc_asprintf(ctx, "(%s:%s<->%s:%s)", hostbuf_r, portbuf_r, + return talloc_asprintf(ctx, "(r=%s:%s<->l=%s:%s)", hostbuf_r, portbuf_r, hostbuf_l, portbuf_l); local_only: - return talloc_asprintf(ctx, "(NULL<->%s:%s)", hostbuf_l, portbuf_l); + return talloc_asprintf(ctx, "(r=NULL<->l=%s:%s)", hostbuf_l, portbuf_l); } #endif /* HAVE_SYS_SOCKET_H */ diff --git a/tests/socket/socket_test.c b/tests/socket/socket_test.c index b56d50c..11ef8da 100644 --- a/tests/socket/socket_test.c +++ b/tests/socket/socket_test.c @@ -49,7 +49,7 @@ * as apparently that won't work on FreeBSD if there's only one * address (e.g. 127.0.0.1) assigned to the entire system, like * the Osmocom FreeBSD build slaves */ - OSMO_ASSERT(!strncmp(name, "(NULL<->", 7)); + OSMO_ASSERT(!strncmp(name, "(r=NULL<->", 9)); talloc_free(name); /* expect it to be blocking */ rc = fcntl(fd, F_GETFL); @@ -87,7 +87,7 @@ * as apparently that won't work on FreeBSD if there's only one * address (e.g. 127.0.0.1) assigned to the entire system, like * the Osmocom FreeBSD build slaves */ - OSMO_ASSERT(!strncmp(name, "(NULL<->", 7)); + OSMO_ASSERT(!strncmp(name, "(r=NULL<->", 9)); talloc_free(name); /* expect it to be blocking */ rc = fcntl(fd, F_GETFL); @@ -116,7 +116,7 @@ /* For some reason, on the jenkins.osmocom.org build slave with * FreeBSD 10 inside a jail, it fails. Works fine on laforge's * FreeBSD 10 or 11 VM at home */ - OSMO_ASSERT(!strncmp(name, "(127.0.0.1:53<->127.0.0.1", 25)); + OSMO_ASSERT(!strncmp(name, "(r=127.0.0.1:53<->l=127.0.0.1", 29)); #endif talloc_free(name); -- To view, visit https://gerrit.osmocom.org/3000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:14:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:14:57 +0000 Subject: libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* In-Reply-To: References: Message-ID: Patch Set 2: the reason to exclude it is that this directory contains definitions taken 1:1 from related GSM specifications and thus not some APIs or data types that we have come up with. I think it's best to not replicate what's written in 3GPP specs. However, we can of course include it merely to point to the related 3GPP specs / sections -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 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 Thu Jun 22 06:15:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:15:35 +0000 Subject: libosmocore[master]: osmo_sock_get_name(): clearly indicate local and remote In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43dcc6a1906429bd0955fd7fe2eb5b8495b592d8 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:19:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:19:34 +0000 Subject: libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:20:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:20:48 +0000 Subject: libosmo-sccp[master]: configure.ac: Use -Werror in C(PP)FLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia753a3080ef54ac248dacce5cd692fdd38f7649a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:21:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:21:40 +0000 Subject: libosmo-sccp[master]: configure.ac: Use -Wall in C(PP)FLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e49427b8267bbdb05d0121971a56359dbecd690 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:21:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:21:55 +0000 Subject: libosmo-sccp[master]: xua_test.c: remove useless keyword in struct declaration In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:22:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:22:02 +0000 Subject: libosmo-sccp[master]: stp_main.c: Add missing header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:22:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:22:22 +0000 Subject: libosmo-sccp[master]: xua_internal.h: Add missing functions required by xua_test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic97de20c567bf67c513a45060e1e96e4b67b2311 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:22:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:22:44 +0000 Subject: libosmo-sccp[master]: sccp_test_vty: Fix compilation warning: Unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:22:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:22:57 +0000 Subject: libosmo-sccp[master]: sccp_scrc: Fix warning: uneeded constant evaulation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48a711f3a43496e2c0c637f34f56784f765938c4 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 06:23:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:05 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_scrc: Fix warning: uneeded constant evaulation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_scrc: Fix warning: uneeded constant evaulation ...................................................................... sccp_scrc: Fix warning: uneeded constant evaulation translate function is always present in the same file, thus we can remove this check. Fixes following warning: warning: the address of ?translate? will always evaluate as ?true? [-Waddress] if (translate && As requested by Harald, leave a comment there stating that there are some checks missing and yet to be implemented. The translate function check was used for this purpose. Change-Id: I48a711f3a43496e2c0c637f34f56784f765938c4 --- M src/sccp_scrc.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index 9a6a865..a4ce34c 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -348,7 +348,7 @@ } /* Called address includes SSN? */ if (called->presence & OSMO_SCCP_ADDR_T_SSN) { - if (translate && + if (/* TODO: check if we are doing global translation && */ (called->presence & OSMO_SCCP_ADDR_T_GT)) return scrc_translate_node_9(inst, xua, called); else -- To view, visit https://gerrit.osmocom.org/2993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48a711f3a43496e2c0c637f34f56784f765938c4 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:06 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_test_vty: Fix compilation warning: Unused variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_test_vty: Fix compilation warning: Unused variable ...................................................................... sccp_test_vty: Fix compilation warning: Unused variable Instead of removing the variable, leave it there with unused attribute set because it is an example and gives extra information to potential readers of the function (it provides you with the actual type of void* _scu). Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab --- M examples/sccp_test_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/examples/sccp_test_vty.c b/examples/sccp_test_vty.c index ddfbb27..d809fbc 100644 --- a/examples/sccp_test_vty.c +++ b/examples/sccp_test_vty.c @@ -117,7 +117,7 @@ static int testclnt_prim_cb(struct osmo_prim_hdr *oph, void *_scu) { - struct osmo_sccp_user *scu = _scu; + struct osmo_sccp_user *scu __attribute__((unused)) = _scu; struct osmo_scu_prim *scu_prim = (struct osmo_scu_prim *) oph; switch (OSMO_PRIM_HDR(&scu_prim->oph)) { -- To view, visit https://gerrit.osmocom.org/2994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:06 +0000 Subject: [MERGED] libosmo-sccp[master]: xua_internal.h: Add missing functions required by xua_test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: xua_internal.h: Add missing functions required by xua_test ...................................................................... xua_internal.h: Add missing functions required by xua_test Change-Id: Ic97de20c567bf67c513a45060e1e96e4b67b2311 --- M src/xua_internal.h 1 file changed, 5 insertions(+), 0 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 bb54205..991110b 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -72,3 +72,8 @@ int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua); int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg); + +int osmo_isup_party_parse(char *out_digits, const uint8_t *in, + unsigned int in_num_bytes, bool odd); +int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, + const uint8_t *addr, unsigned int addrlen); -- To view, visit https://gerrit.osmocom.org/2995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic97de20c567bf67c513a45060e1e96e4b67b2311 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:06 +0000 Subject: [MERGED] libosmo-sccp[master]: stp_main.c: Add missing header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: stp_main.c: Add missing header ...................................................................... stp_main.c: Add missing header stp_main uses osmo_fsm_vty_add_cmds which is defined in /osmocom/vty/misc.h Fixes 'implicit declaration of function' compilation warning. Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46 --- M stp/stp_main.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/stp/stp_main.c b/stp/stp_main.c index 564ced5..074272b 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include -- To view, visit https://gerrit.osmocom.org/2996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:07 +0000 Subject: [MERGED] libosmo-sccp[master]: xua_test.c: remove useless keyword in struct declaration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: xua_test.c: remove useless keyword in struct declaration ...................................................................... xua_test.c: remove useless keyword in struct declaration Fixes following warning: warning: useless storage class specifier in empty declaratio Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d --- M tests/xua/xua_test.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index d1aa564..da3ee95 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -54,7 +54,7 @@ /* SCCP Address Parsing */ -static struct sccp_addr_testcase { +struct sccp_addr_testcase { struct osmo_sccp_addr expected; uint8_t *bin; unsigned int bin_len; -- To view, visit https://gerrit.osmocom.org/2997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:07 +0000 Subject: [MERGED] libosmo-sccp[master]: configure.ac: Use -Wall in C(PP)FLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Use -Wall in C(PP)FLAGS ...................................................................... configure.ac: Use -Wall in C(PP)FLAGS Change-Id: I1e49427b8267bbdb05d0121971a56359dbecd690 --- M configure.ac 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 3a05d54..36cbb59 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,9 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" + AC_OUTPUT( libosmo-sigtran.pc libosmo-sccp.pc @@ -73,4 +76,3 @@ examples/Makefile stp/Makefile Makefile) - -- To view, visit https://gerrit.osmocom.org/2998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e49427b8267bbdb05d0121971a56359dbecd690 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:07 +0000 Subject: [MERGED] libosmo-sccp[master]: configure.ac: Use -Werror in C(PP)FLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Use -Werror in C(PP)FLAGS ...................................................................... configure.ac: Use -Werror in C(PP)FLAGS Change-Id: Ia753a3080ef54ac248dacce5cd692fdd38f7649a --- 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 36cbb59..3c498c8 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS+=" -Wall -Werror" +CPPFLAGS+=" -Wall -Werror" AC_OUTPUT( libosmo-sigtran.pc -- To view, visit https://gerrit.osmocom.org/2999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia753a3080ef54ac248dacce5cd692fdd38f7649a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 22 06:23:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:41 +0000 Subject: libosmocore[master]: doxygen: config: one enum val per line In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63d6f42567f532851e19eb8a6c842e418ce666af 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 Thu Jun 22 06:23:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:23:49 +0000 Subject: libosmocore[master]: doxygen: unify use of \file across the board In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b 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 Thu Jun 22 06:25:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:25:18 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Fix warning: implicit use of function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/2989/1/src/trau/osmo_ortp.c File src/trau/osmo_ortp.c: Line 367: unrelated whitespace change, but let's ignore that once. -- To view, visit https://gerrit.osmocom.org/2989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9cadcb31ce7ade3632d83753be97fdc9ea518b5b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jun 22 06:25:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:25:50 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Fix warning: use updated ortp API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jun 22 06:25:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:25:53 +0000 Subject: libosmo-abis[master]: configure.ac: Use -Wall in C(PP)FLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5033387e4a4206f7d34d1db3c6ede9255d199941 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jun 22 06:26:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:26:57 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Fix warning: use updated ortp API In-Reply-To: References: Message-ID: Patch Set 1: seems like jenkins on debian8 doesn't agree with this... -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jun 22 06:27:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:27:26 +0000 Subject: osmo-pcu[master]: lc15: use generic L1 headers helper In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3dc621731f47650cbc15a5f17b9e899e9ed2770f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:27:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:27:36 +0000 Subject: [MERGED] osmo-pcu[master]: lc15: use generic L1 headers helper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: use generic L1 headers helper ...................................................................... lc15: use generic L1 headers helper * use generic L1 headers helper for both sysmocom-dsp and lc15bts-phy options * use sh instead of bash Related: SYS#3683 Change-Id: I3dc621731f47650cbc15a5f17b9e899e9ed2770f --- M contrib/jenkins.sh 1 file changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 8a96380..9c5c2e2 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex @@ -22,17 +22,19 @@ # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" - if [ ! -d layer1-api ]; then - git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api - fi - cd layer1-api - git fetch origin - git reset --hard origin/master + osmo-layer1-headers.sh sysmo + cd layer1-headers api_incl="$inst/include/sysmocom/femtobts/" mkdir -p "$api_incl" cp include/*.h "$api_incl" cd "$base" +elif [ "$with_dsp" = lc15 ]; then + PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc" + cd "$deps" + osmo-layer1-headers.sh lc15 + cd "$base" + elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then echo "Direct DSP access disabled" else -- To view, visit https://gerrit.osmocom.org/2970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3dc621731f47650cbc15a5f17b9e899e9ed2770f Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:28:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:28:43 +0000 Subject: osmo-trx[master]: sigProcLib: Replace dynamically allocated resampling buffers In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:28:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:28:56 +0000 Subject: osmo-trx[master]: sigProcLib: Specify standard namespace for isnan() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49328c43fdd690a4e6a2b2e949411aaf5674ead1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:30:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:30:35 +0000 Subject: libosmocore[master]: gitignore some tests In-Reply-To: References: Message-ID: Patch Set 1: please simply put tests/*/*_test in .gitignore and resolve the problem once and for all. -- To view, visit https://gerrit.osmocom.org/2976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:31:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:31:27 +0000 Subject: openbsc[master]: Fix BTS features length check In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Thu Jun 22 06:32:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:32:47 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:34:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:34:55 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 I'm not sure if this is really useful. Actually, to me, you are hiding what the code does. Every c programmer knows what "foo & (1 << bit)" means. By introducing "non-standard" syntax for such basic operations, I think you're actually making code harder to read. With that kind of argument, we could also be adding macros like OSMO_INC(x) instead of "x += 1" ... -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:35:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:35:26 +0000 Subject: osmo-ci[master]: lc15: correct default master branch In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e86edc34fdb8c7bc57f87c41e05dd2338dd2506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:36:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:36:49 +0000 Subject: mncc-python[master]: Bearer capability not provided during MO call using mncc-pyt... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If77851b86111d62d82221a886ed2391179080cca Gerrit-PatchSet: 1 Gerrit-Project: mncc-python Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Gerard Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:36:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:36:56 +0000 Subject: mncc-python[master]: Bearer capability not provided during MO call using mncc-pyt... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/2841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If77851b86111d62d82221a886ed2391179080cca Gerrit-PatchSet: 1 Gerrit-Project: mncc-python Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Gerard Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:36:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:36:57 +0000 Subject: [MERGED] mncc-python[master]: Bearer capability not provided during MO call using mncc-pyt... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bearer capability not provided during MO call using mncc-python, which results in GSM IE error (96) invalid mandatory information sent by Network -> MS (mncc-python) Verified this error by GSMTAP using mncc-python interface OsmocomBB to network Proposed C ...................................................................... Bearer capability not provided during MO call using mncc-python, which results in GSM IE error (96) invalid mandatory information sent by Network -> MS (mncc-python) Verified this error by GSMTAP using mncc-python interface OsmocomBB to network Proposed Changes: In case of MO call (_onmncc_setup_req) caller needs to provide bearer_cap speech version Added mncc.bearer_cap in mncc_sock.py based on codecs = GSM48.AllCodecs Added new field mncc.MNCC_F_BEARER_CAP in mncc.MNCC_SETUP_REQ, when call is initiated (MO) from MS -> network Change-Id: If77851b86111d62d82221a886ed2391179080cca --- M gsm_call_fsm.py M mncc_sock.py 2 files changed, 16 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/gsm_call_fsm.py b/gsm_call_fsm.py index fa15940..167a805 100644 --- a/gsm_call_fsm.py +++ b/gsm_call_fsm.py @@ -14,7 +14,7 @@ import pykka from fysom import Fysom -from mncc_sock import mncc_msg, mncc_number, mncc_rtp_msg, mncc_bridge_msg +from mncc_sock import mncc_msg, mncc_number, mncc_rtp_msg, mncc_bridge_msg, mncc_bearer_cap Uint32Array2 = mncc.uint32_t * 2 @@ -82,9 +82,10 @@ def _onmncc_setup_req(self, e): msg = mncc_msg(msg_type = mncc.MNCC_SETUP_REQ, callref = self.callref, - fields = mncc.MNCC_F_CALLED | mncc.MNCC_F_CALLING, + fields = mncc.MNCC_F_CALLED | mncc.MNCC_F_CALLING | mncc.MNCC_F_BEARER_CAP, calling = mncc_number(self.calling), - called = mncc_number(self.called)) + called = mncc_number(self.called), + bearer_cap = mncc_bearer_cap(self.codecs_permitted)) self.mncc_ref.tell({'type': 'send', 'msg': msg}) def find_matching_codec(self, ms_codecs): diff --git a/mncc_sock.py b/mncc_sock.py index 3d29691..3cc1ba1 100644 --- a/mncc_sock.py +++ b/mncc_sock.py @@ -52,6 +52,18 @@ plan = num_plan, present = num_present, screen = num_screen) +def mncc_bearer_cap(codecs_permitted): + speech_ver = ctypes.c_int * 8 + speech_types = speech_ver() + index = 0 + + for codec in codecs_permitted: + speech_types[index] = codec + index = index + 1 + + speech_types[index] = -1 + return mncc.gsm_mncc_bearer_cap(coding = 0, speech_ctm=0, radio = 1, speech_ver = speech_types, transfer = 0, mode = 0) + class MnccSocketBase(object): def send(self, msg): return self.sock.sendall(msg.send()) -- To view, visit https://gerrit.osmocom.org/2841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If77851b86111d62d82221a886ed2391179080cca Gerrit-PatchSet: 1 Gerrit-Project: mncc-python Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Gerard Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:37:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:37:22 +0000 Subject: libosmo-netif[master]: src: use osmo_timer_setup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:37:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:37:27 +0000 Subject: [MERGED] libosmo-netif[master]: src: use osmo_timer_setup() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: src: use osmo_timer_setup() ...................................................................... src: use osmo_timer_setup() Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a --- M src/osmux.c M src/rs232.c M src/stream.c 3 files changed, 6 insertions(+), 10 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/osmux.c b/src/osmux.c index 91054f1..23a6440 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -721,8 +721,7 @@ INIT_LLIST_HEAD(&batch->circuit_list); batch->remaining_bytes = h->batch_size; - batch->timer.cb = osmux_batch_timer_expired; - batch->timer.data = h; + osmo_timer_setup(&batch->timer, osmux_batch_timer_expired, h); h->internal_data = (void *)batch; @@ -803,8 +802,7 @@ h->msg = msg; h->tx_cb = tx_cb; h->data = data; - h->timer.cb = osmux_tx_cb; - h->timer.data = h; + osmo_timer_setup(&h->timer, osmux_tx_cb, h); #ifdef DEBUG_TIMING osmo_gettimeofday(&h->start, NULL); diff --git a/src/rs232.c b/src/rs232.c index c05a693..49520d8 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -234,10 +234,9 @@ return rc; } - if (r->cfg.delay_us) { - r->tx_timer.cb = rs232_tx_timer_cb; - r->tx_timer.data = r; - } + if (r->cfg.delay_us) + osmo_timer_setup(&r->tx_timer, rs232_tx_timer_cb, r); + return 0; } diff --git a/src/stream.c b/src/stream.c index b96293e..a80d842 100644 --- a/src/stream.c +++ b/src/stream.c @@ -281,8 +281,7 @@ cli->ofd.cb = osmo_stream_cli_fd_cb; cli->ofd.data = cli; cli->state = STREAM_CLI_STATE_CONNECTING; - cli->timer.cb = cli_timer_cb; - cli->timer.data = cli; + osmo_timer_setup(&cli->timer, cli_timer_cb, cli); cli->reconnect_timeout = 5; /* default is 5 seconds. */ INIT_LLIST_HEAD(&cli->tx_queue); -- To view, visit https://gerrit.osmocom.org/2856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:37:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:37:38 +0000 Subject: libosmo-abis[master]: src: use osmo_timer_setup() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4ca4950e49a09c63b608b13ac7561ebbd351889a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:37:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:37:39 +0000 Subject: [MERGED] libosmo-abis[master]: src: use osmo_timer_setup() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: src: use osmo_timer_setup() ...................................................................... src: use osmo_timer_setup() Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: I4ca4950e49a09c63b608b13ac7561ebbd351889a --- M src/input/dahdi.c M src/input/ipaccess.c M src/input/misdn.c M src/input/unixsocket.c 4 files changed, 4 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/src/input/dahdi.c b/src/input/dahdi.c index 0945daa..911f862 100644 --- a/src/input/dahdi.c +++ b/src/input/dahdi.c @@ -252,8 +252,7 @@ sign_link->sapi, msg); /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, 50000); return 0; diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index ac84ffc..63ee167 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -354,8 +354,7 @@ } /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); /* Reducing this might break the nanoBTS 900 init. */ osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); diff --git a/src/input/misdn.c b/src/input/misdn.c index 98a836f..347b7bf 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -283,8 +283,7 @@ /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); return ret; diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c index 4f287ae..63bd796 100644 --- a/src/input/unixsocket.c +++ b/src/input/unixsocket.c @@ -160,8 +160,7 @@ } /* set tx delay timer for next event */ - e1i_ts->sign.tx_timer.cb = timeout_ts1_write; - e1i_ts->sign.tx_timer.data = e1i_ts; + osmo_timer_setup(&e1i_ts->sign.tx_timer, timeout_ts1_write, e1i_ts); osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); -- To view, visit https://gerrit.osmocom.org/2855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ca4950e49a09c63b608b13ac7561ebbd351889a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:40:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:40:47 +0000 Subject: openbsc[master]: Fix BTS number in attribute requests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/2868/1/openbsc/src/libbsc/bsc_init.c File openbsc/src/libbsc/bsc_init.c: Line 351 this is most certainly wrong for multi-trx setups. We iterate over the list of transceivers and we have to use the id of the respective transceiver. Line 346: abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); I think removing trx->nr makes a lot of sens. But for bts->nr, I'm not sure. Any change here would have to be validated with both classic E1 based multi-BTS setups as well as abis_ip. -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Thu Jun 22 06:42:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:42:20 +0000 Subject: osmo-sim-auth[master]: SIM API's to fetch information from SIM file system like Kc, ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/2833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f43ff918a6b96f86e661297e84010e6cdf17b84 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sim-auth Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:42:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:42:22 +0000 Subject: [MERGED] osmo-sim-auth[master]: SIM API's to fetch information from SIM file system like Kc, ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SIM API's to fetch information from SIM file system like Kc, LOCI, MSISDN etc. Added -p option for fetching SIM information based on the parameter passed. ...................................................................... SIM API's to fetch information from SIM file system like Kc, LOCI, MSISDN etc. Added -p option for fetching SIM information based on the parameter passed. Change-Id: I1f43ff918a6b96f86e661297e84010e6cdf17b84 --- M card/SIM.py M osmo-sim-auth.py 2 files changed, 335 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/card/SIM.py b/card/SIM.py index 1ad45e3..5d97ba4 100644 --- a/card/SIM.py +++ b/card/SIM.py @@ -29,6 +29,7 @@ from card.ICC import ISO7816 from card.FS import SIM_FS from card.utils import * +from binascii import * class SIM(ISO7816): @@ -50,6 +51,18 @@ print '[DBG] type definition: %s' % type(self) print '[DBG] CLA definition: %s' % hex(self.CLA) + self.caller = { + 'KC' : self.get_Kc, + 'IMSI' : self.get_imsi, + 'LOCI' : self.get_loci, + 'HPPLMN' : self.get_hpplmn, + 'PLMN_SEL' : self.get_plmnsel, + 'ACC' : self.get_acc, + 'ICCID' : self.get_iccid, + 'FPLMN' : self.get_fplmn, + 'MSISDN' : self.get_msisdn, + 'SMSP' : self.get_smsp, + } def sw_status(self, sw1, sw2): ''' @@ -264,11 +277,317 @@ # and parse the received data into the IMSI structure if 'Data' in imsi.keys() and len(imsi['Data']) == 9: + + if self.dbg: + print "[DBG] International Mobile Subscriber Identity (IMSI): %s " % decode_BCD(imsi['Data'])[3:] + return decode_BCD(imsi['Data'])[3:] # if issue with the content of the DF_IMSI file if self.dbg: print '[DBG] %s' % self.coms() return None + + # This contains Ciphering Key for GSM + # File Size = 9 bytes + # select Kc to get Kc (1-8 bytes) and + # cihering key sequence number (9th byte) + # returns bytes Kc on success or None on error + def get_Kc(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + Kc = self.select([0x6F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in Kc.keys() and len(Kc['Data']) == 9: + if self.dbg: + print "[DBG] Ciphering Key (Kc): %s" % b2a_hex(byteToString(Kc['Data'][0:8])) + print "[DBG] Ciphering Key Sequence Number (n): %s " % Kc['Data'][8] + return Kc['Data'] + else: + return None + # EF loci contains location information + # This conatins TMSI, LAI, TMSI TIME, and Location update status + # and prints the information + # File Size = 11 bytes + # select LOCI to get TMSI(1-4 bytes), LAI(5-9 bytes), TMSI TIME (10th byte) + # LOCI includes Mobile country code (MCC), Mobile network code (MNC), + # and Locatio area code (LAC) + # and location update status (11th byte) + # returns bytes LOCI on success or None on error + def get_loci(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + loci = self.select([0x6F, 0x7E]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in loci.keys() and len(loci['Data']) == 11: + loci = loci['Data'] + + if self.dbg: + print "[DBG] Temporary Mobile Subscriber Identity (TMSI): %s" % b2a_hex(byteToString(loci[0:4])) + LAI = loci[4:9] + print "[DBG] Location Area Identity hex (LAI): %s" % b2a_hex(byteToString(LAI)) + MCC = ((LAI[0] & 0x0f) << 8) | (LAI[0] & 0xf0) | (LAI[1] & 0x0f) + MNC = ((LAI[2] & 0x0f) << 8) | (LAI[2] & 0xf0) | ((LAI[1] & 0xf0) >> 4) + LAC = LAI[3:5] + print "[DBG] Mobile Country Code (MCC): %s " % format(int(hex(MCC),16),"x") + print "[DBG] Mobile Country Code (MNC): %s " % format(int(hex(MNC),16),"x") + print "[DBG] Location Area Code (LAC): %s " % b2a_hex(byteToString(LAC)) + print "[DBG] TMSI TIME: %s" % loci[9] + print "[DBG] Location Update Status: %s" % loci[10] + + return loci + else: + return None + + # EF plmnsel contains Public Land Mobile Network records + # File Size: 3n (n >=8) + # Contents Mobile country code (MCC) & Mobile Netwokr code (MNC) (total 3 bytes) + # excess bytes set to 'FF' + # returns bytes PLMNSel on success or None on error + def get_plmnsel(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + plmnsel = self.select([0x6F, 0x30]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in plmnsel.keys(): + plmnsel = plmnsel['Data'] + + if self.dbg: + print "[DBG] Stored PLMN selector:\tMCC | MNC\n" + index = 0 + while len(plmnsel) > 3 and index < len(plmnsel): + if plmnsel[index] == 0xFF and plmnsel[index+1] == 0xFF and plmnsel[index+2] == 0xFF: + break + else: + MCC = ((plmnsel[index] & 0x0f) << 8) | (plmnsel[index] & 0xf0) | (plmnsel[index+1] & 0x0f) + MNC = ((plmnsel[index+2] & 0x0f) << 8) | (plmnsel[index+2] & 0xf0) | ((plmnsel[index+1] & 0xf0) >> 4) + if (MNC & 0x000f) == 0x000f: + MNC = MNC >> 4 + print "[DBG] \t\t\t\t%03x %02x" %(MCC, MNC) + else: + print "[DBG] \t\t\t\t%03x %03x" %(MCC, MNC) + index +=3 + + return plmnsel + else: + return None + + # select DF_GSM for Higher Priority PLMN search period + # File Size: 1 byte + # Contains the interval of time between searches for a higher priority PLMN + # 'YZ': (16Y + Z) minutes + # returns byte on success or None on error + def get_hpplmn(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + hpplmn = self.select([0x6F, 0x31]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in hpplmn.keys() and len(hpplmn['Data']) == 1: + hpplmn = hpplmn['Data'] + + if self.dbg: + if hpplmn[0] < 9: + print "[DBG] Higher Priority PLMN search period %s min" % hpplmn[0] + else: + hpplmn_val = list(str(hpplmn[0])) + interval = (16 * int(hpplmn_val[0])) + int(hpplmn_val[1]) + print "[DBG] Higher Priority PLMN search period %s min" % interval + + return hpplmn + else: + return None + + # select DF_GSM for accessing Access control class + # The access control class is a parameter to control the RACH utilization + # File Size = 2 bytes + # returns byte on success or None on error + def get_acc(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + acc = self.select([0x6F, 0x78]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in acc.keys() and len(acc['Data']) == 2: + acc = acc['Data'] + + if self.dbg: + print "[DBG] Access Control Classes %s " % b2a_hex(byteToString(acc)) + + return acc + else: + return None + + # select DF_TELECOM for Mobile Station Integrated Services Digital Network (MSISDN) + # Record Length: X + 14 bytes + # Type of number (TON 4 bits) and numbering plan identification (NPI 3 bits) 8th bt is always 1 = 1 byte + # Dialling Number aka Calling Number + # returns an array of msisdn's or None on error + def get_msisdn(self): + self.select([0x7F, 0x10]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + msisdn = self.select([0x6F, 0x40]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in msisdn.keys(): + msisdns = msisdn['Data'] + + if self.dbg: + for msisdn in msisdns: + rec_length = len(msisdn) - 14 + len_bcd_number = msisdn[rec_length] + + TON_NPI = msisdn[rec_length + 1 : rec_length + 2][0] + npi = TON_NPI & 0x0F + ton = (TON_NPI >> 4) & 0x07 + print "[DBG] Type of number (TON): %s " % ton + print "[DBG] Numbering plan identification (NPI): %s " % npi + + dialing_number = msisdn[rec_length + 2 : rec_length + len_bcd_number + 1] + print "[DBG] Dialling Number: %s " % decode_BCD(dialing_number)[:-2] + + return msisdns + else: + return None + + # Short Message Service Parameters (SMSP) + # select DF_TELECOM for SIM card = 0x7f10 + # Used preparation of mobile originated short messages + # It holds the settings for sending text message + # File Size = (28 + n) bytes + # returns an array of smsps or None on error + def get_smsp(self): + self.select([0x7F, 0x10]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + smsp = self.select([0x6F, 0x42]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in smsp.keys(): + smsps = smsp['Data'] + + if self.dbg: + for smsp in smsps: + rec_length = len(smsp) - 28 + rec_len = smsp[rec_length+13] + service_center_address = decode_BCD(smsp[rec_length+15:rec_length+rec_len + 14])[:-2] + print "[DBG] TP-Service Centre Address: %s " % service_center_address + + return smsps + else: + return None + + # This EF contains 4 Forbidden PLMN 3 bytes each + # File Size 12 bytes + # Unused bytes are set to 'FF' + # returns byte on success or None on error + def get_fplmn(self): + self.select([0x7F, 0x20]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + fplmn = self.select([0x6F, 0x7b]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in fplmn.keys() and len(fplmn['Data']) == 12: + fplmn = fplmn['Data'] + + if self.dbg: + print "[DBG] Stored FPLMN selector:\tMCC | MNC\n" + index = 0 + while len(fplmn) > 3 and index < len(fplmn): + if fplmn[index] == 0xFF and fplmn[index+1] == 0xFF and fplmn[index+2] == 0xFF: + break + else: + MCC = ((fplmn[index] & 0x0f) << 8) | (fplmn[index] & 0xf0) | (fplmn[index+1] & 0x0f) + MNC = ((fplmn[index+2] & 0x0f) << 8) | (fplmn[index+2] & 0xf0) | ((fplmn[index+1] & 0xf0) >> 4) + if (MNC & 0x000f) == 0x000f: + MNC = MNC >> 4 + print "[DBG] \t\t\t\t%03x %02x" %(MCC, MNC) + else: + print "[DBG] \t\t\t\t%03x %03x" %(MCC, MNC) + index +=3 + + + return fplmn + else: + return None + + # This file holds a unique smart card identification number. + # file Size = 10 bytes (BCD encoded) + # Left justified and right-padded with 'F' + # returns bytes on success or None on error + def get_iccid(self): + iccid = self.select([0x2F, 0xE2]) + if self.coms()[2] != (0x90, 0x00): + if self.dbg: + print '[DBG] %s' % self.coms() + return None + + if 'Data' in iccid.keys() and len(iccid['Data']) == 10: + iccid = iccid['Data'] + + if self.dbg: + print "[DBG] identification (ICCID): %s" % decode_BCD(iccid) + + return iccid + else: + return None diff --git a/osmo-sim-auth.py b/osmo-sim-auth.py index 29e0226..89deac4 100755 --- a/osmo-sim-auth.py +++ b/osmo-sim-auth.py @@ -78,6 +78,16 @@ if options.ipsec: print "1%s at uma.mnc%s.mcc%s.3gppnetwork.org,%s,%s,%s" % (imsi, imsi[3:6], imsi[0:3], b2a_hex(byteToString(rand_bin)), b2a_hex(byteToString(ret[0])), b2a_hex(byteToString(ret[1]))) +def handle_sim_info(options): + s= SIM() + if not s: + print "Error opening SIM" + exit(1) + + if options.debug: + s.dbg = 1 + + s.caller.get(options.param)() if __name__ == "__main__": parser = OptionParser() @@ -94,9 +104,15 @@ parser.add_option("-I", "--ipsec", dest="ipsec", help="IPSEC mode for strongswan triplets.dat", action="store_true") + parser.add_option("-p", "--param", dest="param", + help="Retrieve SIM card parameter (mode: SIM) KC|IMSI|LOCI|HPPLMN|PLMN_SEL|ICCID|ACC|FPLMN|MSISDN|SMSP") (options, args) = parser.parse_args() + if options.param: + handle_sim_info(options) + exit(2) + if not options.rand: print "You have to specify RAND" exit(2) -- To view, visit https://gerrit.osmocom.org/2833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f43ff918a6b96f86e661297e84010e6cdf17b84 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sim-auth Gerrit-Branch: master Gerrit-Owner: Gerard Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:42:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:42:47 +0000 Subject: libosmocore[master]: core/conv: combine Viterbi implementation into a single dir In-Reply-To: References: Message-ID: Patch Set 3: the commit message explains what you do, but not *why* -- To view, visit https://gerrit.osmocom.org/2782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifbcb020c1302e49de2a9afe8567f851a16a023e6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:42:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:42:59 +0000 Subject: osmo-gsm-tester[master]: add cmdline option -R to add src file log to stdout In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f Gerrit-PatchSet: 2 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 Thu Jun 22 06:43:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:43:04 +0000 Subject: [MERGED] osmo-gsm-tester[master]: add cmdline option -R to add src file log to stdout In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add cmdline option -R to add src file log to stdout ...................................................................... add cmdline option -R to add src file log to stdout Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f --- M src/osmo-gsm-tester.py 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py index e481281..18b852b 100755 --- a/src/osmo-gsm-tester.py +++ b/src/osmo-gsm-tester.py @@ -116,7 +116,9 @@ default=None, help='Set logging level for all categories (on stdout)') parser.add_argument('-T', '--traceback', dest='trace', action='store_true', - help='Enable logging of tracebacks') + help='Enable stdout logging of tracebacks') + parser.add_argument('-R', '--source', dest='source', action='store_true', + help='Enable stdout logging of source file') parser.add_argument('-c', '--conf-dir', dest='conf_dir', help='''Specify configuration dir (overrides OSMO_GSM_TESTER_CONF env and default locations)''') @@ -138,6 +140,8 @@ log.set_all_levels(log.LEVEL_STRS.get(args.log_level)) if args.trace: log.style_change(trace=True) + if args.source: + log.style_change(src=True) if args.conf_dir: config.override_conf = args.conf_dir -- To view, visit https://gerrit.osmocom.org/2847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b21ec30453dceb53e7d4cc972607971935ef10f Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:44:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:44:12 +0000 Subject: osmo-bts[master]: OML: move BTS number check into separate function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230 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 Thu Jun 22 06:45:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:45:44 +0000 Subject: osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:46:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:46:31 +0000 Subject: libosmo-sccp[master]: sccp: Fix a classic typo of mine In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1194406d9d9c62a513fac35ffa458957809a0e3 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:46:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:46:32 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: Fix a classic typo of mine In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: Fix a classic typo of mine ...................................................................... sccp: Fix a classic typo of mine Change-Id: Ie1194406d9d9c62a513fac35ffa458957809a0e3 --- M include/sccp/sccp_types.h 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/sccp/sccp_types.h b/include/sccp/sccp_types.h index 4e99723..962bde4 100644 --- a/include/sccp/sccp_types.h +++ b/include/sccp/sccp_types.h @@ -271,7 +271,7 @@ * messages... as of Q.713 Chapter 4 */ struct sccp_connection_request { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference source_local_reference; uint8_t proto_class; @@ -299,7 +299,7 @@ } __attribute__((packed)); struct sccp_connection_confirm { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; struct sccp_source_reference source_local_reference; @@ -321,7 +321,7 @@ } __attribute__((packed)); struct sccp_connection_refused { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; uint8_t cause; @@ -341,7 +341,7 @@ } __attribute__((packed)); struct sccp_connection_released { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; struct sccp_source_reference source_local_reference; @@ -366,7 +366,7 @@ } __attribute__((packed)); struct sccp_data_form1 { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; uint8_t segmenting; @@ -383,7 +383,7 @@ struct sccp_data_unitdata { - /* mandantory */ + /* mandatory */ uint8_t type; uint8_t proto_class; @@ -422,7 +422,7 @@ struct sccp_data_it { - /* mandantory */ + /* mandatory */ uint8_t type; struct sccp_source_reference destination_local_reference; struct sccp_source_reference source_local_reference; -- To view, visit https://gerrit.osmocom.org/2823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1194406d9d9c62a513fac35ffa458957809a0e3 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:52:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:52:05 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (4 comments) Thnaks a lot for your contribution! It is very much appreciated, please forgitve me missing it in the patch review so far. It's not usual that it waits for three weeks. If you hsould see that again, feel free to send a "ping" either by private mail or here as a "reply" on the patch. https://gerrit.osmocom.org/#/c/2817/1/src/lower_mac/tetra_lower_mac.c File src/lower_mac/tetra_lower_mac.c: Line 106: [DPSAP_SCH_S] = { //DMO Synchronization Burst Block 1 I would appreciate if you could avoid introducing // style comments, we don't use them in osmo-tetra (or the GSM related projects). It's not a critical requirement, but I would appreciate it. https://gerrit.osmocom.org/#/c/2817/1/src/phy/tetra_burst.c File src/phy/tetra_burst.c: Line 305: #if 0 /* not used */ not used by whom? why? I think more context is needed here. also, it seems like an unrelated change to DMO support, right? If so, please have separate patch explaining rationale in commitlog. Line 367: break; extra whitspace at end of break https://gerrit.osmocom.org/#/c/2817/1/src/phy/tetra_burst_sync.c File src/phy/tetra_burst_sync.c: Line 147: case (TETRA_TRAIN_NORM_1): /* fall through */ why do we add patenthesis here? The other cases work without? -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:53:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:53:04 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: onee question though: This is submitted for the sq5bpf-rebase branch (which was basically just a quick test by me some time ago), but should actually go in master, or is there any specific dependency? If so, please explain. -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:54:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:54:52 +0000 Subject: openbsc[master]: Enable optional static builds In-Reply-To: References: Message-ID: Patch Set 1: > Please could you initiate this discussion? did you loose your mailing list subscription? If you'd like to have a certain feature, the normal path is that you contribute a related patch or start the discussion yourself :) -- To view, visit https://gerrit.osmocom.org/2748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 06:55:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 06:55:24 +0000 Subject: openbsc[master]: Enable optional static builds In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 08:45:19 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 22 Jun 2017 08:45:19 +0000 Subject: [ABANDON] libosmocore[master]: core/conv: combine Viterbi implementation into a single dir In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. Change subject: core/conv: combine Viterbi implementation into a single dir ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ifbcb020c1302e49de2a9afe8567f851a16a023e6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 08:49:40 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 22 Jun 2017 08:49:40 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: remove API documentation strings in header file 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/2936 to look at the new patch set (#6). cosmetic: remove API documentation strings in header file Typically we don't place comments with the function declarations in .h files. Not sure why this file has comments for each. The API doc belongs in the .c file as proper doxygen comments, and shouldn't be duplicated in the .h file. In this particular case, doxygen comments are added in the corresponding c file recently. Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad --- M include/osmocom/gsm/gsm0808_utils.h 1 file changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/2936/6 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index cb53e0c..0937630 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -23,55 +23,31 @@ #include -/* Encode AoIP transport address element */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss); - -/* Decode AoIP transport address element */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec element */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc); - -/* Decode Speech Codec element */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec list */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl); - -/* Decode Speech Codec list */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len); - -/* Encode Channel Type element */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct); - -/* Decode Channel Type element */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len); - -/* Encode Encryption Information element */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei); - -/* Decode Encryption Information element */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len); - -/* Encode Cell Identifier List element */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil); - -/* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); - int gsm0808_chan_type_to_speech_code(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 6 Gerrit-Project: libosmocore 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 Jun 22 08:49:40 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 22 Jun 2017 08:49:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_chan_type_to_speech_code() 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/2830 to look at the new patch set (#9). gsm0808: add function gsm0808_chan_type_to_speech_code() The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/2830/9 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..b510644 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,5 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +int gsm0808_chan_type_to_speech_code(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 60fb91c..64ffec4 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -645,4 +645,41 @@ return (int)(elem - old_elem); } +/*! \brief Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec. + * \param[in] perm_spch to be converted (see also gsm0808_permitted_speech) + * \returns GSM speech codec type; negative on error */ +int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch) +{ + /*! The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + } + + /* Invalid input */ + return -EINVAL; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9613c4e..ccc5b9a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 9 Gerrit-Project: libosmocore 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 Jun 22 08:49:40 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 22 Jun 2017 08:49:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: add function gsm0808_speech_codec_from_chan_type() 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/2831 to look at the new patch set (#9). gsm0808: add function gsm0808_speech_codec_from_chan_type() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be generated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 57 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/2831/9 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index b510644..cb53e0c 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -73,3 +73,5 @@ const uint8_t *elem, uint8_t len); int gsm0808_chan_type_to_speech_code(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_utils.c b/src/gsm/gsm0808_utils.c index 64ffec4..00da04b 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -682,4 +682,58 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted speech + * parameter (channel type). + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value that is used to derive the speech codec info + * (see also: enum gsm0808_speech_codec_type in gsm0808_utils.h) + * \returns zero when successful; negative on error */ +int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_chan_type_to_speech_codec(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codec + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + default: + /* Note: Not all codec types specify a default setting, + * in this case, we just set the field to zero. */ + sc->cfg = 0; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore 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 Jun 22 09:04:00 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 22 Jun 2017 09:04:00 +0000 Subject: [PATCH] libosmo-sccp[master]: ss7: Fix compilation error (warning) Message-ID: Review at https://gerrit.osmocom.org/3002 ss7: Fix compilation error (warning) In osmo_ss7_route_create() as is only initalized if lset can not be initalized. If lset can be initalized, as will not be used so everything is fine. However, the compiler complains that as may not be initalized. Initalizing as to NULL solves the problem. Change-Id: Ibcb3ebf9aaa7717cb553242517abce1499bc9c2a --- M src/osmo_ss7.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/02/3002/1 diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 78b22a7..9477543 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -723,7 +723,7 @@ { struct osmo_ss7_route *rt; struct osmo_ss7_linkset *lset; - struct osmo_ss7_as *as; + struct osmo_ss7_as *as = NULL; OSMO_ASSERT(ss7_initialized); lset = osmo_ss7_linkset_find_by_name(rtbl->inst, linkset_name); -- To view, visit https://gerrit.osmocom.org/3002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibcb3ebf9aaa7717cb553242517abce1499bc9c2a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 22 09:27:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 09:27:48 +0000 Subject: libosmocore[master]: lapd_test.c: Convert compilation warning to level message In-Reply-To: References: Message-ID: Patch Set 2: As requested, I created an issue to track this: https://osmocom.org/issues/2336 -- To view, visit https://gerrit.osmocom.org/2953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Thu Jun 22 09:41:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 09:41:02 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: I do think it's useful. At least to me it's clearer when looking at it, and easier to grep if I want to know when a bit it set or cleared or checked. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:23:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 10:23:04 +0000 Subject: [PATCH] libosmocore[master]: pseudotalloc: Add simplistic implementation of talloc_asprintf 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/2961 to look at the new patch set (#2). pseudotalloc: Add simplistic implementation of talloc_asprintf fsm.c uses this function. When compiled with --enable-embedded, it triggers a warning: fsm.c: In function 'osmo_fsm_inst_alloc': fsm.c:213:4: warning: implicit declaration of function 'talloc_asprintf' [-Wimplicit-function-declaration] fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id); Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 --- M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h 2 files changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/2961/2 diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index fe7f1ed..1df2e4b 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -5,6 +5,7 @@ #include "talloc.h" #include +#include void *_talloc_zero(const void *ctx, size_t size, const char *name) { @@ -61,3 +62,17 @@ { return talloc_zero_size(ctx, el_size * count); } + +char *talloc_asprintf(const void *ctx, const char *fmt, ...) { + char *buf; + size_t len = 128; + va_list args; + va_start(args, fmt); + + buf = talloc_size(ctx, len); + if (len < vsnprintf(buf, len, fmt, args)) + strcpy(&buf[len-6], "[...]"); + + va_end(args); + return buf; +} diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index c7127de..f4c0a74 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -39,4 +39,4 @@ size_t el_size, unsigned count, const char *name); - +char *talloc_asprintf(const void *ctx, const char *fmt, ...); -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 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 From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:23:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 10:23:04 +0000 Subject: [PATCH] libosmocore[master]: Fix warnings: tolower() and similar require uchar 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/2963 to look at the new patch set (#2). Fix warnings: tolower() and similar require uchar utils.c: In function 'osmo_str2lower': utils.c:277:3: warning: array subscript has type 'char' [-Wchar-subscripts] out[i] = tolower(in[i]); And according to man: If c is neither an unsigned char value nor EOF, the behavior of these func? tions is undefined. Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f --- M src/gsm/gsm_utils.c M src/logging.c M src/utils.c 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/2963/2 diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 9cb5df6..ab7defa 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -595,7 +595,7 @@ /*! \brief Parse string name of a GSM band */ enum gsm_band gsm_band_parse(const char* mhz) { - while (*mhz && !isdigit(*mhz)) + while (*mhz && !isdigit((unsigned char)*mhz)) mhz++; if (*mhz == '\0') diff --git a/src/logging.c b/src/logging.c index 3b3dd05..0128eda 100644 --- a/src/logging.c +++ b/src/logging.c @@ -847,7 +847,7 @@ char name[name_len]; for (j = 0; j < name_len; j++) - name[j] = tolower(info->cat[i].name[j]); + name[j] = tolower((unsigned char)info->cat[i].name[j]); name[name_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", name+1); @@ -869,7 +869,7 @@ char loglevel_str[loglevel_str_len]; for (j = 0; j < loglevel_str_len; j++) - loglevel_str[j] = tolower(loglevel_strs[i].str[j]); + loglevel_str[j] = tolower((unsigned char)loglevel_strs[i].str[j]); loglevel_str[loglevel_str_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", loglevel_str); diff --git a/src/utils.c b/src/utils.c index 6392918..d05dc15 100644 --- a/src/utils.c +++ b/src/utils.c @@ -275,7 +275,7 @@ unsigned int i; for (i = 0; i < strlen(in); i++) - out[i] = tolower(in[i]); + out[i] = tolower((const unsigned char)in[i]); out[strlen(in)] = '\0'; } @@ -288,7 +288,7 @@ unsigned int i; for (i = 0; i < strlen(in); i++) - out[i] = toupper(in[i]); + out[i] = toupper((const unsigned char)in[i]); out[strlen(in)] = '\0'; } #endif /* HAVE_CTYPE_H */ -- To view, visit https://gerrit.osmocom.org/2963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:44:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 10:44:13 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Fix warning: use updated ortp API In-Reply-To: References: Message-ID: Patch Set 1: Indeed, I was wrong when looking at which ortp release contained the commit fixing the headers. It seems the commit was pushed between 0.22 and 0.24, and thus is available in ortp 0.24, not in 0.22. Debian still used 0.22, but my distro uses 1.0.1, so we have 2 possibilities: 1- Add some compile test in configure and then use a define to cast the parameter one or other way. 2- Disable -Werror or the specific Warning during the call to that function and then re-enable it just afterwards. -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jun 22 10:49:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:49:19 +0000 Subject: osmo-ci[master]: lc15: correct default master branch In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/2971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e86edc34fdb8c7bc57f87c41e05dd2338dd2506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:49:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:49:23 +0000 Subject: [MERGED] osmo-ci[master]: lc15: correct default master branch In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: lc15: correct default master branch ...................................................................... lc15: correct default master branch Change-Id: I6e86edc34fdb8c7bc57f87c41e05dd2338dd2506 Related: SYS#3683 --- M scripts/osmo-layer1-headers.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh index b2372d4..374515e 100755 --- a/scripts/osmo-layer1-headers.sh +++ b/scripts/osmo-layer1-headers.sh @@ -20,7 +20,7 @@ ;; lc15) uri="https://gitlab.com/nrw_litecell15/litecell15-fw" - version="nrw/litecell15-next" + version="origin/nrw/litecell15" ;; *) echo "Unknown BTS model '$1'" -- To view, visit https://gerrit.osmocom.org/2971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e86edc34fdb8c7bc57f87c41e05dd2338dd2506 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:50:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:50:01 +0000 Subject: [MERGED] osmo-bts[master]: Copy sysmobts.service to osmo-bts-sysmo In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Copy sysmobts.service to osmo-bts-sysmo ...................................................................... Copy sysmobts.service to osmo-bts-sysmo This way the name of systemd service file will match the name of the binary similar to lc15. Add aliases so the user can use both old and new names regardless of which file is installed. Once the corresponding changes to OE recipes are applied old file can be removed. Based on work by Pau Espin Pedrol Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 --- M Makefile.am A contrib/osmo-bts-sysmo.service M contrib/sysmobts.service M src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c M src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c 5 files changed, 28 insertions(+), 7 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Neels Hofmeyr: I would prefer this is not merged as is diff --git a/Makefile.am b/Makefile.am index 9a5e26f..5598c4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ # package the contrib and doc EXTRA_DIST = \ - contrib/dump_docs.py contrib/screenrc-l1fwd contrib/sysmobts.service \ + contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \ contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \ contrib/sysmobts.init contrib/sysmobts-calib/Makefile \ contrib/sysmobts-calib/sysmobts-calib.c \ diff --git a/contrib/osmo-bts-sysmo.service b/contrib/osmo-bts-sysmo.service new file mode 100644 index 0000000..bbb2bef --- /dev/null +++ b/contrib/osmo-bts-sysmo.service @@ -0,0 +1,20 @@ +[Unit] +Description=sysmocom sysmoBTS + +[Service] +Type=simple +ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' +ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M +ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' +ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s' +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +# The msg queues must be read fast enough +CPUSchedulingPolicy=rr +CPUSchedulingPriority=1 + +[Install] +WantedBy=multi-user.target +Alias=sysmobts.service diff --git a/contrib/sysmobts.service b/contrib/sysmobts.service index e07a3db..64e0127 100644 --- a/contrib/sysmobts.service +++ b/contrib/sysmobts.service @@ -17,3 +17,4 @@ [Install] WantedBy=multi-user.target +Alias=osmo-bts-sysmo.service diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c index f01fd14..1be56ac 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c @@ -116,7 +116,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl start sysmobts.service"); + system("/bin/systemctl start osmo-bts-sysmo"); } } @@ -157,7 +157,7 @@ * and used SIGCHLD/waitpid to pick up the dead processes * without invoking shell. */ - system("/bin/systemctl stop sysmobts.service"); + system("/bin/systemctl stop osmo-bts-sysmo"); } } diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c index 3020d90..b49f282 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_vty.c @@ -284,7 +284,7 @@ DEFUN(cfg_action_bts_srv_on, cfg_action_bts_srv_on_cmd, "bts-service-on", - "Start the systemd sysmobts.service\n") + "Start the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action |= TEMP_ACT_NORM_BTS_SRV_ON; @@ -293,7 +293,7 @@ DEFUN(cfg_no_action_bts_srv_on, cfg_no_action_bts_srv_on_cmd, "no bts-service-on", - NO_STR "Start the systemd sysmobts.service\n") + NO_STR "Start the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action &= ~TEMP_ACT_NORM_BTS_SRV_ON; @@ -338,7 +338,7 @@ DEFUN(cfg_action_bts_srv_off, cfg_action_bts_srv_off_cmd, "bts-service-off", - "Stop the systemd sysmobts.service\n") + "Stop the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action |= TEMP_ACT_BTS_SRV_OFF; @@ -347,7 +347,7 @@ DEFUN(cfg_no_action_bts_srv_off, cfg_no_action_bts_srv_off_cmd, "no bts-service-off", - NO_STR "Stop the systemd sysmobts.service\n") + NO_STR "Stop the systemd osmo-bts-sysmo.service\n") { int *action = vty->index; *action &= ~TEMP_ACT_BTS_SRV_OFF; -- To view, visit https://gerrit.osmocom.org/2916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5 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 Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:50:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:50:31 +0000 Subject: [MERGED] openbsc[master]: Fix BTS features length check In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix BTS features length check ...................................................................... Fix BTS features length check While fixing potentially incorrect memory access, the check for maximum number of supported BTS features was incorrectly adjusted instead of feature vectore length check next to it. Fix this by adjusting checks properly and adding comments to avoid future confusion. The error was introduced in a60bb3dd28ce9e3720f8ee1b262893f3e233e2e6. Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 1715688..019d039 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -484,13 +484,13 @@ if (TLVP_PRES_LEN(&tp, NM_ATT_MANUF_ID, 2)) { m_id_len = TLVP_LEN(&tp, NM_ATT_MANUF_ID); - if (m_id_len > MAX_BTS_FEATURES/8 + 1) { + /* log potential BTS feature vector overflow */ + if (m_id_len > sizeof(bts->_features_data)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n", bts->nr, MAX_BTS_FEATURES/8); - m_id_len = MAX_BTS_FEATURES/8; - } - if (m_id_len > sizeof(bts->_features_data)) + /* check that max. expected BTS attribute is above given feature vector length */ + if (m_id_len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT)) LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) " "feature vector - most likely it was compiled against newer BSC headers. " "Consider upgrading your BSC to later version.\n", -- To view, visit https://gerrit.osmocom.org/2900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06d2498d730624d5da535f6add6fa98d004714ae Gerrit-PatchSet: 3 Gerrit-Project: openbsc 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 Jun 22 10:51:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:51:13 +0000 Subject: [MERGED] osmo-bts[master]: OML: move BTS number check into separate function In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: OML: move BTS number check into separate function ...................................................................... OML: move BTS number check into separate function * move code which checks for BTS number (obtained via OML) validity into separate function * adjust log messages to match the check * add spec reference and comments Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230 Related: OS#2317 --- M src/common/oml.c 1 file changed, 34 insertions(+), 16 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 fe35e85..8f23f82 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1041,6 +1041,38 @@ return bts_model_chg_adm_state(bts, mo, obj, adm_state); } +/* Check and report if the BTS number received via OML is incorrect: + according to 3GPP TS 52.021 ?9.3 BTS number is used to distinguish between different BTS of the same Site Manager. + As we always have only single BTS per Site Manager (in case of Abis/IP with each BTS having dedicated OML connection + to BSC), the only valid values are 0 and 0xFF (means all BTS' of a given Site Manager). */ +static inline bool report_bts_number_incorrect(struct gsm_bts *bts, const struct abis_om_fom_hdr *foh, bool is_formatted) +{ + struct gsm_bts_trx *trx; + struct gsm_abis_mo *mo = &bts->mo; + const char *form = is_formatted ? + "Unexpected BTS %d in formatted O&M %s (exp. 0 or 0xFF)" : + "Unexpected BTS %d in manufacturer O&M %s (exp. 0 or 0xFF)"; + + if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { + LOGP(DOML, LOGL_ERROR, form, foh->obj_inst.bts_nr, get_value_string(abis_nm_msgtype_names, + foh->msg_type)); + LOGPC(DOML, LOGL_ERROR, "\n"); + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + mo = &trx->mo; + } + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UKWN_MSG, form, foh->obj_inst.bts_nr, + get_value_string(abis_nm_msgtype_names, foh->msg_type)); + + return true; + } + + return false; +} + static int down_fom(struct gsm_bts *bts, struct msgb *msg) { struct abis_om_fom_hdr *foh = msgb_l3(msg); @@ -1060,20 +1092,8 @@ return -EIO; } - if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); - trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); - if (trx) { - trx->mo.obj_inst.bts_nr = 0; - trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; - trx->mo.obj_inst.ts_nr = 0xff; - oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, - "Formatted O&M with BTS %d out" - " of range (0:0xFF)", - foh->obj_inst.bts_nr); - } + if (report_bts_number_incorrect(bts, foh, true)) return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); - } switch (foh->msg_type) { case NM_MT_SET_BTS_ATTR: @@ -1363,10 +1383,8 @@ msg->l3h = oh->data + 1 + idstrlen; foh = (struct abis_om_fom_hdr *) msg->l3h; - if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Manufacturer O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + if (report_bts_number_incorrect(bts, foh, false)) return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); - } ret = oml_tlv_parse(&tp, foh->data, oh->length - sizeof(*foh)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/2866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230 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 Thu Jun 22 10:51:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:51:46 +0000 Subject: [MERGED] openbsc[master]: Enable optional static builds In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Enable optional static builds ...................................................................... Enable optional static builds * use LT_INIT instead of AC_PROG_RANLIB * remove redundant libbsc entries The default (for both manual and .deb builds) is to use shared build (as before) - the static build is entirely optional. Based on work by Sergey Kostanbaev and Alexander Chemeris . Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a --- M openbsc/configure.ac M openbsc/src/osmo-bsc/Makefile.am M openbsc/tests/abis/Makefile.am 3 files changed, 1 insertion(+), 3 deletions(-) Approvals: Alexander Chemeris: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/configure.ac b/openbsc/configure.ac index c6ae159..ff51ccf 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -16,7 +16,7 @@ AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_INSTALL -AC_PROG_RANLIB +LT_INIT dnl check for pkg-config (explained in detail in libosmocore/configure.ac) AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index 6f836b0..ae9410c 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -43,7 +43,6 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOSCCP_LIBS) \ diff --git a/openbsc/tests/abis/Makefile.am b/openbsc/tests/abis/Makefile.am index cbc3e07..1c5dede 100644 --- a/openbsc/tests/abis/Makefile.am +++ b/openbsc/tests/abis/Makefile.am @@ -27,7 +27,6 @@ abis_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOABIS_LIBS) \ -- To view, visit https://gerrit.osmocom.org/2748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 10:53:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 10:53:55 +0000 Subject: [ABANDON] osmo-bts[master]: lc15: use directory instead of symlink In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: lc15: use directory instead of symlink ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6208a1f7d62cac7ef64459e62f8e6083b0025580 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-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Thu Jun 22 11:09:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 11:09:13 +0000 Subject: [PATCH] osmo-bts[master]: Add missing header file Message-ID: Review at https://gerrit.osmocom.org/3003 Add missing header file This fixes compilation warning: implicit declaration of function ?abis_bts_rsl_sendmsg? Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/03/3003/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b9104b7..3e0a6cc 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 11:12:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 11:12:00 +0000 Subject: osmo-bts[master]: Add missing header file In-Reply-To: References: Message-ID: Patch Set 1: The main purpose of this tiny fix is to serve as a test for jenkins changes for lc15 builds. Feel free to +2 if it's ok it but please don't merge - I'll do it once lc15 jenkins tests are finished. -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 11:23:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 11:23:44 +0000 Subject: [PATCH] osmo-bts[master]: lc15: make jenkins helper executable Message-ID: Review at https://gerrit.osmocom.org/3004 lc15: make jenkins helper executable Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8 Related: SYS#3682 --- M contrib/jenkins_lc15.sh 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/3004/1 diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh old mode 100644 new mode 100755 -- To view, visit https://gerrit.osmocom.org/3004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 11:26:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 11:26:15 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp.c: Fix warning: check ortp API in rtp_session_sign... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2990 to look at the new patch set (#2). osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connect Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding ortp 0.24, the API is fixed and requests a pointer instead of an unsigned long. As we now require at least ortp 0.22 since libosmo-abis 15d9b7929d449e4138bcb003c614035bceadc3d1, we need to support both old and new version of the API to continue having support for 0.22 but still supporting new versions of the library. Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb --- M configure.ac M src/trau/osmo_ortp.c 2 files changed, 41 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/90/2990/2 diff --git a/configure.ac b/configure.ac index 9b2f189..ea61abf 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,20 @@ [ortp_set_log_level_mask has no domain parameter])]) CFLAGS=$_cflags_save +_cflags_save=$CFLAGS +CFLAGS="$CFLAGS $ORTP_CFLAGS" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] + )], + [AC_DEFINE([HAVE_SIGNAL_CONNECT_PTR_TYPE], [1], + [rtp_session_signal_connect requires pointer parameter])], + [AC_DEFINE([HAVE_SIGNAL_CONNECT_PTR_TYPE], [0], + [rtp_session_signal_connect requires ulong parameter])]) +CFLAGS=$_cflags_save + + AC_OUTPUT( libosmoabis.pc libosmotrau.pc diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c4e9d53..eed70d9 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -350,16 +350,39 @@ rtp_session_signal_connect(rs->sess, "ssrc_changed", (RtpCallback) ortp_sig_cb_ssrc, - (unsigned long) rs); + #if HAVE_SIGNAL_CONNECT_PTR_TYPE + (void*) + #else + (unsigned long) + #endif + rs); + rtp_session_signal_connect(rs->sess, "payload_type_changed", (RtpCallback) ortp_sig_cb_pt, - (unsigned long) rs); + #if HAVE_SIGNAL_CONNECT_PTR_TYPE + (void*) + #else + (unsigned long) + #endif + rs); + rtp_session_signal_connect(rs->sess, "network_error", (RtpCallback) ortp_sig_cb_net, - (unsigned long) rs); + #if HAVE_SIGNAL_CONNECT_PTR_TYPE + (void*) + #else + (unsigned long) + #endif + rs); + rtp_session_signal_connect(rs->sess, "timestamp_jump", (RtpCallback) ortp_sig_cb_ts, - (unsigned long) rs); + #if HAVE_SIGNAL_CONNECT_PTR_TYPE + (void*) + #else + (unsigned long) + #endif + rs); /* initialize according to the RFC */ rtp_session_set_seq_number(rs->sess, random()); -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis 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 Thu Jun 22 11:29:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 11:29:24 +0000 Subject: [PATCH] osmo-pcu[master]: tests: remove unused definition Message-ID: Review at https://gerrit.osmocom.org/3005 tests: remove unused definition Fix compilation warning. Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa --- M tests/emu/openbsc_clone.c 1 file changed, 0 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3005/1 diff --git a/tests/emu/openbsc_clone.c b/tests/emu/openbsc_clone.c index 575f4e1..424dff5 100644 --- a/tests/emu/openbsc_clone.c +++ b/tests/emu/openbsc_clone.c @@ -41,22 +41,6 @@ #define N202 4 #define CRC24_LENGTH 3 -static const struct value_string llc_cmd_strs[] = { - { GPRS_LLC_NULL, "NULL" }, - { GPRS_LLC_RR, "RR" }, - { GPRS_LLC_ACK, "ACK" }, - { GPRS_LLC_RNR, "RNR" }, - { GPRS_LLC_SACK, "SACK" }, - { GPRS_LLC_DM, "DM" }, - { GPRS_LLC_DISC, "DISC" }, - { GPRS_LLC_UA, "UA" }, - { GPRS_LLC_SABM, "SABM" }, - { GPRS_LLC_FRMR, "FRMR" }, - { GPRS_LLC_XID, "XID" }, - { GPRS_LLC_UI, "UI" }, - { 0, NULL } -}; - int gprs_llc_hdr_parse(struct gprs_llc_hdr_parsed *ghp, const uint8_t *llc_hdr, int len) { -- To view, visit https://gerrit.osmocom.org/3005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 11:30:50 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 11:30:50 +0000 Subject: osmo-bts[master]: Add missing header file In-Reply-To: References: Message-ID: Patch Set 1: The main purpose of this tiny fix is to serve as a test for jenkins changes for lc15 builds. Feel free to +2 if it's ok it but please don't merge - I'll do it once lc15 jenkins tests are finished. -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 16:25:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 16:25:12 +0000 Subject: [PATCH] osmo-pcu[master]: lc15: use environment for firmware version Message-ID: Review at https://gerrit.osmocom.org/3006 lc15: use environment for firmware version This allows to specify firmware version to use by jenkins builder via environment variable. If environment variable does not exist than default master branch is used. Change-Id: If8b249aa00270e60a0449f089a16823976e54d54 Related: SYS#3683 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3006/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 9c5c2e2..5222476 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -32,7 +32,7 @@ elif [ "$with_dsp" = lc15 ]; then PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc" cd "$deps" - osmo-layer1-headers.sh lc15 + osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then -- To view, visit https://gerrit.osmocom.org/3006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8b249aa00270e60a0449f089a16823976e54d54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 16:59:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 16:59:42 +0000 Subject: osmo-pcu[master]: lc15: use environment for firmware version In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8b249aa00270e60a0449f089a16823976e54d54 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 Thu Jun 22 17:00:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:00:09 +0000 Subject: osmo-pcu[master]: tests: remove unused definition In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa 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 Thu Jun 22 17:00:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:00:14 +0000 Subject: [MERGED] osmo-pcu[master]: tests: remove unused definition In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: remove unused definition ...................................................................... tests: remove unused definition Fix compilation warning. Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa --- M tests/emu/openbsc_clone.c 1 file changed, 0 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/emu/openbsc_clone.c b/tests/emu/openbsc_clone.c index 575f4e1..424dff5 100644 --- a/tests/emu/openbsc_clone.c +++ b/tests/emu/openbsc_clone.c @@ -41,22 +41,6 @@ #define N202 4 #define CRC24_LENGTH 3 -static const struct value_string llc_cmd_strs[] = { - { GPRS_LLC_NULL, "NULL" }, - { GPRS_LLC_RR, "RR" }, - { GPRS_LLC_ACK, "ACK" }, - { GPRS_LLC_RNR, "RNR" }, - { GPRS_LLC_SACK, "SACK" }, - { GPRS_LLC_DM, "DM" }, - { GPRS_LLC_DISC, "DISC" }, - { GPRS_LLC_UA, "UA" }, - { GPRS_LLC_SABM, "SABM" }, - { GPRS_LLC_FRMR, "FRMR" }, - { GPRS_LLC_XID, "XID" }, - { GPRS_LLC_UI, "UI" }, - { 0, NULL } -}; - int gprs_llc_hdr_parse(struct gprs_llc_hdr_parsed *ghp, const uint8_t *llc_hdr, int len) { -- To view, visit https://gerrit.osmocom.org/3005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa Gerrit-PatchSet: 1 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 Thu Jun 22 17:00:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:00:44 +0000 Subject: osmo-bts[master]: Add missing header file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 you're not adding a header file, but an #include to a header file. please clarify. -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 Gerrit-PatchSet: 1 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 Thu Jun 22 17:00:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 17:00:47 +0000 Subject: [MERGED] osmo-pcu[master]: lc15: use environment for firmware version In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: lc15: use environment for firmware version ...................................................................... lc15: use environment for firmware version This allows to specify firmware version to use by jenkins builder via environment variable. If environment variable does not exist than default master branch is used. Change-Id: If8b249aa00270e60a0449f089a16823976e54d54 Related: SYS#3683 --- 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 9c5c2e2..5222476 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -32,7 +32,7 @@ elif [ "$with_dsp" = lc15 ]; then PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc" cd "$deps" - osmo-layer1-headers.sh lc15 + osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then -- To view, visit https://gerrit.osmocom.org/3006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8b249aa00270e60a0449f089a16823976e54d54 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 Thu Jun 22 17:02:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 17:02:34 +0000 Subject: [PATCH] osmo-bts[master]: Add missing include for abis.h header file 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/3003 to look at the new patch set (#2). Add missing include for abis.h header file This fixes compilation warning: implicit declaration of function ?abis_bts_rsl_sendmsg? Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/03/3003/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b9104b7..3e0a6cc 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 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 Thu Jun 22 17:03:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:03:02 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Fix warning: check ortp API in rtp_session_sign... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2990/2/src/trau/osmo_ortp.c File src/trau/osmo_ortp.c: Line 353: #if HAVE_SIGNAL_CONNECT_PTR_TYPE why not simply hide this in a #define macro to avoid spreasding four copies of this around? Something like RTP_SIGNAL_PTR_CAST which then expands? -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis 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 Thu Jun 22 17:03:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:03:10 +0000 Subject: libosmo-abis[master]: configure.ac: Use -Werror in C(PP)FLAGS In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic674bf28d781b9806dc023777e1fea4ee1a0257a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis 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 Thu Jun 22 17:03:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:03:59 +0000 Subject: osmo-bts[master]: lc15: make jenkins helper executable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8 Gerrit-PatchSet: 1 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 Thu Jun 22 17:04:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:04:01 +0000 Subject: [MERGED] osmo-bts[master]: lc15: make jenkins helper executable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: make jenkins helper executable ...................................................................... lc15: make jenkins helper executable Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8 Related: SYS#3682 --- M contrib/jenkins_lc15.sh 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh old mode 100644 new mode 100755 -- To view, visit https://gerrit.osmocom.org/3004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Thu Jun 22 17:04:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:04:30 +0000 Subject: libosmocore[master]: Fix warnings: tolower() and similar require uchar In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Jun 22 17:05:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:05:09 +0000 Subject: libosmocore[master]: pseudotalloc: Add simplistic implementation of talloc_asprintf In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/2961/2/src/pseudotalloc/pseudotalloc.c File src/pseudotalloc/pseudotalloc.c: Line 66: char *talloc_asprintf(const void *ctx, const char *fmt, ...) { coding style -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 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-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 22 17:05:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:05:54 +0000 Subject: [MERGED] libosmocore[master]: abis_test.c: Fix warning appearing on some buggy gcc versions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abis_test.c: Fix warning appearing on some buggy gcc versions ...................................................................... abis_test.c: Fix warning appearing on some buggy gcc versions Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 --- M tests/abis/abis_test.c 1 file changed, 4 insertions(+), 2 deletions(-) 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/tests/abis/abis_test.c b/tests/abis/abis_test.c index a303c91..cb88b01 100644 --- a/tests/abis/abis_test.c +++ b/tests/abis/abis_test.c @@ -122,7 +122,8 @@ static inline void chk_raw(const char *what, const uint8_t *data, uint16_t len) { - struct abis_nm_sw_desc sw = { 0 }; + /* = { 0 } triggers a warning in some gcc versions due to a bug: gcc issue #53119 */ + struct abis_nm_sw_desc sw = { {0} }; int res = abis_nm_get_sw_conf(data, len, &sw, 1); uint16_t xlen = abis_nm_get_sw_desc_len(data, len); @@ -144,7 +145,8 @@ { int res; uint16_t len; - struct abis_nm_sw_desc sw = { 0 }, put = { + /* = { 0 } triggers a warning in some gcc versions due to a bug: gcc issue #53119 */ + struct abis_nm_sw_desc sw = { {0} }, put = { .file_id_len = strlen(f_id), .file_version_len = strlen(f_ver), }; -- To view, visit https://gerrit.osmocom.org/2955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jun 22 17:06:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:06:17 +0000 Subject: libosmocore[master]: gsm0808: add function gsm0808_speech_codec_from_chan_type() In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 9 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 Thu Jun 22 17:07:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:07:42 +0000 Subject: libosmocore[master]: gsm0808: add function gsm0808_chan_type_to_speech_code() In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 9 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 Thu Jun 22 17:08:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:12 +0000 Subject: libosmocore[master]: cosmetic: remove API documentation strings in header file In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 6 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 Thu Jun 22 17:08:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:17 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: remove API documentation strings in header file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: remove API documentation strings in header file ...................................................................... cosmetic: remove API documentation strings in header file Typically we don't place comments with the function declarations in .h files. Not sure why this file has comments for each. The API doc belongs in the .c file as proper doxygen comments, and shouldn't be duplicated in the .h file. In this particular case, doxygen comments are added in the corresponding c file recently. Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad --- M include/osmocom/gsm/gsm0808_utils.h 1 file changed, 0 insertions(+), 24 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index cb53e0c..0937630 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -23,55 +23,31 @@ #include -/* Encode AoIP transport address element */ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss); - -/* Decode AoIP transport address element */ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec element */ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc); - -/* Decode Speech Codec element */ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len); - -/* Encode Speech Codec list */ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl); - -/* Decode Speech Codec list */ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len); - -/* Encode Channel Type element */ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct); - -/* Decode Channel Type element */ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len); - -/* Encode Encryption Information element */ uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei); - -/* Decode Encryption Information element */ int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len); - -/* Encode Cell Identifier List element */ uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil); - -/* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); - int gsm0808_chan_type_to_speech_code(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -- To view, visit https://gerrit.osmocom.org/2936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Jun 22 17:08:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:17 +0000 Subject: [MERGED] libosmocore[master]: gsm0808: add function gsm0808_chan_type_to_speech_code() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0808: add function gsm0808_chan_type_to_speech_code() ...................................................................... gsm0808: add function gsm0808_chan_type_to_speech_code() The permitted speech field used in channel type element (struct gsm0808_channel_type) uses a different representation as the type field in the speech codec element (struct gsm0808_speech_codec) This patch adds a function to convert from permitted speech to speech codec type. Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 40 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index c11bf8d..b510644 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -71,3 +71,5 @@ /* Decode Cell Identifier List element */ int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); + +int gsm0808_chan_type_to_speech_code(uint8_t perm_spch); diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 60fb91c..64ffec4 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -645,4 +645,41 @@ return (int)(elem - old_elem); } +/*! \brief Convert the representation of the permitted speech codec identifier + * that is used in struct gsm0808_channel_type to the speech codec + * representation we use in struct gsm0808_speech_codec. + * \param[in] perm_spch to be converted (see also gsm0808_permitted_speech) + * \returns GSM speech codec type; negative on error */ +int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch) +{ + /*! The speech codec type, which is used in the channel type field to + * signal the permitted speech versions (codecs) has a different + * encoding than the type field in the speech codec type element + * (See also 3GPP TS 48.008, 3.2.2.11 and 3.2.2.103) */ + + switch (perm_spch) { + case GSM0808_PERM_FR1: + return GSM0808_SCT_FR1; + case GSM0808_PERM_FR2: + return GSM0808_SCT_FR2; + case GSM0808_PERM_FR3: + return GSM0808_SCT_FR3; + case GSM0808_PERM_FR4: + return GSM0808_SCT_FR4; + case GSM0808_PERM_FR5: + return GSM0808_SCT_FR5; + case GSM0808_PERM_HR1: + return GSM0808_SCT_HR1; + case GSM0808_PERM_HR3: + return GSM0808_SCT_HR3; + case GSM0808_PERM_HR4: + return GSM0808_SCT_HR4; + case GSM0808_PERM_HR6: + return GSM0808_SCT_HR6; + } + + /* Invalid input */ + return -EINVAL; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9613c4e..ccc5b9a 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,6 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; +gsm0808_convert_to_speech_codec_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb Gerrit-PatchSet: 10 Gerrit-Project: libosmocore 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 Jun 22 17:08:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:18 +0000 Subject: [MERGED] libosmocore[master]: gsm0808: add function gsm0808_speech_codec_from_chan_type() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0808: add function gsm0808_speech_codec_from_chan_type() ...................................................................... gsm0808: add function gsm0808_speech_codec_from_chan_type() The contents of the speech codec element (struct gsm0808_speech_codec), that is also used in the speech codec list element (struct gsm0808_speech_codec_list) can be generated directly from the permitted speech parameter in the channel type field (struct gsm0808_channel_type) when full AoIP with compressed speech via RTP/UDP/IP is assumed and when the codec configuration on the air interface exactly matches the codec configuration on the IP backhaul. This patch adds a function that can be used as a helper to fill out spech codec fields by only giving a permitted speech parameter as input. Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c M src/gsm/libosmogsm.map 3 files changed, 57 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index b510644..cb53e0c 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -73,3 +73,5 @@ const uint8_t *elem, uint8_t len); int gsm0808_chan_type_to_speech_code(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_utils.c b/src/gsm/gsm0808_utils.c index 64ffec4..00da04b 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -682,4 +682,58 @@ return -EINVAL; } +/*! \brief Extrapolate a speech codec field from a given permitted speech + * parameter (channel type). + * \param[out] sc Caller provided memory to store the resulting speech codec + * \param[in] perm_spch value that is used to derive the speech codec info + * (see also: enum gsm0808_speech_codec_type in gsm0808_utils.h) + * \returns zero when successful; negative on error */ +int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, + uint8_t perm_spch) +{ + int rc; + + memset(sc, 0, sizeof(*sc)); + + /* Determine codec type */ + rc = gsm0808_chan_type_to_speech_codec(perm_spch); + if (rc < 0) + return -EINVAL; + sc->type = (uint8_t) rc; + + /* Depending on the speech codec type, pick a default codec + * configuration that exactly matches the configuration on the + * air interface. */ + switch (sc->type) { + case GSM0808_SCT_FR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR; + break; + case GSM0808_SCT_FR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB; + break; + case GSM0808_SCT_FR5: + sc->cfg = GSM0808_SC_CFG_DEFAULT_FR_AMR_WB; + break; + case GSM0808_SCT_HR3: + sc->cfg = GSM0808_SC_CFG_DEFAULT_HR_AMR; + break; + case GSM0808_SCT_HR4: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB; + break; + case GSM0808_SCT_HR6: + sc->cfg = GSM0808_SC_CFG_DEFAULT_OHR_AMR; + break; + default: + /* Note: Not all codec types specify a default setting, + * in this case, we just set the field to zero. */ + sc->cfg = 0; + } + + /* Tag all codecs as "Full IP" + * (see als 3GPP TS 48.008 3.2.2.103) */ + sc->fi = true; + + return 0; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ccc5b9a..36cba39 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,6 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_convert_to_speech_codec_type; +gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/2831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2 Gerrit-PatchSet: 10 Gerrit-Project: libosmocore 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 Jun 22 17:08:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:18 +0000 Subject: [MERGED] libosmocore[master]: gsm0808: add default speech codec configuration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0808: add default speech codec configuration ...................................................................... gsm0808: add default speech codec configuration In an AoIP scenario, the speech codec list field specifies the codecs used in the RTP interface. This patch adds a table with default codec configurations that match the codec configurations that are also used on the air interface. Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 --- M include/osmocom/gsm/protocol/gsm_08_08.h 1 file changed, 21 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 9e00d23..d165330 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -449,6 +449,27 @@ uint16_t cfg; }; +/*! \brief Default speech codec configurations: Some codecs specified with + * struct gsm0808_speech_codec, require a configuration (cfg). The following + * default configuration will configure the codec (RTP) to match the + * configuration that is used on the air interface (Um). + * + * Default values for FR_AMR, HR_AMR and OHR_AMR: + * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred + * Configurations for the Adaptive Multi-Rate Codec Types + * + * Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB: + * See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations + * for the Adaptive Multi-Rate - Wideband Codec Types */ +enum gsm0808_speech_codec_defaults { + GSM0808_SC_CFG_DEFAULT_FR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_HR_AMR = 0x073f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR = 0xffff, + GSM0808_SC_CFG_DEFAULT_FR_AMR_WB = 0x01, + GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB = 0x3f, + GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01, +}; + /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ #define SPEECH_CODEC_MAXLEN 255 struct gsm0808_speech_codec_list { -- To view, visit https://gerrit.osmocom.org/2829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore 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 Jun 22 17:08:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:19 +0000 Subject: [MERGED] libosmocore[master]: gsm0808: fix AoIP speech codec element parser/generator In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0808: fix AoIP speech codec element parser/generator ...................................................................... gsm0808: fix AoIP speech codec element parser/generator The implementation of the parser/generator for the speech codec information element slightly wrong, making it impossible to use it properly. (See also: 3GPP TS 48.008, 3.2.2.103) Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 136 insertions(+), 79 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 7656c38..9e00d23 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -447,8 +447,6 @@ bool tf; uint8_t type; uint16_t cfg; - bool type_extended; - bool cfg_present; }; /* 3GPP TS 48.008 3.2.2.103 Speech Codec List */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index bdd02e5..60fb91c 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -151,6 +151,32 @@ /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; uint8_t *old_tail; + bool type_extended; + + /* Note: Extended codec types are codec types that require 8 instead + * of 4 bit to fully specify the selected codec. In the following, + * we check if we work with an extended type or not. We also check + * if the codec type is valid at all. */ + switch(sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_FR3: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR1: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR4: + case GSM0808_SCT_HR6: + type_extended = false; + break; + case GSM0808_SCT_CSD: + type_extended = true; + break; + default: + /* Invalid codec type specified */ + OSMO_ASSERT(false); + break; + } old_tail = msg->tail; @@ -162,20 +188,37 @@ header |= (1 << 5); if (sc->tf) header |= (1 << 4); - if (sc->type_extended) { + + if (type_extended) { header |= 0x0f; msgb_put_u8(msg, header); + msgb_put_u8(msg, sc->type); } else { OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); - return (uint8_t) (msg->tail - old_tail); } - msgb_put_u8(msg, sc->type); - - if (sc->cfg_present) + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one + * or two octets, depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: msgb_put_u16(msg, sc->cfg); + break; + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + OSMO_ASSERT((sc->cfg & 0xff00) == 0) + msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); + break; + default: + OSMO_ASSERT(sc->cfg == 0); + break; + } return (uint8_t) (msg->tail - old_tail); } @@ -244,21 +287,42 @@ if ((header & 0x0F) != 0x0F) { sc->type = (header & 0x0F); - return (int)(elem - old_elem); + } else { + sc->type = *elem; + elem++; + len--; } - sc->type = *elem; - elem++; - len--; - - sc->type_extended = true; - - if (len < 2) - return (int)(elem - old_elem); - - sc->cfg = osmo_load16be(elem); - elem += 2; - sc->cfg_present = true; + /* Note: Whether a configuration is present or not depends on the + * selected codec type. If present, it can either consist of one or + * two octets depending on the codec type */ + switch (sc->type) { + case GSM0808_SCT_FR1: + case GSM0808_SCT_FR2: + case GSM0808_SCT_HR1: + break; + case GSM0808_SCT_HR4: + case GSM0808_SCT_CSD: + case GSM0808_SCT_FR4: + case GSM0808_SCT_FR5: + if (len < 1) + return -EINVAL; + sc->cfg = *elem; + elem++; + break; + case GSM0808_SCT_FR3: + case GSM0808_SCT_HR3: + case GSM0808_SCT_HR6: + if (len < 2) + return -EINVAL; + sc->cfg = osmo_load16be(elem); + elem += 2; + break; + default: + /* Invalid codec type => malformed speech codec element! */ + return -EINVAL; + break; + } return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 8304052..68771a4 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -49,19 +49,17 @@ scl->codec[0].pi = true; scl->codec[0].tf = true; - scl->codec[0].type = 0xab; - scl->codec[0].type_extended = true; - scl->codec[0].cfg_present = true; + scl->codec[0].type = GSM0808_SCT_FR3; scl->codec[0].cfg = 0xcdef; scl->codec[1].fi = true; scl->codec[1].pt = true; - scl->codec[1].type = 0x05; + scl->codec[1].type = GSM0808_SCT_FR2; scl->codec[2].fi = true; scl->codec[2].tf = true; - scl->codec[2].type = 0xf2; - scl->codec[2].type_extended = true; + scl->codec[2].type = GSM0808_SCT_CSD; + scl->codec[2].cfg = 0xc0; scl->len = 3; } @@ -89,8 +87,9 @@ static const uint8_t res[] = { 0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62, 0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, - 0xa5, 0x9f, 0xf2 + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, + 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg, *in_msg; @@ -282,9 +281,10 @@ static const uint8_t res2[] = { 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00, 0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, - 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, - 0xef, 0xa5, 0x9f, 0xf2, GSM0808_IE_CALL_ID, 0xaa, 0xbb, 0xcc, - 0xdd }; + 0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07, + GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, + GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb, + 0xcc, 0xdd }; struct msgb *msg; struct gsm0808_channel_type ct; @@ -351,9 +351,9 @@ static const uint8_t res[] = { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04, - 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, 0x9a, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, - 0x9f, 0xf2 }; + 0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90, + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; struct msgb *msg; memset(&sin, 0, sizeof(sin)); @@ -367,7 +367,7 @@ memset(&sc, 0, sizeof(sc)); sc.fi = true; sc.tf = true; - sc.type = 0x0a; + sc.type = GSM0808_SCT_HR1; setup_codec_list(&sc_list); @@ -400,11 +400,12 @@ { static const uint8_t res1[] = { 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST, - 0x07, 0x5f, 0xab, 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, + 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; static const uint8_t res2[] = { 0x00, 0x0f, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02, - GSM0808_IE_SPEECH_CODEC_LIST, 0x07, 0x5f, 0xab, - 0xcd, 0xef, 0xa5, 0x9f, 0xf2 }; + GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, + 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 }; uint8_t rr_res = 2; struct msgb *msg; struct gsm0808_speech_codec_list sc_list; @@ -574,7 +575,7 @@ memset(&enc_sc, 0, sizeof(enc_sc)); enc_sc.fi = true; enc_sc.pt = true; - enc_sc.type = 0x05; + enc_sc.type = GSM0808_SCT_FR2; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); @@ -589,6 +590,31 @@ } +static void test_gsm0808_enc_dec_speech_codec_with_cfg() +{ + struct gsm0808_speech_codec enc_sc; + struct gsm0808_speech_codec dec_sc; + struct msgb *msg; + uint8_t rc_enc; + int rc_dec; + + enc_sc.pi = true; + enc_sc.tf = true; + enc_sc.type = GSM0808_SCT_FR3; + enc_sc.cfg = 0xabcd; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); + OSMO_ASSERT(rc_enc == 5); + + rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + + OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_speech_codec_ext_with_cfg() { struct gsm0808_speech_codec enc_sc; @@ -599,44 +625,15 @@ enc_sc.pi = true; enc_sc.tf = true; - enc_sc.type = 0xab; - enc_sc.type_extended = true; - enc_sc.cfg_present = true; - enc_sc.cfg = 0xcdef; + enc_sc.type = GSM0808_SCT_CSD; + enc_sc.cfg = 0xc0; msg = msgb_alloc(1024, "output buffer"); rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 6); + OSMO_ASSERT(rc_enc == 5); rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 4); - - OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); - - msgb_free(msg); -} - -static void test_gsm0808_enc_dec_speech_codec_ext() -{ - struct gsm0808_speech_codec enc_sc; - struct gsm0808_speech_codec dec_sc; - struct msgb *msg; - uint8_t rc_enc; - int rc_dec; - - enc_sc.fi = true; - enc_sc.tf = true; - enc_sc.type = 0xf2; - enc_sc.type_extended = true; - enc_sc.cfg_present = false; - enc_sc.cfg = 0x0000; - - msg = msgb_alloc(1024, "output buffer"); - rc_enc = gsm0808_enc_speech_codec(msg, &enc_sc); - OSMO_ASSERT(rc_enc == 4); - - rc_dec = gsm0808_dec_speech_codec(&dec_sc, msg->data + 2, msg->len - 2); - OSMO_ASSERT(rc_dec == 2); + OSMO_ASSERT(rc_dec == 3); OSMO_ASSERT(memcmp(&enc_sc, &dec_sc, sizeof(enc_sc)) == 0); @@ -655,19 +652,17 @@ enc_scl.codec[0].pi = true; enc_scl.codec[0].tf = true; - enc_scl.codec[0].type = 0xab; - enc_scl.codec[0].type_extended = true; - enc_scl.codec[0].cfg_present = true; + enc_scl.codec[0].type = GSM0808_SCT_FR3; enc_scl.codec[0].cfg = 0xcdef; enc_scl.codec[1].fi = true; enc_scl.codec[1].pt = true; - enc_scl.codec[1].type = 0x05; + enc_scl.codec[1].type = GSM0808_SCT_FR2; enc_scl.codec[2].fi = true; enc_scl.codec[2].tf = true; - enc_scl.codec[2].type = 0xf2; - enc_scl.codec[2].type_extended = true; + enc_scl.codec[2].type = GSM0808_SCT_CSD; + enc_scl.codec[2].cfg = 0xc0; enc_scl.len = 3; @@ -860,8 +855,8 @@ test_enc_dec_aoip_trasp_addr_v4(); test_enc_dec_aoip_trasp_addr_v6(); test_gsm0808_enc_dec_speech_codec(); - test_gsm0808_enc_dec_speech_codec_ext(); test_gsm0808_enc_dec_speech_codec_ext_with_cfg(); + test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_channel_type(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/2820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore 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 Jun 22 17:08:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 17:08:47 +0000 Subject: osmo-bts[master]: Add missing include for abis.h header file In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 17:20:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 17:20:10 +0000 Subject: [PATCH] libosmocore[master]: pseudotalloc: Add simplistic implementation of talloc_asprintf 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/2961 to look at the new patch set (#3). pseudotalloc: Add simplistic implementation of talloc_asprintf fsm.c uses this function. When compiled with --enable-embedded, it triggers a warning: fsm.c: In function 'osmo_fsm_inst_alloc': fsm.c:213:4: warning: implicit declaration of function 'talloc_asprintf' [-Wimplicit-function-declaration] fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id); Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 --- M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h 2 files changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/2961/3 diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index fe7f1ed..bc7a491 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -5,6 +5,7 @@ #include "talloc.h" #include +#include void *_talloc_zero(const void *ctx, size_t size, const char *name) { @@ -61,3 +62,18 @@ { return talloc_zero_size(ctx, el_size * count); } + +char *talloc_asprintf(const void *ctx, const char *fmt, ...) +{ + char *buf; + size_t len = 128; + va_list args; + va_start(args, fmt); + + buf = talloc_size(ctx, len); + if (len < vsnprintf(buf, len, fmt, args)) + strcpy(&buf[len-6], "[...]"); + + va_end(args); + return buf; +} diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index c7127de..f4c0a74 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -39,4 +39,4 @@ size_t el_size, unsigned count, const char *name); - +char *talloc_asprintf(const void *ctx, const char *fmt, ...); -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 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 From gerrit-no-reply at lists.osmocom.org Thu Jun 22 17:28:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 22 Jun 2017 17:28:17 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp.c: Fix warning: check ortp API in rtp_session_sign... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2990 to look at the new patch set (#3). osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connect Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding ortp 0.24, the API is fixed and requests a pointer instead of an unsigned long. As we now require at least ortp 0.22 since libosmo-abis 15d9b7929d449e4138bcb003c614035bceadc3d1, we need to support both old and new version of the API to continue having support for 0.22 but still supporting new versions of the library. Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb --- M configure.ac M src/trau/osmo_ortp.c 2 files changed, 21 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/90/2990/3 diff --git a/configure.ac b/configure.ac index 9b2f189..ff78035 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,20 @@ [ortp_set_log_level_mask has no domain parameter])]) CFLAGS=$_cflags_save +_cflags_save=$CFLAGS +CFLAGS="$CFLAGS $ORTP_CFLAGS" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] + )], + [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)], + [rtp_session_signal_connect requires pointer parameter])], + [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(unsigned long)(arg)], + [rtp_session_signal_connect requires ulong parameter])]) +CFLAGS=$_cflags_save + + AC_OUTPUT( libosmoabis.pc libosmotrau.pc diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c4e9d53..b2ee040 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -350,16 +350,19 @@ rtp_session_signal_connect(rs->sess, "ssrc_changed", (RtpCallback) ortp_sig_cb_ssrc, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); + rtp_session_signal_connect(rs->sess, "payload_type_changed", (RtpCallback) ortp_sig_cb_pt, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); + rtp_session_signal_connect(rs->sess, "network_error", (RtpCallback) ortp_sig_cb_net, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); + rtp_session_signal_connect(rs->sess, "timestamp_jump", (RtpCallback) ortp_sig_cb_ts, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); /* initialize according to the RFC */ rtp_session_set_seq_number(rs->sess, random()); -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Thu Jun 22 17:39:07 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 22 Jun 2017 17:39:07 +0000 Subject: osmo-trx[master]: sigProcLib: Replace dynamically allocated resampling buffers In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:02:52 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 22 Jun 2017 18:02:52 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Replace dynamically allocated resampling buffers In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Replace dynamically allocated resampling buffers ...................................................................... sigProcLib: Replace dynamically allocated resampling buffers Instead use object allocated STL vectors. This simplifies code, removes the need to explicitly release buffers, and fixes a memory leak in destructor deallocation. Also, remove simplified init and release sub-calls. Maintain partition filter allocation using memalign() for SIMD alignment requirements. Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 --- M Transceiver52M/Resampler.cpp M Transceiver52M/Resampler.h 2 files changed, 39 insertions(+), 76 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/Resampler.cpp b/Transceiver52M/Resampler.cpp index 1927e45..6b9621c 100644 --- a/Transceiver52M/Resampler.cpp +++ b/Transceiver52M/Resampler.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "Resampler.h" @@ -35,6 +36,8 @@ #define MAX_OUTPUT_LEN 4096 +using namespace std; + static float sinc(float x) { if (x == 0.0) @@ -43,32 +46,19 @@ return sin(M_PI * x) / (M_PI * x); } -bool Resampler::initFilters(float bw) +void Resampler::initFilters(float bw) { - size_t proto_len = p * filt_len; - float *proto, val, cutoff; + float cutoff; float sum = 0.0f, scale = 0.0f; - float midpt = (float) (proto_len - 1.0) / 2.0; /* * Allocate partition filters and the temporary prototype filter * according to numerator of the rational rate. Coefficients are * real only and must be 16-byte memory aligned for SSE usage. */ - proto = new float[proto_len]; - if (!proto) - return false; - - partitions = (float **) malloc(sizeof(float *) * p); - if (!partitions) { - delete[] proto; - return false; - } - - for (size_t i = 0; i < p; i++) { - partitions[i] = (float *) - memalign(16, filt_len * 2 * sizeof(float)); - } + auto proto = vector(p * filt_len); + for (auto &part : partitions) + part = (complex *) memalign(16, filt_len * sizeof(complex)); /* * Generate the prototype filter with a Blackman-harris window. @@ -85,47 +75,26 @@ else cutoff = (float) q; - for (size_t i = 0; i < proto_len; i++) { + float midpt = (proto.size() - 1) / 2.0; + for (size_t i = 0; i < proto.size(); i++) { proto[i] = sinc(((float) i - midpt) / cutoff * bw); proto[i] *= a0 - - a1 * cos(2 * M_PI * i / (proto_len - 1)) + - a2 * cos(4 * M_PI * i / (proto_len - 1)) - - a3 * cos(6 * M_PI * i / (proto_len - 1)); + a1 * cos(2 * M_PI * i / (proto.size() - 1)) + + a2 * cos(4 * M_PI * i / (proto.size() - 1)) - + a3 * cos(6 * M_PI * i / (proto.size() - 1)); sum += proto[i]; } scale = p / sum; /* Populate filter partitions from the prototype filter */ for (size_t i = 0; i < filt_len; i++) { - for (size_t n = 0; n < p; n++) { - partitions[n][2 * i + 0] = proto[i * p + n] * scale; - partitions[n][2 * i + 1] = 0.0f; - } + for (size_t n = 0; n < p; n++) + partitions[n][i] = complex(proto[i * p + n] * scale); } - /* For convolution, we store the filter taps in reverse */ - for (size_t n = 0; n < p; n++) { - for (size_t i = 0; i < filt_len / 2; i++) { - val = partitions[n][2 * i]; - partitions[n][2 * i] = partitions[n][2 * (filt_len - 1 - i)]; - partitions[n][2 * (filt_len - 1 - i)] = val; - } - } - - delete[] proto; - - return true; -} - -void Resampler::releaseFilters() -{ - if (partitions) { - for (size_t i = 0; i < p; i++) - free(partitions[i]); - } - - free(partitions); - partitions = NULL; + /* Store filter taps in reverse */ + for (auto &part : partitions) + reverse(&part[0], &part[filt_len]); } static bool check_vec_len(int in_len, int out_len, int p, int q) @@ -159,14 +128,6 @@ return true; } -void Resampler::computePath() -{ - for (int i = 0; i < MAX_OUTPUT_LEN; i++) { - in_index[i] = (q * i) / p; - out_path[i] = (q * i) % p; - } -} - int Resampler::rotate(const float *in, size_t in_len, float *out, size_t out_len) { int n, path; @@ -180,8 +141,8 @@ path = out_path[i]; convolve_real(in, in_len, - partitions[path], filt_len, - &out[2 * i], out_len - i, + reinterpret_cast(partitions[path]), + filt_len, &out[2 * i], out_len - i, n, 1, 1, 0); } @@ -190,14 +151,18 @@ bool Resampler::init(float bw) { + if (p == 0 || q == 0 || filt_len == 0) return false; + /* Filterbank filter internals */ - if (!initFilters(bw)) - return false; + initFilters(bw); /* Precompute filterbank paths */ - in_index = new size_t[MAX_OUTPUT_LEN]; - out_path = new size_t[MAX_OUTPUT_LEN]; - computePath(); + int i = 0; + for (auto &index : in_index) + index = (q * i++) / p; + i = 0; + for (auto &path : out_path) + path = (q * i++) % p; return true; } @@ -208,7 +173,7 @@ } Resampler::Resampler(size_t p, size_t q, size_t filt_len) - : in_index(NULL), out_path(NULL), partitions(NULL) + : in_index(MAX_OUTPUT_LEN), out_path(MAX_OUTPUT_LEN), partitions(p) { this->p = p; this->q = q; @@ -217,8 +182,6 @@ Resampler::~Resampler() { - releaseFilters(); - - delete in_index; - delete out_path; + for (auto &part : partitions) + free(part); } diff --git a/Transceiver52M/Resampler.h b/Transceiver52M/Resampler.h index c9f9787..caffc08 100644 --- a/Transceiver52M/Resampler.h +++ b/Transceiver52M/Resampler.h @@ -20,6 +20,9 @@ #ifndef _RESAMPLER_H_ #define _RESAMPLER_H_ +#include +#include + class Resampler { public: /* Constructor for rational sample rate conversion @@ -63,14 +66,11 @@ size_t p; size_t q; size_t filt_len; - size_t *in_index; - size_t *out_path; + std::vector in_index; + std::vector out_path; + std::vector *> partitions; - float **partitions; - - bool initFilters(float bw); - void releaseFilters(); - void computePath(); + void initFilters(float bw); }; #endif /* _RESAMPLER_H_ */ -- To view, visit https://gerrit.osmocom.org/2978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 22 Jun 2017 18:08:16 +0000 Subject: osmo-trx[master]: sigProcLib: Specify standard namespace for isnan() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49328c43fdd690a4e6a2b2e949411aaf5674ead1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:08:19 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 22 Jun 2017 18:08:19 +0000 Subject: [MERGED] osmo-trx[master]: sigProcLib: Specify standard namespace for isnan() In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: sigProcLib: Specify standard namespace for isnan() ...................................................................... sigProcLib: Specify standard namespace for isnan() In commit a3dce85f "sigProcLib: Use explicit NaN check in sinc table generation" Use of std::isnan(double) was added without namespace specifier, which may cause build issues depending on whether the C version isnan() call is available. Add standard namespace to force C++ call usage and potential build issues. Change-Id: I49328c43fdd690a4e6a2b2e949411aaf5674ead1 --- M Transceiver52M/sigProcLib.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 9d1ef49..e94170b 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -982,7 +982,7 @@ for (int i = 0; i < TABLESIZE; i++) { auto x = (double) i / TABLESIZE * 8 * M_PI; auto y = sin(x) / x; - sincTable[i] = isnan(y) ? 1.0 : y; + sincTable[i] = std::isnan(y) ? 1.0 : y; } } -- To view, visit https://gerrit.osmocom.org/2977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49328c43fdd690a4e6a2b2e949411aaf5674ead1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:13:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:13:51 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Fix warning: check ortp API in rtp_session_sign... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Thu Jun 22 18:13:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:13:55 +0000 Subject: [MERGED] libosmo-abis[master]: osmo_ortp.c: Fix warning: check ortp API in rtp_session_sign... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connect ...................................................................... osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connect Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding ortp 0.24, the API is fixed and requests a pointer instead of an unsigned long. As we now require at least ortp 0.22 since libosmo-abis 15d9b7929d449e4138bcb003c614035bceadc3d1, we need to support both old and new version of the API to continue having support for 0.22 but still supporting new versions of the library. Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb --- M configure.ac M src/trau/osmo_ortp.c 2 files changed, 21 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 9b2f189..ff78035 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,20 @@ [ortp_set_log_level_mask has no domain parameter])]) CFLAGS=$_cflags_save +_cflags_save=$CFLAGS +CFLAGS="$CFLAGS $ORTP_CFLAGS" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; } rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] + )], + [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)], + [rtp_session_signal_connect requires pointer parameter])], + [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(unsigned long)(arg)], + [rtp_session_signal_connect requires ulong parameter])]) +CFLAGS=$_cflags_save + + AC_OUTPUT( libosmoabis.pc libosmotrau.pc diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c4e9d53..b2ee040 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -350,16 +350,19 @@ rtp_session_signal_connect(rs->sess, "ssrc_changed", (RtpCallback) ortp_sig_cb_ssrc, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); + rtp_session_signal_connect(rs->sess, "payload_type_changed", (RtpCallback) ortp_sig_cb_pt, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); + rtp_session_signal_connect(rs->sess, "network_error", (RtpCallback) ortp_sig_cb_net, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); + rtp_session_signal_connect(rs->sess, "timestamp_jump", (RtpCallback) ortp_sig_cb_ts, - (unsigned long) rs); + RTP_SIGNAL_PTR_CAST(rs)); /* initialize according to the RFC */ rtp_session_set_seq_number(rs->sess, random()); -- To view, visit https://gerrit.osmocom.org/2990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Thu Jun 22 18:13:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:13:56 +0000 Subject: [MERGED] libosmo-abis[master]: configure.ac: Use -Wall in C(PP)FLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Use -Wall in C(PP)FLAGS ...................................................................... configure.ac: Use -Wall in C(PP)FLAGS Change-Id: I5033387e4a4206f7d34d1db3c6ede9255d199941 --- M configure.ac 1 file 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 ff78035..535d1c3 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,9 @@ AC_CONFIG_MACRO_DIR([m4]) +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " -- To view, visit https://gerrit.osmocom.org/2991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5033387e4a4206f7d34d1db3c6ede9255d199941 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Jun 22 18:13:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:13:56 +0000 Subject: [MERGED] libosmo-abis[master]: osmo_ortp.c: Fix warning: implicit use of function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_ortp.c: Fix warning: implicit use of function ...................................................................... osmo_ortp.c: Fix warning: implicit use of function Explicitly state that we are using an internal API from ortp, and define the function we are using to avoid printing a warning. Change-Id: I9cadcb31ce7ade3632d83753be97fdc9ea518b5b --- M src/trau/osmo_ortp.c 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 4e9df56..c4e9d53 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -199,6 +199,10 @@ return 0; } +/* Internal API coming from rtpsession_priv.h, used in osmo_rtcp_fd_cb */ +#pragma message ("Using internal ortp API: rtp_session_rtcp_rec") +int rtp_session_rtcp_recv(RtpSession * session); + static int osmo_rtcp_fd_cb(struct osmo_fd *fd, unsigned int what) { struct osmo_rtp_socket *rs = fd->data; @@ -360,7 +364,7 @@ /* initialize according to the RFC */ rtp_session_set_seq_number(rs->sess, random()); rs->tx_timestamp = random(); - + return rs; } -- To view, visit https://gerrit.osmocom.org/2989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9cadcb31ce7ade3632d83753be97fdc9ea518b5b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis 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 Jun 22 18:13:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:13:57 +0000 Subject: [MERGED] libosmo-abis[master]: configure.ac: Use -Werror in C(PP)FLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Use -Werror in C(PP)FLAGS ...................................................................... configure.ac: Use -Werror in C(PP)FLAGS Change-Id: Ic674bf28d781b9806dc023777e1fea4ee1a0257a --- 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 535d1c3..b76545e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_CONFIG_MACRO_DIR([m4]) -CFLAGS+=" -Wall" -CPPFLAGS+=" -Wall" +CFLAGS+=" -Wall -Werror" +CPPFLAGS+=" -Wall -Werror" # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" -- To view, visit https://gerrit.osmocom.org/2992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic674bf28d781b9806dc023777e1fea4ee1a0257a Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Jun 22 18:14:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:14:16 +0000 Subject: libosmocore[master]: pseudotalloc: Add simplistic implementation of talloc_asprintf In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:14:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:14:19 +0000 Subject: [MERGED] libosmocore[master]: pseudotalloc: Add simplistic implementation of talloc_asprintf In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: pseudotalloc: Add simplistic implementation of talloc_asprintf ...................................................................... pseudotalloc: Add simplistic implementation of talloc_asprintf fsm.c uses this function. When compiled with --enable-embedded, it triggers a warning: fsm.c: In function 'osmo_fsm_inst_alloc': fsm.c:213:4: warning: implicit declaration of function 'talloc_asprintf' [-Wimplicit-function-declaration] fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id); Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 --- M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h 2 files changed, 17 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index fe7f1ed..bc7a491 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -5,6 +5,7 @@ #include "talloc.h" #include +#include void *_talloc_zero(const void *ctx, size_t size, const char *name) { @@ -61,3 +62,18 @@ { return talloc_zero_size(ctx, el_size * count); } + +char *talloc_asprintf(const void *ctx, const char *fmt, ...) +{ + char *buf; + size_t len = 128; + va_list args; + va_start(args, fmt); + + buf = talloc_size(ctx, len); + if (len < vsnprintf(buf, len, fmt, args)) + strcpy(&buf[len-6], "[...]"); + + va_end(args); + return buf; +} diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index c7127de..f4c0a74 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -39,4 +39,4 @@ size_t el_size, unsigned count, const char *name); - +char *talloc_asprintf(const void *ctx, const char *fmt, ...); -- To view, visit https://gerrit.osmocom.org/2961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore 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 Jun 22 18:14:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:14:19 +0000 Subject: [MERGED] libosmocore[master]: timer_gettimeofday.c: Fix implicit use of timeradd In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: timer_gettimeofday.c: Fix implicit use of timeradd ...................................................................... timer_gettimeofday.c: Fix implicit use of timeradd timer_gettimeofday.c: In function 'osmo_gettimeofday_override_add': timer_gettimeofday.c:54:2: error: implicit declaration of function 'timeradd' [-Werror=implicit-function-declaration] timeradd(&osmo_gettimeofday_override_time, &val, ^ Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 --- M src/timer_gettimeofday.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index 81a1598..3573051 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -29,6 +29,7 @@ #include #include +#include bool osmo_gettimeofday_override = false; struct timeval osmo_gettimeofday_override_time = { 23, 424242 }; -- To view, visit https://gerrit.osmocom.org/2959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:14:20 +0000 Subject: [MERGED] libosmocore[master]: osmo-sim-test.c: Remove unused functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-sim-test.c: Remove unused functions ...................................................................... osmo-sim-test.c: Remove unused functions Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b --- M utils/osmo-sim-test.c 1 file changed, 0 insertions(+), 37 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index d5e932e..ea24120 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -91,22 +91,6 @@ return msg; } -/* 11.1.6 */ -static struct msgb *update_record_nr(struct osim_chan_hdl *st, uint8_t rec_nr, - const uint8_t *data, uint16_t rec_size) -{ - struct msgb *msg; - uint8_t *cur; - - msg = osim_new_apdumsg(0x00, 0xDC, rec_nr, 0x04, rec_size, 0); - cur = msgb_put(msg, rec_size); - memcpy(cur, data, rec_size); - - osim_transceive_apdu(st, msg); - - return msg; -} - /* 11.1.3 */ static struct msgb *read_binary(struct osim_chan_hdl *st, uint16_t offset, uint16_t len) { @@ -121,27 +105,6 @@ return msg; } - -/* 11.1.4 */ -static struct msgb *update_binary(struct osim_chan_hdl *st, uint16_t offset, - const uint8_t *data, uint16_t len) -{ - struct msgb *msg; - uint8_t *cur; - - if (offset > 0x7fff || len > 256) - return NULL; - - msg = osim_new_apdumsg(0x00, 0xD6, offset >> 8, offset & 0xff, len & 0xff, 0); - cur = msgb_put(msg, len); - memcpy(cur, data, len); - - osim_transceive_apdu(st, msg); - - return msg; -} - - static int dump_fcp_template(struct tlv_parsed *tp) { -- To view, visit https://gerrit.osmocom.org/2957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b Gerrit-PatchSet: 5 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: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:14:20 +0000 Subject: [MERGED] libosmocore[master]: sercomm_test.c: return correctly in main In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sercomm_test.c: return correctly in main ...................................................................... sercomm_test.c: return correctly in main Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a --- M tests/sercomm/sercomm_test.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/sercomm/sercomm_test.c b/tests/sercomm/sercomm_test.c index 8b1ffdf..f4f1c22 100644 --- a/tests/sercomm/sercomm_test.c +++ b/tests/sercomm/sercomm_test.c @@ -133,4 +133,5 @@ int main(int argc, char **argv) { test_sercomm(); + return 0; } -- To view, visit https://gerrit.osmocom.org/2956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a 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: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 22 Jun 2017 18:14:20 +0000 Subject: [MERGED] libosmocore[master]: fsm.c: Fix compilation warning: Use PRIu32 for uint32_t In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fsm.c: Fix compilation warning: Use PRIu32 for uint32_t ...................................................................... fsm.c: Fix compilation warning: Use PRIu32 for uint32_t Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423 --- M src/fsm.c 1 file changed, 4 insertions(+), 3 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/fsm.c b/src/fsm.c index fbe22d7..16f5d65 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -284,7 +285,7 @@ { static char buf[32]; if (!fsm->event_names) { - snprintf(buf, sizeof(buf), "%u", event); + snprintf(buf, sizeof(buf), "%"PRIu32, event); return buf; } else return get_value_string(fsm->event_names, event); @@ -314,7 +315,7 @@ { static char buf[32]; if (state >= fsm->num_states) { - snprintf(buf, sizeof(buf), "unknown %u", state); + snprintf(buf, sizeof(buf), "unknown %"PRIu32, state); return buf; } else return fsm->states[state].name; @@ -408,7 +409,7 @@ if (!fi) { LOGPSRC(DLGLOBAL, LOGL_ERROR, file, line, - "Trying to dispatch event %u to non-existent" + "Trying to dispatch event %"PRIu32" to non-existent" " FSM instance!\n", event); osmo_log_backtrace(DLGLOBAL, LOGL_ERROR); return -ENODEV; -- To view, visit https://gerrit.osmocom.org/2960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:21:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 18:21:09 +0000 Subject: [PATCH] osmo-bts[master]: lc15: fix jenkins build Message-ID: Review at https://gerrit.osmocom.org/3007 lc15: fix jenkins build * use proper fw headers include path * do not quote $PARALLEL_MAKE variable Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9 Related: SYS#3682 --- M contrib/jenkins_lc15.sh 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/3007/1 diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index c9173bf..af335d5 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -23,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 -$MAKE "$PARALLEL_MAKE" +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 +$MAKE $PARALLEL_MAKE $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:34:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 18:34:37 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts Message-ID: Review at https://gerrit.osmocom.org/3008 Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 5 files changed, 26 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..664c158 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -17,24 +17,10 @@ cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build "osmo-bts-trx" $configure_flags diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..d81817d 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -22,3 +22,21 @@ cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build() { + set +x + echo + echo "$2" + echo + echo " =============================== $1 ===============================" + echo + set -x + + autoreconf --install --force + ./configure "$2 --with-openbsc=$deps/openbsc/openbsc/include" + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS="$2 --with-openbsc=$deps/openbsc/openbsc/include" $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..420d8d2 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -14,16 +14,6 @@ osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build "osmo-bts-lc15" $configure_flags diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..74aa7e3 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -19,15 +19,6 @@ cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ @@ -35,10 +26,5 @@ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build "osmo-bts-octphy+trx" $configure_flags diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..7cd8572 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,22 +16,8 @@ ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x - -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +configure_flags="--enable-sysmocom-bts" +build "osmo-bts-sysmo" $configure_flags # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:42:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 18:42:04 +0000 Subject: libosmocore[master]: configure.ac: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 after discussion in chat, we should not have -Werror on by default, instead add it in the contrib/jenkins script, by means of 'make CFLAGS+="-Werror" CPPFLAGS+="-Werror"' -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Thu Jun 22 18:44:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 18:44:45 +0000 Subject: [PATCH] libosmo-abis[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" Message-ID: Review at https://gerrit.osmocom.org/3009 Revert "configure.ac: Use -Werror in C(PP)FLAGS" As discussed in chat, -Werror should not be enabled by default. Instead it should be added in our jenkins build scripts. This reverts commit 7d1f53143e8eaeb25bae8979fb80dac57ddbf827. Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/09/3009/1 diff --git a/configure.ac b/configure.ac index b76545e..535d1c3 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_CONFIG_MACRO_DIR([m4]) -CFLAGS+=" -Wall -Werror" -CPPFLAGS+=" -Wall -Werror" +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" -- To view, visit https://gerrit.osmocom.org/3009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:44:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 18:44:45 +0000 Subject: libosmo-abis[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Neels Hofmeyr has reverted this change. Change subject: Revert "configure.ac: Use -Werror in C(PP)FLAGS" ...................................................................... Uploaded patch set 1. -- To view, visit https://gerrit.osmocom.org/3009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: revert Gerrit-Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:45:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 18:45:53 +0000 Subject: [PATCH] libosmo-sccp[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" Message-ID: Review at https://gerrit.osmocom.org/3010 Revert "configure.ac: Use -Werror in C(PP)FLAGS" As discussed in chat, -Werror should not be enabled by default. Instead it should be added in our jenkins build scripts. This reverts commit fc252ca38427bf77e55fd272a954dfe24f03a719. Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b --- M configure.ac 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/10/3010/1 diff --git a/configure.ac b/configure.ac index 3c498c8..36cbb59 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) -CFLAGS+=" -Wall -Werror" -CPPFLAGS+=" -Wall -Werror" +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" AC_OUTPUT( libosmo-sigtran.pc -- To view, visit https://gerrit.osmocom.org/3010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:45:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 18:45:51 +0000 Subject: libosmo-sccp[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Neels Hofmeyr has reverted this change. Change subject: Revert "configure.ac: Use -Werror in C(PP)FLAGS" ...................................................................... Uploaded patch set 1. -- To view, visit https://gerrit.osmocom.org/3010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: revert Gerrit-Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 18:46:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 18:46:01 +0000 Subject: libosmo-abis[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Thu Jun 22 18:52:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 22 Jun 2017 18:52:31 +0000 Subject: libosmo-sccp[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jun 22 19:16:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 19:16:05 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: drop second ';;' Message-ID: Review at https://gerrit.osmocom.org/3011 cosmetic: drop second ';;' Change-Id: I861b87e485d94f17e4b4a800c8da865f98633c92 --- M include/osmocom/sigtran/osmo_ss7.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/11/3011/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 741a7e3..4e04352 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -294,7 +294,7 @@ uint8_t qos_class; struct { uint32_t dpc; - } pc_override;; + } pc_override; struct osmo_ss7_asp *asps[16]; } cfg; -- To view, visit https://gerrit.osmocom.org/3011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I861b87e485d94f17e4b4a800c8da865f98633c92 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 19:18:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 19:18:07 +0000 Subject: [PATCH] libosmo-sccp[master]: add various debug logging to help figure out complex SCCP ro... Message-ID: Review at https://gerrit.osmocom.org/3012 add various debug logging to help figure out complex SCCP routing Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd --- M src/m3ua.c M src/osmo_ss7.c M src/osmo_ss7_hmrt.c M src/sccp_scoc.c M src/sccp_scrc.c 5 files changed, 32 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/12/3012/1 diff --git a/src/m3ua.c b/src/m3ua.c index d96bd18..22e1f9c 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -536,6 +536,8 @@ struct m3ua_data_hdr *dh; struct osmo_ss7_as *as; + LOGPASP(asp, DLM3UA, LOGL_DEBUG, "m3ua_rx_xfer\n"); + if (xua->hdr.msg_type != M3UA_XFER_DATA) return M3UA_ERR_UNSUPP_MSG_TYPE; @@ -556,6 +558,9 @@ dh = data_hdr_from_m3ua(xua); OSMO_ASSERT(dh); m3ua_dh_to_xfer_param(&xua->mtp, dh); + LOGPASP(asp, DLM3UA, LOGL_DEBUG, + "m3ua data hdr opc=%u dpc=%u\n", + xua->mtp.opc, xua->mtp.dpc); /* remove ROUTE_CTX as in the routing case we want to add a new * routing context on the outbound side */ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 78b22a7..1ef04ca 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -740,10 +740,15 @@ rt->cfg.pc = pc; rt->cfg.mask = mask; rt->cfg.linkset_name = talloc_strdup(rt, linkset_name); - if (lset) + if (lset) { rt->dest.linkset = lset; - else + DEBUGP(DLSS7, "Created route pc=%u mask=%u name=%s linkset %s\n", pc, mask, linkset_name, + lset->cfg.name); + } else { rt->dest.as = as; + DEBUGP(DLSS7, "Created route pc=%u mask=%u name=%s as %s\n", pc, mask, linkset_name, + as->cfg.name); + } rt->rtable = rtbl; route_insert_sorted(rtbl, rt); diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c index e66762d..b018639 100644 --- a/src/osmo_ss7_hmrt.c +++ b/src/osmo_ss7_hmrt.c @@ -132,6 +132,15 @@ /* FIXME: unify with gen_mtp_transfer_req_xua() */ rt = osmo_ss7_route_lookup(inst, dpc); if (rt) { + DEBUGP(DLSS7, "found route for dpc %u: %s pc=%u mask=%u %s:%s\n", dpc, + rt->cfg.linkset_name, + rt->cfg.pc, + rt->cfg.mask, + rt->dest.linkset ? "linkset" + : (rt->dest.as ? "as" : "-"), + rt->dest.linkset ? rt->dest.linkset->cfg.name + : (rt->dest.as ? rt->dest.as->cfg.name : "-") + ); /* FIXME: DPC SP restart? */ /* FIXME: DPC Congested? */ /* FIXME: Select link based on SLS */ @@ -140,6 +149,7 @@ struct osmo_ss7_as *as = rt->dest.as; switch (as->cfg.proto) { case OSMO_SS7_ASP_PROT_M3UA: + DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc %u\n", dpc); return m3ua_tx_xua_as(as,xua); case OSMO_SS7_ASP_PROT_IPA: return ipa_tx_xua_as(as, xua); @@ -171,8 +181,10 @@ { uint32_t dpc = xua->mtp.dpc; if (osmo_ss7_pc_is_local(inst, dpc)) { + DEBUGP(DLSS7, "dpc %u is local\n", dpc); return hmdt_message_for_distribution(inst, xua); } else { + DEBUGP(DLSS7, "dpc %u is for routing\n", dpc); return hmrt_message_for_routing(inst, xua); } } diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index fbb6ef8..54ce707 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1544,6 +1544,8 @@ * the one we saved in local state */ src_loc_ref = xua_msg_get_u32(xua, SUA_IEI_SRC_REF); if (src_loc_ref != conn->remote_ref) { + DEBUGP(DLSCCP, "src_loc_ref(%u) != conn->remote_ref(%u)\n", + src_loc_ref, conn->remote_ref); sccp_scoc_rx_inval_src_ref(conn, xua); return; } @@ -1551,6 +1553,8 @@ /* Check if received OPC != the remote_pc we stored locally */ if (xua->mtp.opc != conn->remote_pc) { + DEBUGP(DLSCCP, "xua->mtp.opc(%u) != conn->remote_pc(%u)\n", + xua->mtp.opc, conn->remote_pc); sccp_scoc_rx_inval_opc(inst, xua); return; } diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index a4ce34c..333ab61 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -238,6 +238,7 @@ static int scrc_node_4(struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t return_cause) { + LOGP(DLSS7, LOGL_DEBUG, "scrc_node_4\n"); /* TODO: Routing Failure SCRC -> OMAP */ if (sua_is_connectionless(xua)) { /* Routing Failure SCRC -> SCLC */ @@ -436,6 +437,7 @@ if (!sua_is_connectionless(xua) && !sua_is_cr(xua)) { /* Node 1 (Sheet 3) */ /* deliver to SCOC */ + LOGP(DLSS7, LOGL_DEBUG, "deliver to SCOC\n"); sccp_scoc_rx_from_scrc(inst, xua); return 0; } @@ -446,6 +448,7 @@ /* Route on GT? */ if (called.ri != OSMO_SCCP_RI_GT) { /* Node 6 (Sheet 3) */ + LOGP(DLSS7, LOGL_DEBUG, "called.ri != OSMO_SCCP_RI_GT\n"); return scrc_node_6(inst, xua, &called); } /* Message with hop-counter? */ @@ -455,6 +458,7 @@ if (hop_counter <= 1) { /* Error: hop-counter violation */ /* node 4 */ + LOGP(DLSS7, LOGL_DEBUG, "hop-counter violation\n"); return scrc_node_4(inst, xua, SCCP_RETURN_CAUSE_HOP_COUNTER_VIOLATION); } /* Decrement hop-counter */ -- To view, visit https://gerrit.osmocom.org/3012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 19:18:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 19:18:07 +0000 Subject: [PATCH] libosmo-sccp[master]: gen_mtp_transfer_req_xua(): add addr to error log for missin... Message-ID: Review at https://gerrit.osmocom.org/3013 gen_mtp_transfer_req_xua(): add addr to error log for missing DPC Change-Id: Icfd45bcbecc440b94893db2aca537a162f210abd --- M src/sccp_scrc.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/3013/1 diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index 333ab61..7ae1984 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -125,7 +126,8 @@ xua->mtp.dpc = called->pc; if (!xua->mtp.dpc) { LOGP(DLSCCP, LOGL_ERROR, "MTP-TRANSFER.req from SCCP " - "without DPC?!?\n"); + "without DPC?!? called=%s\n", + osmo_sccp_addr_dump(called)); return -1; } -- To view, visit https://gerrit.osmocom.org/3013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icfd45bcbecc440b94893db2aca537a162f210abd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 22 19:18:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 19:18:08 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_user.c: add missing error logging Message-ID: Review at https://gerrit.osmocom.org/3014 sccp_user.c: add missing error logging Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c --- M src/sccp_user.c 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/14/3014/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index 5f89f71..84ea480 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -74,8 +74,14 @@ if (!pc_valid) pc = 0; - if (sccp_user_find(inst, ssn, pc)) + scu = sccp_user_find(inst, ssn, pc); + if (scu) { + LOGP(DLSCCP, LOGL_ERROR, + "Cannot bind user '%s' to SSN=%u PC=%u (pc_valid=%u), this SSN and PC" + " is already bound by '%s'\n", + name, ssn, pc, pc_valid, scu->name); return NULL; + } LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u (pc_valid=%u)\n", name, ssn, pc, pc_valid); @@ -247,8 +253,10 @@ /* allocate + initialize SS7 instance */ ss7 = osmo_ss7_instance_find_or_create(ctx, 1); - if (!ss7) + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; + } ss7->cfg.primary_pc = pc; as_name = talloc_asprintf(ctx, "as-clnt-%s", name); -- To view, visit https://gerrit.osmocom.org/3014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From admin at opensuse.org Thu Jun 22 19:54:06 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:54:06 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <594c206921824_6cadf0f84129442@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: [ 241s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 241s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02 [ 241s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 241s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 241s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 241s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 241s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00 [ 241s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22 [ 241s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33 [ 241s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00 [ 241s] -Success [ 241s] ./testsuite.at:63: exit code was 132, expected 0 [ 241s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED (testsuite.at:63) [ 241s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 241s] make[1]: *** [override_dh_auto_test] Error 1 [ 241s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 241s] debian/rules:15: recipe for target 'build' failed [ 241s] make: *** [build] Error 2 [ 241s] dpkg-buildpackage: error: debian/rule[ 221.544142] serial8250: too much work for irq4 [ 241s] s build gave error exit status 2 [ 241s] [ 241s] build35 failed "build libosmocore_0.9.6.20170622.dsc" at Thu Jun 22 19:53:52 UTC 2017. [ 241s] [ 241s] ### VM INTERACTION START ### [ 244s] [ 224.709945] reboot: Power down [ 245s] ### VM INTERACTION END ### [ 245s] [ 245s] build35 failed "build libosmocore_0.9.6.20170622.dsc" at Thu Jun 22 19:53:57 UTC 2017. [ 245s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:54:57 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:54:57 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <594c20a325cc5_6d0df0f84126097@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/Debian_8.0/x86_64 Package network:osmocom:nightly/libosmo-abis failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 92s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 92s] ^ [ 93s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 93s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 93s] ^ [ 93s] cc1: all warnings being treated as errors [ 93s] Makefile:519: recipe for target 'e1_input.lo' failed [ 93s] make[3]: *** [e1_input.lo] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:457: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:363: 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:12: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb02 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:54:47 UTC 2017. [ 93s] [ 93s] ### VM INTERACTION START ### [ 94s] Powering off. [ 94s] [ 78.909489] reboot: Power down [ 94s] ### VM INTERACTION END ### [ 94s] [ 94s] lamb02 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:54:49 UTC 2017. [ 94s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:55:15 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:55:15 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <594c20e1503ff_6d6df0f84134640@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmo-abis failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 78s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 78s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 78s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 78s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 78s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 78s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 78s] cc1: all warnings being treated as errors [ 78s] Makefile:530: recipe for target 'e1_input.lo' failed [ 78s] make[3]: *** [e1_input.lo] Error 1 [ 78s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 78s] Makefile:469: recipe for target 'all-recursive' failed [ 78s] make[2]: *** [all-recursive] Error 1 [ 78s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 78s] Makefile:376: 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:12: recipe for target 'build' failed [ 78s] make: *** [build] Error 2 [ 78s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 78s] [ 78s] lamb12 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:54:57 UTC 2017. [ 78s] [ 78s] ### VM INTERACTION START ### [ 81s] [ 68.770343] reboot: Power down [ 81s] ### VM INTERACTION END ### [ 81s] [ 81s] lamb12 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:00 UTC 2017. [ 81s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:55:32 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:55:32 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <594c20e28b714_6d6df0f841349c9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/libosmo-abis failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 100s] ^ [ 100s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 100s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 100s] ^ [ 100s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 100s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 100s] ^ [ 100s] cc1: all warnings being treated as errors [ 100s] Makefile:530: recipe for target 'e1_input.lo' failed [ 100s] make[3]: *** [e1_input.lo] Error 1 [ 100s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 100s] Makefile:469: recipe for target 'all-recursive' failed [ 100s] make[2]: *** [all-recursive] Error 1 [ 100s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 100s] Makefile:376: recipe for target 'all' failed [ 100s] make[1]: *** [all] Error 2 [ 100s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 100s] dh_auto_build: make -j1 returned exit code 2 [ 100s] debian/rules:12: recipe for target 'build' failed [ 100s] make: *** [build] Error 2 [ 100s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 100s] [ 100s] lamb70 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:14 UTC 2017. [ 100s] [ 100s] ### VM INTERACTION START ### [ 103s] ### VM INTERACTION END ### [ 103s] [ 103s] lamb70 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:17 UTC 2017. [ 103s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:55:32 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:55:32 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <594c20e2bcfe9_6d6df0f84135066@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmo-abis failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 90s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 90s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 90s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 90s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 90s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 90s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 90s] cc1: all warnings being treated as errors [ 90s] Makefile:530: recipe for target 'e1_input.lo' failed [ 90s] make[3]: *** [e1_input.lo] Error 1 [ 90s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 90s] Makefile:469: recipe for target 'all-recursive' failed [ 90s] make[2]: *** [all-recursive] Error 1 [ 90s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 90s] Makefile:376: recipe for target 'all' failed [ 90s] make[1]: *** [all] Error 2 [ 90s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 90s] dh_auto_build: make -j1 returned exit code 2 [ 90s] debian/rules:12: recipe for target 'build' failed [ 90s] make: *** [build] Error 2 [ 90s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 90s] [ 90s] lamb02 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:14 UTC 2017. [ 90s] [ 90s] ### VM INTERACTION START ### [ 93s] [ 79.225237] reboot: Power down [ 93s] ### VM INTERACTION END ### [ 93s] [ 93s] lamb02 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:17 UTC 2017. [ 93s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:55:32 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:55:32 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <594c20e3540e_6d6df0f841351ba@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/xUbuntu_16.10/i586 Package network:osmocom:nightly/libosmo-abis failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 78s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 78s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 78s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 78s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 78s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 78s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 78s] cc1: all warnings being treated as errors [ 78s] Makefile:530: recipe for target 'e1_input.lo' failed [ 78s] make[3]: *** [e1_input.lo] Error 1 [ 78s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 78s] Makefile:469: recipe for target 'all-recursive' failed [ 78s] make[2]: *** [all-recursive] Error 1 [ 78s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 78s] Makefile:376: 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:12: recipe for target 'build' failed [ 78s] make: *** [build] Error 2 [ 78s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 78s] [ 78s] lamb73 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:16 UTC 2017. [ 78s] [ 78s] ### VM INTERACTION START ### [ 81s] [ 67.391011] reboot: Power down [ 81s] ### VM INTERACTION END ### [ 81s] [ 81s] lamb73 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:19 UTC 2017. [ 81s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:55:32 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:55:32 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in Debian_9.0/i586 In-Reply-To: References: Message-ID: <594c20e3870df_6d6df0f84135360@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/Debian_9.0/i586 Package network:osmocom:nightly/libosmo-abis failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 94s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 94s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 94s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 94s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 94s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 94s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 95s] cc1: all warnings being treated as errors [ 95s] Makefile:530: recipe for target 'e1_input.lo' failed [ 95s] make[3]: *** [e1_input.lo] Error 1 [ 95s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 95s] Makefile:469: recipe for target 'all-recursive' failed [ 95s] make[2]: *** [all-recursive] Error 1 [ 95s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 95s] Makefile:376: recipe for target 'all' failed [ 95s] make[1]: *** [all] Error 2 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] dh_auto_build: make -j1 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] lamb07 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:27 UTC 2017. [ 95s] [ 95s] ### VM INTERACTION START ### [ 98s] [ 82.482869] reboot: Power down [ 98s] ### VM INTERACTION END ### [ 98s] [ 98s] lamb07 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:31 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 Jun 22 19:55:49 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:55:49 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <594c20ff69e0c_6d0df0f841263c4@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmo-abis failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 108s] e1_input.c:190:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 108s] write(pcap_fd, &header, sizeof(header)); [ 108s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 108s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 108s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 108s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 108s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 108s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 108s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 108s] cc1: all warnings being treated as errors [ 108s] Makefile:530: recipe for target 'e1_input.lo' failed [ 108s] make[3]: *** [e1_input.lo] Error 1 [ 108s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 108s] Makefile:469: recipe for target 'all-recursive' failed [ 108s] make[2]: *** [all-recursive] Error 1 [ 108s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 108s] Makefile:376: 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:12: recipe for target 'build' failed [ 108s] make: *** [build] Error 2 [ 108s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 108s] [ 108s] cloud121 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:34 UTC 2017. [ 108s] [ 108s] ### VM INTERACTION START ### [ 111s] [ 84.194740] reboot: Power down [ 117s] ### VM INTERACTION END ### -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:56:06 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:56:06 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <594c20ffb5ff3_6d0df0f84126422@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/xUbuntu_17.04/i586 Package network:osmocom:nightly/libosmo-abis failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 114s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 114s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 114s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 114s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 114s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 114s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 114s] cc1: all warnings being treated as errors [ 114s] Makefile:530: recipe for target 'e1_input.lo' failed [ 114s] make[3]: *** [e1_input.lo] Error 1 [ 114s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 114s] Makefile:469: recipe for target 'all-recursive' failed [ 114s] make[2]: *** [all-recursive] Error 1 [ 114s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 114s] Makefile:376: recipe for target 'all' failed [ 114s] make[1]: *** [all] Error 2 [ 114s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 114s] dh_auto_build: make -j1 returned exit code 2 [ 114s] debian/rules:12: recipe for target 'build' failed [ 114s] make: *** [build] Error 2 [ 114s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 114s] [ 114s] cloud120 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:44 UTC 2017. [ 114s] [ 114s] ### VM INTERACTION START ### [ 117s] [ 90.624167] reboot: Power down [ 124s] ### VM INTERACTION END ### [ 124s] [ 124s] cloud120 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:55:54 UTC 2017. [ 124s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:56:23 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:56:23 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <594c211ebf622_6d6df0f84135488@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/xUbuntu_16.04/i586 Package network:osmocom:nightly/libosmo-abis failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 112s] e1_input.c:191:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 112s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 112s] ^ [ 112s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 112s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 112s] ^ [ 112s] cc1: all warnings being treated as errors [ 112s] Makefile:530: recipe for target 'e1_input.lo' failed [ 112s] make[3]: *** [e1_input.lo] Error 1 [ 112s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 112s] Makefile:469: recipe for target 'all-recursive' failed [ 112s] make[2]: *** [all-recursive] Error 1 [ 112s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 112s] Makefile:376: recipe for target 'all' failed [ 112s] make[1]: *** [all] Error 2 [ 112s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 112s] dh_auto_build: make -j1 returned exit code 2 [ 112s] debian/rules:12: recipe for target 'build' failed [ 112s] make: *** [build] Error 2 [ 112s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 112s] [ 112s] build35 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:56:05 UTC 2017. [ 112s] [ 112s] ### VM INTERACTION START ### [ 115s] [ 99.251965] reboot: Power down [ 116s] ### VM INTERACTION END ### [ 116s] [ 116s] build35 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:56:09 UTC 2017. [ 116s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 22 19:58:06 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 22 Jun 2017 19:58:06 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-abis in Debian_8.0/i586 In-Reply-To: References: Message-ID: <594c2158b19ad_6d6df0f84135587@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/Debian_8.0/i586 Package network:osmocom:nightly/libosmo-abis failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-abis Last lines of build log: [ 120s] write(pcap_fd, &lapd_header, sizeof(lapd_header)); [ 120s] ^ [ 120s] e1_input.c:192:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result] [ 120s] write(pcap_fd, msg->l2h, msgb_l2len(msg)); [ 120s] ^ [ 120s] cc1: all warnings being treated as errors [ 120s] Makefile:519: recipe for target 'e1_input.lo' failed [ 120s] make[3]: *** [e1_input.lo] Error 1 [ 120s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 120s] Makefile:457: recipe for target 'all-recursive' failed [ 120s] make[2]: *** [all-recursive] Error 1 [ 120s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 120s] Makefile:363: recipe for target 'all' failed [ 120s] make[1]: *** [all] Error 2 [ 120s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 120s] dh_auto_build: make -j1 returned exit code 2 [ 120s] debian/rules:12: recipe for target 'build' failed [ 120s] make: *** [build] Error 2 [ 120s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 120s] [ 120s] cloud135 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:57:49 UTC 2017. [ 120s] [ 120s] ### VM INTERACTION START ### [ 121s] Powering off. [ 121s] [ 101.267656] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] cloud135 failed "build libosmo-abis_0.3.3.20170622.dsc" at Thu Jun 22 19:57:53 UTC 2017. [ 123s] -- 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 Jun 22 21:34:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:34:48 +0000 Subject: libosmo-abis[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr 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 Thu Jun 22 21:34:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:34:51 +0000 Subject: [MERGED] libosmo-abis[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Revert "configure.ac: Use -Werror in C(PP)FLAGS" ...................................................................... Revert "configure.ac: Use -Werror in C(PP)FLAGS" As discussed in chat, -Werror should not be enabled by default. Instead it should be added in our jenkins build scripts. This reverts commit 7d1f53143e8eaeb25bae8979fb80dac57ddbf827. Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 --- M configure.ac 1 file changed, 2 insertions(+), 2 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/configure.ac b/configure.ac index b76545e..535d1c3 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_CONFIG_MACRO_DIR([m4]) -CFLAGS+=" -Wall -Werror" -CPPFLAGS+=" -Wall -Werror" +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" -- To view, visit https://gerrit.osmocom.org/3009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied6e21b72b24fcb623fd945ed9560b742a8eedf5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 22 21:35:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:35:09 +0000 Subject: libosmo-sccp[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr 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 Thu Jun 22 21:35:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:35:12 +0000 Subject: [MERGED] libosmo-sccp[master]: Revert "configure.ac: Use -Werror in C(PP)FLAGS" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Revert "configure.ac: Use -Werror in C(PP)FLAGS" ...................................................................... Revert "configure.ac: Use -Werror in C(PP)FLAGS" As discussed in chat, -Werror should not be enabled by default. Instead it should be added in our jenkins build scripts. This reverts commit fc252ca38427bf77e55fd272a954dfe24f03a719. Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b --- M configure.ac 1 file changed, 2 insertions(+), 2 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/configure.ac b/configure.ac index 3c498c8..36cbb59 100644 --- a/configure.ac +++ b/configure.ac @@ -53,8 +53,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) -CFLAGS+=" -Wall -Werror" -CPPFLAGS+=" -Wall -Werror" +CFLAGS+=" -Wall" +CPPFLAGS+=" -Wall" AC_OUTPUT( libosmo-sigtran.pc -- To view, visit https://gerrit.osmocom.org/3010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 22 21:43:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:43:00 +0000 Subject: libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* In-Reply-To: References: Message-ID: Patch Set 2: If I were a user of the HTML API doc, I would expect all data types to be listed and linked... I don't have a strong opinion really since I usually read the source code instead. -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 21:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:45:09 +0000 Subject: libosmocore[master]: doxygen: linuxlist.h: fix some API doc to use doxygen Qt style In-Reply-To: References: Message-ID: Patch Set 2: ok, we can drop this -- To view, visit https://gerrit.osmocom.org/2984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ae25c9bc6b7504402e583a6ce77b037083dcb80 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 21:54:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:54:57 +0000 Subject: [PATCH] libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief 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/2983 to look at the new patch set (#3). doxygen: enable AUTOBRIEF, drop \brief Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gb.in M Doxyfile.gsm.in M Doxyfile.vty.in M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/application.h M include/osmocom/core/bitXXgen.h.tpl M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/defs.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/msgb.h M include/osmocom/core/panic.h M include/osmocom/core/prim.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/statistics.h M include/osmocom/core/strrb.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_08_08.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/sim.h M include/osmocom/vty/command.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/crc16.c M src/crcXXgen.c.tpl M src/ctrl/control_if.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_ns.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/auth_core.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/panic.c M src/plugin.c M src/prim.c M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/core.c M src/socket.c M src/stat_item.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c M utils/conv_gen.py 144 files changed, 1,572 insertions(+), 1,573 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/2983/3 -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 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 Thu Jun 22 21:54:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:54:57 +0000 Subject: [PATCH] libosmocore[master]: doxygen: unify use of \file across the board 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/2987 to look at the new patch set (#3). doxygen: unify use of \file across the board Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b --- M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/backtrace.h M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/crc16.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/crcgen.h M include/osmocom/core/defs.h M include/osmocom/core/endian.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/loggingrb.h M include/osmocom/core/macaddr.h M include/osmocom/core/msgb.h M include/osmocom/core/msgfile.h M include/osmocom/core/panic.h M include/osmocom/core/plugin.h M include/osmocom/core/prim.h M include/osmocom/core/process.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/serial.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/stats.h M include/osmocom/core/strrb.h M include/osmocom/core/talloc.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/crypt/gprs_cipher.h M include/osmocom/ctrl/control_cmd.h M include/osmocom/ctrl/control_if.h M include/osmocom/ctrl/control_vty.h M include/osmocom/ctrl/ports.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_bssgp_bss.h M include/osmocom/gprs/gprs_msgb.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_ns_frgre.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_04_60.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/apn.h M include/osmocom/gsm/bitvec_gsm.h M include/osmocom/gsm/comp128.h M include/osmocom/gsm/comp128v23.h M include/osmocom/gsm/gan.h M include/osmocom/gsm/gea.h 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 include/osmocom/gsm/gsm0480.h M include/osmocom/gsm/gsm0502.h M include/osmocom/gsm/gsm0808.h M include/osmocom/gsm/gsm0808_utils.h M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/gsm48.h M include/osmocom/gsm/gsm48_ie.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/gsup.h M include/osmocom/gsm/ipa.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/meas_rep.h M include/osmocom/gsm/mncc.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/prim.h M include/osmocom/gsm/protocol/gsm_03_40.h M include/osmocom/gsm/protocol/gsm_03_41.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M include/osmocom/gsm/protocol/gsm_04_11.h M include/osmocom/gsm/protocol/gsm_04_12.h M include/osmocom/gsm/protocol/gsm_04_14.h M include/osmocom/gsm/protocol/gsm_04_80.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_09_02.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/protocol/gsm_23_003.h M include/osmocom/gsm/protocol/gsm_44_318.h M include/osmocom/gsm/protocol/ipaccess.h M include/osmocom/gsm/protocol/smpp34_osmocom.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/rxlev_stat.h M include/osmocom/gsm/sysinfo.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/class_tables.h M include/osmocom/sim/sim.h M include/osmocom/vty/buffer.h M include/osmocom/vty/command.h M include/osmocom/vty/logging.h M include/osmocom/vty/misc.h M include/osmocom/vty/ports.h M include/osmocom/vty/stats.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vector.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm660.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/conv_acc.c M src/conv_acc_generic.c M src/conv_acc_sse.c M src/conv_acc_sse_avx.c M src/conv_acc_sse_impl.h M src/crc16.c M src/crcXXgen.c.tpl M src/ctrl/control_cmd.c M src/ctrl/control_if.c M src/ctrl/control_vty.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/common_vty.c M src/gb/common_vty.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_bssgp_util.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns.c M src/gb/gprs_ns_frgre.c M src/gb/gprs_ns_vty.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/apn.c M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_core.c M src/gsm/auth_milenage.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_gea.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0414.c M src/gsm/gsm0480.c M src/gsm/gsm0502.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/kasumi.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/milenage/aes-encblock.c M src/gsm/milenage/aes-internal-enc.c M src/gsm/milenage/aes-internal.c M src/gsm/milenage/aes.h M src/gsm/milenage/aes_i.h M src/gsm/milenage/aes_wrap.h M src/gsm/milenage/common.h M src/gsm/milenage/milenage.c M src/gsm/milenage/milenage.h M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/rxlev_stat.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/msgfile.c M src/panic.c M src/plugin.c M src/prim.c M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/card_fs_isim.c M src/sim/card_fs_sim.c M src/sim/card_fs_tetra.c M src/sim/card_fs_uicc.c M src/sim/card_fs_usim.c M src/sim/class_tables.c M src/sim/core.c M src/sim/gsm_int.h M src/sim/reader.c M src/sim/reader_pcsc.c M src/sim/sim_int.h M src/socket.c M src/stat_item.c M src/statistics.c M src/stats.c M src/stats_statsd.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/buffer.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c M utils/osmo-arfcn.c M utils/osmo-auc-gen.c 251 files changed, 874 insertions(+), 867 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/2987/3 diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h index 3e9b688..3e62a01 100644 --- a/include/osmocom/codec/codec.h +++ b/include/osmocom/codec/codec.h @@ -1,3 +1,5 @@ +/*! \file codec.h */ + #pragma once #include diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index a9c59e4..a2d4115 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -1,3 +1,7 @@ +/*! \file gsm0503_coding.h + * GSM TS 05.03 coding + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \addtogroup coding * @{ - */ - -/*! \file gsm0503_coding.h - * GSM TS 05.03 coding - */ + * \file gsm0503_coding.h */ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index 1463fb3..05b5e27 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_interleaving.h + * GSM TS 05.03 interleaving. + */ + #pragma once #include /*! \addtogroup interleaving * @{ - */ - -/*! \file gsm0503_interleaving.h - * GSM TS 05.03 interleaving - */ + * \file gsm0503_interleaving.h */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 435c913..fbd3bfd 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_mapping.c + * GSM TS 05.03 burst mapping. + */ + #pragma once #include /*! \addtogroup mapping * @{ - */ - -/*! \file gsm0503_mapping.c - * GSM TS 05.03 burst mapping - */ + * \file gsm0503_mapping.h */ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); diff --git a/include/osmocom/coding/gsm0503_parity.h b/include/osmocom/coding/gsm0503_parity.h index 2743bdb..28a5444 100644 --- a/include/osmocom/coding/gsm0503_parity.h +++ b/include/osmocom/coding/gsm0503_parity.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_parity.h + * GSM TS 05.03 parity. + */ + #pragma once #include /*! \addtogroup parity * @{ - */ - -/*! \file gsm0503_parity.h - * GSM TS 05.03 parity - */ + * \file gsm0503_parity.h */ const struct osmo_crc64gen_code gsm0503_fire_crc40; const struct osmo_crc16gen_code gsm0503_cs234_crc16; diff --git a/include/osmocom/coding/gsm0503_tables.h b/include/osmocom/coding/gsm0503_tables.h index f8c43c6..55c4ebe 100644 --- a/include/osmocom/coding/gsm0503_tables.h +++ b/include/osmocom/coding/gsm0503_tables.h @@ -1,3 +1,7 @@ +/*! \file gsm0503_tables.h + * GSM TS 05.03 tables. + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \addtogroup tables * @{ - */ - -/*! \file gsm0503_tables.h - * GSM TS 05.03 tables - */ + * \file gsm0503_tables.h */ extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8]; extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8]; diff --git a/include/osmocom/core/backtrace.h b/include/osmocom/core/backtrace.h index 0c9b6ef..d661dd0 100644 --- a/include/osmocom/core/backtrace.h +++ b/include/osmocom/core/backtrace.h @@ -1,3 +1,5 @@ +/*! \file backtrace.h */ + #pragma once void osmo_generate_backtrace(void); diff --git a/include/osmocom/core/bitcomp.h b/include/osmocom/core/bitcomp.h index a184a1c..dc356bd 100644 --- a/include/osmocom/core/bitcomp.h +++ b/include/osmocom/core/bitcomp.h @@ -1,8 +1,7 @@ -#pragma once - -/* bit compression routines */ - -/* (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev +/*! \file bitcomp.h + * Osmocom bit compression routines. */ +/* + * (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev * * All Rights Reserved * @@ -22,13 +21,11 @@ * */ +#pragma once + /*! \defgroup bitcomp Bit compression * @{ - */ - -/*! \file bitcomp.h - * Osmocom bit compression routines - */ + * \file bitcomp.h */ #include #include diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 61af716..17fe1c6 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -1,3 +1,11 @@ +/*! \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 #include @@ -9,15 +17,7 @@ /*! \defgroup bits soft, unpacked and packed bits * @{ - */ - -/*! \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)) - */ + * \file bits.h */ typedef int8_t sbit_t; /*!< soft bit (-127...127) */ typedef uint8_t ubit_t; /*!< unpacked bit (0 or 1) */ diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 9187ce2..d4c7d68 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -1,7 +1,3 @@ -#pragma once - -/* bit vector utility routines */ - /* (C) 2009 by Harald Welte * (C) 2012 Ivan Klyuchnikov * (C) 2015 Sysmocom s.f.m.c. GmbH @@ -24,21 +20,11 @@ * */ +#pragma once + /*! \defgroup bitvec Bit vectors * @{ - */ - -/*! \file bitvec.h - * Osmocom bit vector abstraction - * - * These functions assume a MSB (most significant bit) first layout of the - * bits, so that for instance the 5 bit number abcde (a is MSB) can be - * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count - * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). - * Note that there are other incompatible encodings, like it is used - * for the EGPRS RLC data block headers (there the bits are numbered from LSB - * to MSB). - */ + * \file bitvec.h */ #include #include diff --git a/include/osmocom/core/byteswap.h b/include/osmocom/core/byteswap.h index 4274b8f..1ea5b3d 100644 --- a/include/osmocom/core/byteswap.h +++ b/include/osmocom/core/byteswap.h @@ -1,3 +1,5 @@ +/*! \file byteswap.h */ + #pragma once #include #include diff --git a/include/osmocom/core/conv.h b/include/osmocom/core/conv.h index 1888fe1..8b344f4 100644 --- a/include/osmocom/core/conv.h +++ b/include/osmocom/core/conv.h @@ -1,6 +1,6 @@ +/*! \file conv.h + * Osmocom convolutional encoder and decoder. */ /* - * conv.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -22,11 +22,7 @@ /*! \defgroup conv Convolutional encoding and decoding routines * @{ - */ - -/*! \file conv.h - * Osmocom convolutional encoder and decoder - */ + * \file conv.h */ #pragma once diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h index f1564bd..52807af 100644 --- a/include/osmocom/core/crc16.h +++ b/include/osmocom/core/crc16.h @@ -1,4 +1,4 @@ -/* +/*! \file crc16.h * This was copied from the linux kernel and adjusted for our types. */ /* diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl index 4718809..2c909f9 100644 --- a/include/osmocom/core/crcXXgen.h.tpl +++ b/include/osmocom/core/crcXXgen.h.tpl @@ -1,6 +1,6 @@ +/*! \file crcXXgen.h + * Osmocom generic CRC routines (for max XX bits poly) header. */ /* - * crcXXgen.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,12 +24,7 @@ /*! \addtogroup crcgen * @{ - */ - -/*! \file crcXXgen.h - * Osmocom generic CRC routines (for max XX bits poly) header - */ - + * \file crcXXgen.h.tpl */ #include #include diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h index b39b55d..d73e6e8 100644 --- a/include/osmocom/core/crcgen.h +++ b/include/osmocom/core/crcgen.h @@ -1,6 +1,6 @@ +/*! \file crcgen.h + * Osmocom generic CRC routines global header. */ /* - * crcgen.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,11 +24,7 @@ /*! \defgroup crcgen Osmocom generic CRC routines * @{ - */ - -/*! \file crcgen.h - * Osmocom generic CRC routines global header - */ + * \file crcgen.h */ #include #include diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index 88c41b9..5e5aa90 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -1,12 +1,12 @@ +/*! \file defs.h + * General definitions that are meant to be included from header files. + */ + #pragma once /*! \defgroup utils General-purpose utility functions * @{ - */ - -/*! \file defs.h - * General definitions that are meant to be included from header files. - */ + * \file defs.h */ /*! Check for gcc and version. * diff --git a/include/osmocom/core/endian.h b/include/osmocom/core/endian.h index 621f34e..6107b12 100644 --- a/include/osmocom/core/endian.h +++ b/include/osmocom/core/endian.h @@ -1,6 +1,5 @@ -#pragma once - -/** +/*! \file endian.h + * * GNU and FreeBSD have various ways to express the * endianess but none of them is similiar enough. This * will create two defines that allows to decide on the @@ -12,6 +11,8 @@ * */ +#pragma once + #if defined(__FreeBSD__) #include #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index fb182f3..2fbb250 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -1,3 +1,7 @@ +/*! \file fsm.h + * Finite State Machine + */ + #pragma once #include @@ -9,11 +13,7 @@ /*! \defgroup fsm Finite State Machine abstraction * @{ - */ - -/*! \file fsm.h - * Finite State Machine - */ + * \file fsm.h */ struct osmo_fsm_inst; diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index 0dc25bb..1e19315 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -1,8 +1,6 @@ -#pragma once - -/* gsmtap header, pseudo-header in front of the actua GSM payload */ - -/* GSMTAP is a generic header format for GSM protocol captures, +/*! \file gsmtap.h + * gsmtap header, pseudo-header in front of the actua GSM payload. + * GSMTAP is a generic header format for GSM protocol captures, * it uses the IANA-assigned UDP port number 4729 and carries * payload in various formats of GSM interfaces such as Um MAC * blocks or Um bursts. @@ -11,6 +9,8 @@ * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/) */ +#pragma once + #include /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index b60257e..59b81e5 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -6,8 +6,7 @@ /*! \defgroup gsmtap GSMTAP * @{ - */ -/*! \file gsmtap_util.h */ + * \file gsmtap_util.h */ uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id); diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index 5098c5f..cb753d1 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -1,11 +1,4 @@ -#pragma once - -/*! \defgroup linuxlist Simple doubly linked list implementation - * @{ - */ - -/*! - * \file linuxlist.h +/*! \file linuxlist.h * * Simple doubly linked list implementation. * @@ -16,6 +9,12 @@ * using the generic single-entry routines. */ +#pragma once + +/*! \defgroup linuxlist Simple doubly linked list implementation + * @{ + * \file linuxlist.h */ + #include #ifndef inline diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index bb5aa42..68a9c13 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -2,9 +2,7 @@ /*! \defgroup logging Osmocom logging framework * @{ - */ - -/*! \file logging.h */ + * \file logging.h */ #include #include diff --git a/include/osmocom/core/loggingrb.h b/include/osmocom/core/loggingrb.h index dcd7917..a9fb404 100644 --- a/include/osmocom/core/loggingrb.h +++ b/include/osmocom/core/loggingrb.h @@ -1,5 +1,3 @@ -#pragma once - /* (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * @@ -19,13 +17,11 @@ * */ +#pragma once /*! \defgroup loggingrb Osmocom ringbuffer-backed logging * @{ - */ - -/*! \file loggingrb.h - */ + * \file loggingrb.h */ struct log_info; diff --git a/include/osmocom/core/macaddr.h b/include/osmocom/core/macaddr.h index 8de6238..83f0bde 100644 --- a/include/osmocom/core/macaddr.h +++ b/include/osmocom/core/macaddr.h @@ -1,3 +1,5 @@ +/*! \file macaddr.h */ + #pragma once int osmo_macaddr_parse(uint8_t *out, const char *in); diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 7fad943..91b7ec7 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -27,9 +27,7 @@ /*! \defgroup msgb Message buffers * @{ - */ - -/*! \file msgb.h */ + * \file msgb.h */ #define MSGB_DEBUG diff --git a/include/osmocom/core/msgfile.h b/include/osmocom/core/msgfile.h index cab97b2..800b431 100644 --- a/include/osmocom/core/msgfile.h +++ b/include/osmocom/core/msgfile.h @@ -1,3 +1,4 @@ +/*! \file msgfile.h */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/include/osmocom/core/panic.h b/include/osmocom/core/panic.h index 92c557f..2bb4240 100644 --- a/include/osmocom/core/panic.h +++ b/include/osmocom/core/panic.h @@ -2,9 +2,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file panic.h */ + * \file panic.h */ #include diff --git a/include/osmocom/core/plugin.h b/include/osmocom/core/plugin.h index aef1dfc..6db8709 100644 --- a/include/osmocom/core/plugin.h +++ b/include/osmocom/core/plugin.h @@ -1,3 +1,5 @@ +/*! \file plugin.h */ + #pragma once int osmo_plugin_load_all(const char *directory); diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h index 7288ba6..88ae08b 100644 --- a/include/osmocom/core/prim.h +++ b/include/osmocom/core/prim.h @@ -2,9 +2,7 @@ /*! \defgroup prim Osmocom primitives * @{ - */ - -/*! \file prim.h */ + * \file prim.h */ #include #include diff --git a/include/osmocom/core/process.h b/include/osmocom/core/process.h index 1dde021..8cfca8a 100644 --- a/include/osmocom/core/process.h +++ b/include/osmocom/core/process.h @@ -1,2 +1,3 @@ +/*! \file process.h */ #warning "Update from osmocom/core/process.h to osmocom/core/application.h" #include diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index b75967a..74414e9 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -2,9 +2,7 @@ /*! \defgroup rate_ctr Rate counters * @{ - */ - -/*! \file rate_ctr.h */ + * \file rate_ctr.h */ #include diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index fe84c5b..9b5f372 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -1,3 +1,7 @@ +/*! \file select.h + * select loop abstraction. + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \defgroup select Select loop abstraction * @{ - */ - -/*! \file select.h - * select loop abstraction - */ + * \file select.h */ /*! Indicate interest in reading from the file descriptor */ #define BSC_FD_READ 0x0001 diff --git a/include/osmocom/core/sercomm.h b/include/osmocom/core/sercomm.h index cf15613..072f4d9 100644 --- a/include/osmocom/core/sercomm.h +++ b/include/osmocom/core/sercomm.h @@ -1,3 +1,7 @@ +/*! \file sercomm.h + * Osmocom Sercomm HDLC (de)multiplex. + */ + #ifndef _SERCOMM_H #define _SERCOMM_H @@ -5,11 +9,7 @@ /*! \defgroup sercomm Seriall Communications (HDLC) * @{ - */ - -/*! \file sercomm.h - * Osmocom Sercomm HDLC (de)multiplex - */ + * \file sercomm.h */ /*! A low sercomm_dlci means high priority. A high DLCI means low priority */ enum sercomm_dlci { diff --git a/include/osmocom/core/serial.h b/include/osmocom/core/serial.h index e3f7a9f..39614a4 100644 --- a/include/osmocom/core/serial.h +++ b/include/osmocom/core/serial.h @@ -1,6 +1,6 @@ +/*! \file serial.h + * Osmocom serial port helpers. */ /* - * serial.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -22,11 +22,7 @@ /*! \defgroup serial Utility functions to deal with serial ports * @{ - */ - -/*! \file serial.h - * Osmocom serial port helpers - */ + * \file serial.h */ #pragma once diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index d7132f9..ae78f15 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -4,8 +4,7 @@ /*! \defgroup signal Intra-application signals * @{ - */ -/*! \file signal.h */ + * \file signal.h */ /*! subsystem signaling numbers: we split the numberspace for * applications and libraries: from 0 to UINT_MAX/2 for applications, diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index d6a5662..d2118ef 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -1,12 +1,11 @@ +/*! \file socket.h + * Osmocom socket convenience functions. */ + #pragma once /*! \defgroup socket Socket convenience functions * @{ - */ - -/*! \file socket.h - * Osmocom socket convenience functions - */ + * \file socket.h */ #include diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 957918a..4cee8a8 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -2,9 +2,7 @@ /*! \defgroup osmo_stat_item Statistics value item * @{ - */ - -/*! \file stat_item.h */ + * \file stat_item.h */ #include diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 09b836a..161b34c 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -1,4 +1,6 @@ -/* (C) 2015 by Sysmocom s.f.m.c. GmbH +/*! \file stats.h */ +/* + * (C) 2015 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved * diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h index 2b4d89f..b87239d 100644 --- a/include/osmocom/core/strrb.h +++ b/include/osmocom/core/strrb.h @@ -1,6 +1,7 @@ -#pragma once - -/* (C) 2012-2013 by Katerina Barone-Adesi +/*! \file strrb.h + * Osmocom string ringbuffer handling routines. */ +/* + * (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -19,13 +20,11 @@ * */ +#pragma once + /*! \defgroup osmo_strrb Osmocom ringbuffers for log strings * @{ - */ - -/*! \file strrb.h - * Osmocom string ringbuffer handling routines - */ + * \file strrb.h */ #include #include diff --git a/include/osmocom/core/talloc.h b/include/osmocom/core/talloc.h index df7ea7f..191a463 100644 --- a/include/osmocom/core/talloc.h +++ b/include/osmocom/core/talloc.h @@ -1,4 +1,5 @@ -/* Convenience wrapper. libosmocore used to ship its own internal copy of +/*! \file talloc.h + * Convenience wrapper. libosmocore used to ship its own internal copy of * talloc, before libtalloc became a standard component on most systems */ #pragma once #include diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index a039ac8..40b39b9 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -1,3 +1,5 @@ +/*! \file timer.h + * Osmocom timer handling routines. */ /* * (C) 2008, 2009 by Holger Hans Peter Freyther * All Rights Reserved @@ -33,11 +35,7 @@ * - osmo_timers_update() will call the callbacks and * remove the timers. * @{ - */ - -/*! \file timer.h - * Osmocom timer handling routines. - */ + * \file timer.h */ #pragma once diff --git a/include/osmocom/core/timer_compat.h b/include/osmocom/core/timer_compat.h index 44259af..77d4ce0 100644 --- a/include/osmocom/core/timer_compat.h +++ b/include/osmocom/core/timer_compat.h @@ -1,3 +1,6 @@ +/*! \file timer_compat.h + * Compatibility header with some helpers + */ /* * (C) 2011 Sylvain Munaut * All Rights Reserved @@ -20,11 +23,7 @@ /*! \defgroup timer Osmocom timers * @{ - */ - -/*! \file timer_compat.h - * Compatibility header with some helpers - */ + * \file timer_compat.h */ #pragma once diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index ce49cbe..855e653 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -5,9 +5,7 @@ /*! \defgroup utils General-purpose utility functions * @{ - */ - -/*! \file utils.h */ + * \file utils.h */ /*! Determine number of elements in an array of static size */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/include/osmocom/core/write_queue.h b/include/osmocom/core/write_queue.h index 27d090d..2303f87 100644 --- a/include/osmocom/core/write_queue.h +++ b/include/osmocom/core/write_queue.h @@ -1,4 +1,5 @@ -/* Generic write queue implementation */ +/*! \file write_queue.h + * Generic write queue implementation */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves @@ -24,10 +25,7 @@ /*! \defgroup write_queue Osmocom msgb write queues * @{ - */ - -/*! \file write_queue.h - */ + * \file write_queue.h */ #include #include diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index af4ae15..2f88a3a 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -2,9 +2,7 @@ /*! \addtogroup auth * @{ - */ - -/*! \file auth.h */ + * \file auth.h */ #include diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index c302f10..20f0514 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -1,3 +1,5 @@ +/*! \file gprs_cipher.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 3cef9d8..77532e6 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -1,3 +1,5 @@ +/*! \file control_cmd.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h index 4cd3369..6e49742 100644 --- a/include/osmocom/ctrl/control_if.h +++ b/include/osmocom/ctrl/control_if.h @@ -1,3 +1,5 @@ +/*! \file control_if.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_vty.h b/include/osmocom/ctrl/control_vty.h index d0ef69f..af9ee99 100644 --- a/include/osmocom/ctrl/control_vty.h +++ b/include/osmocom/ctrl/control_vty.h @@ -1,3 +1,5 @@ +/*! \file control_vty.h */ + #pragma once /* Add the 'ctrl' section to VTY, containing the 'bind' command. */ diff --git a/include/osmocom/ctrl/ports.h b/include/osmocom/ctrl/ports.h index d28066e..f974daf 100644 --- a/include/osmocom/ctrl/ports.h +++ b/include/osmocom/ctrl/ports.h @@ -1,6 +1,4 @@ -#pragma once - -/* +/*! \file ports.h * TCP port numbers used for CTRL interfaces in osmocom projects. See also the * osmocom wiki as well as the osmo-gsm-manuals, which should all be kept in * sync with this file: @@ -8,6 +6,8 @@ * https://git.osmocom.org/osmo-gsm-manuals/tree/common/chapters/port_numbers.adoc */ +#pragma once + #define OSMO_CTRL_PORT_BTS 4238 #define OSMO_CTRL_PORT_NITB_BSC 4249 #define OSMO_CTRL_PORT_BSC_NAT 4250 diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index 0e9f7d6..2dead69 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -1,3 +1,5 @@ +/*! \file gprs_bssgp.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index d79b210..9374e73 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -1,11 +1,7 @@ -#pragma once - -#include -#include - -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2012 by Harald Welte +/*! \file gprs_bssgp_bss.h + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ +/* + * (C) 2009-2012 by Harald Welte * * All Rights Reserved * @@ -24,6 +20,10 @@ * */ +#pragma once + +#include +#include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); diff --git a/include/osmocom/gprs/gprs_msgb.h b/include/osmocom/gprs/gprs_msgb.h index 9ccc9a5..43471e2 100644 --- a/include/osmocom/gprs/gprs_msgb.h +++ b/include/osmocom/gprs/gprs_msgb.h @@ -1,3 +1,5 @@ +/*! \file gprs_msgb.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 5ecaed8..938ad99 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -1,3 +1,5 @@ +/*! \file gprs_ns.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_ns_frgre.h b/include/osmocom/gprs/gprs_ns_frgre.h index 72ef7d1..d48ce08 100644 --- a/include/osmocom/gprs/gprs_ns_frgre.h +++ b/include/osmocom/gprs/gprs_ns_frgre.h @@ -1,3 +1,5 @@ +/*! \file gprs_ns_frgre.h */ + #pragma once int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg); diff --git a/include/osmocom/gprs/gprs_rlc.h b/include/osmocom/gprs/gprs_rlc.h index 5765281..05d3de6 100644 --- a/include/osmocom/gprs/gprs_rlc.h +++ b/include/osmocom/gprs/gprs_rlc.h @@ -1,3 +1,5 @@ +/*! \file gprs_rlc.h */ + #pragma once #include diff --git a/include/osmocom/gprs/protocol/gsm_04_60.h b/include/osmocom/gprs/protocol/gsm_04_60.h index 42028bd..96e9ab7 100644 --- a/include/osmocom/gprs/protocol/gsm_04_60.h +++ b/include/osmocom/gprs/protocol/gsm_04_60.h @@ -1,10 +1,11 @@ -#pragma once - -/* General Packet Radio Service (GPRS) +/*! \file gsm_04_60.h + * General Packet Radio Service (GPRS). * Radio Link Control / Medium Access Control (RLC/MAC) protocol * 3GPP TS 04.60 version 8.27.0 Release 1999 */ +#pragma once + #include #if OSMO_IS_LITTLE_ENDIAN == 1 diff --git a/include/osmocom/gprs/protocol/gsm_08_16.h b/include/osmocom/gprs/protocol/gsm_08_16.h index c3dbe69..fc74336 100644 --- a/include/osmocom/gprs/protocol/gsm_08_16.h +++ b/include/osmocom/gprs/protocol/gsm_08_16.h @@ -1,16 +1,15 @@ -#pragma once - -/* GPRS Networks Service (NS) messages on the Gb interface +/*! \file gsm_08_16.h + * GPRS Networks Service (NS) messages on the Gb interface. * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * 3GPP TS 48.016 version 6.5.0 Release 6 / ETSI TS 148 016 V6.5.0 (2005-11) */ + +#pragma once #include /*! \addtogroup libgb * @{ - */ - -/*! \file gprs_ns.h */ + * \file gprs_ns.h */ /*! Common header of GPRS NS */ struct gprs_ns_hdr { diff --git a/include/osmocom/gprs/protocol/gsm_08_18.h b/include/osmocom/gprs/protocol/gsm_08_18.h index 8bc9a8e..3179455 100644 --- a/include/osmocom/gprs/protocol/gsm_08_18.h +++ b/include/osmocom/gprs/protocol/gsm_08_18.h @@ -1,3 +1,5 @@ +/*! \file gsm_08_18.h */ + #pragma once #include diff --git a/include/osmocom/gsm/a5.h b/include/osmocom/gsm/a5.h index 893fb02..fae3fdd 100644 --- a/include/osmocom/gsm/a5.h +++ b/include/osmocom/gsm/a5.h @@ -1,6 +1,6 @@ +/*! \file gsm/a5.h + * Osmocom GSM A5 ciphering algorithm header. */ /* - * a5.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -29,11 +29,7 @@ /*! \defgroup a5 GSM A5 ciphering algorithm * @{ - */ - -/*! \file gsm/a5.h - * Osmocom GSM A5 ciphering algorithm header - */ + * \file a5.h */ /*! Converts a frame number into the 22 bit number used in A5/x * \param[in] fn The true framenumber diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index acddb7f..e031ee1 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -1,14 +1,12 @@ #pragma once -/*! \defgroup oml A-bis OML - * @{ - */ - #include #include #include -/*! \file abis_nm.h */ +/*! \defgroup oml A-bis OML + * @{ + * \file abis_nm.h */ extern const char abis_nm_ipa_magic[13]; extern const char abis_nm_osmo_magic[12]; diff --git a/include/osmocom/gsm/apn.h b/include/osmocom/gsm/apn.h index b4ece3a..8d35324 100644 --- a/include/osmocom/gsm/apn.h +++ b/include/osmocom/gsm/apn.h @@ -1,3 +1,5 @@ +/*! \file apn.h */ + #pragma once #include diff --git a/include/osmocom/gsm/bitvec_gsm.h b/include/osmocom/gsm/bitvec_gsm.h index 20741ef..32f0cd2 100644 --- a/include/osmocom/gsm/bitvec_gsm.h +++ b/include/osmocom/gsm/bitvec_gsm.h @@ -5,8 +5,7 @@ /*! \defgroup bitvec helpers for GSM * @{ - */ -/*! \file bitvec_gsm.h */ + * \file bitvec_gsm.h */ void bitvec_add_range1024(struct bitvec *bv, const struct gsm48_range_1024 *r); diff --git a/include/osmocom/gsm/comp128.h b/include/osmocom/gsm/comp128.h index 8ff76b1..8626f4b 100644 --- a/include/osmocom/gsm/comp128.h +++ b/include/osmocom/gsm/comp128.h @@ -1,5 +1,5 @@ -/* - * COMP128 header +/*! \file comp128.h + * COMP128 header. * * See comp128.c for details */ diff --git a/include/osmocom/gsm/comp128v23.h b/include/osmocom/gsm/comp128v23.h index 31d3933..affe8a2 100644 --- a/include/osmocom/gsm/comp128v23.h +++ b/include/osmocom/gsm/comp128v23.h @@ -1,5 +1,5 @@ -/* - * COMP128v23 header +/*! \file comp128v23.h + * COMP128v23 header. * * See comp128v23.c for details */ diff --git a/include/osmocom/gsm/gan.h b/include/osmocom/gsm/gan.h index 6f2b535..efede1d 100644 --- a/include/osmocom/gsm/gan.h +++ b/include/osmocom/gsm/gan.h @@ -1,3 +1,5 @@ +/*! \file gan.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gea.h b/include/osmocom/gsm/gea.h index 3051101..5c23d2a 100644 --- a/include/osmocom/gsm/gea.h +++ b/include/osmocom/gsm/gea.h @@ -1,5 +1,5 @@ -/* - * GEA3 header +/*! \file gea.h + * GEA3 header. * * See gea.c for details */ diff --git a/include/osmocom/gsm/gsm0341.h b/include/osmocom/gsm/gsm0341.h index 29ba3e1..2fc83e4 100644 --- a/include/osmocom/gsm/gsm0341.h +++ b/include/osmocom/gsm/gsm0341.h @@ -1,3 +1,5 @@ +/*! \file gsm0341.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 89964fa..0cd1f94 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_smc.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index bc908a7..19f9c5d 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_smr.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h index 7005010..1c51111 100644 --- a/include/osmocom/gsm/gsm0411_utils.h +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_utils.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 6ca23e9..672ffe5 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -1,3 +1,5 @@ +/*! \file gsm0480.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h index 6ee5a60..fe5cf7e 100644 --- a/include/osmocom/gsm/gsm0502.h +++ b/include/osmocom/gsm/gsm0502.h @@ -1,3 +1,5 @@ +/*! \file gsm0502.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 9be229c..4369cab 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -1,4 +1,6 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther +/*! \file gsm0808.h */ +/* + * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves * All Rights Reserved * diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 0937630..57ba171 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -1,4 +1,6 @@ -/* (C) 2016 by Sysmocom s.f.m.c. GmbH +/*! \file gsm0808_utils.h */ +/* + * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Philipp Maier diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 29e646c..2bc7583 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -1,4 +1,7 @@ +/*! \file gsm23003.h */ + #pragma once + #include /* 23.003 Chapter 12.1 */ diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 6a52c2d..424748e 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -1,3 +1,5 @@ +/*! \file gsm48.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h index 8445486..f7cc24e 100644 --- a/include/osmocom/gsm/gsm48_ie.h +++ b/include/osmocom/gsm/gsm48_ie.h @@ -1,3 +1,5 @@ +/*! \file gsm48_ie.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index e76d9ee..998f681 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -1,4 +1,5 @@ -/* GSM utility functions, e.g. coding and decoding */ +/*! \file gsm_utils.h + * GSM utility functions, e.g. coding and decoding. */ /* * (C) 2008 by Daniel Willmann * (C) 2009 by Holger Hans Peter Freyther diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 04b31d0..886ea5d 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -1,6 +1,7 @@ -/* Osmocom Generic Subscriber Update Protocol message encoder/decoder */ - -/* (C) 2014 by sysmocom s.f.m.c. GmbH, Author: Jacob Erlbeck +/*! \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 * All Rights Reserved * diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index cabee13..7e1d723 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -1,3 +1,5 @@ +/*! \file ipa.h */ + #pragma once #include diff --git a/include/osmocom/gsm/kasumi.h b/include/osmocom/gsm/kasumi.h index 222aece..d9de10b 100644 --- a/include/osmocom/gsm/kasumi.h +++ b/include/osmocom/gsm/kasumi.h @@ -1,5 +1,5 @@ -/* - * KASUMI header +/*! \file kasumi.h + * KASUMI header. * * See kasumi.c for details * The parameters are described in TS 135 202. diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 322c7ec..01f61ce 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -1,3 +1,5 @@ +/*! \file l1sap.h */ + #pragma once #include diff --git a/include/osmocom/gsm/lapd_core.h b/include/osmocom/gsm/lapd_core.h index 8d3a0f8..cfc357a 100644 --- a/include/osmocom/gsm/lapd_core.h +++ b/include/osmocom/gsm/lapd_core.h @@ -1,3 +1,6 @@ +/*! \file lapd_core.h + * primitive related stuff + */ #pragma once #include @@ -8,10 +11,7 @@ /*! \defgroup lapd LAPD implementation common part * @{ - */ - -/*! \file lapd_core.h - * primitive related stuff + * \file lapd_core.h */ /*! LAPD related primitives (L2<->L3 SAP)*/ diff --git a/include/osmocom/gsm/lapdm.h b/include/osmocom/gsm/lapdm.h index ec14cdd..e01d065 100644 --- a/include/osmocom/gsm/lapdm.h +++ b/include/osmocom/gsm/lapdm.h @@ -5,9 +5,7 @@ /*! \defgroup lapdm LAPDm implementation according to GSM TS 04.06 * @{ - */ - -/*! \file lapdm.h */ + * \file lapdm.h */ /*! LAPDm mode/role */ enum lapdm_mode { diff --git a/include/osmocom/gsm/meas_rep.h b/include/osmocom/gsm/meas_rep.h index 90c981d..79f9f06 100644 --- a/include/osmocom/gsm/meas_rep.h +++ b/include/osmocom/gsm/meas_rep.h @@ -1,3 +1,5 @@ +/*! \file meas_rep.h */ + #pragma once #include diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index 171db7a..f2450d9 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -1,3 +1,5 @@ +/*! \file mncc.h */ + #pragma once #include diff --git a/include/osmocom/gsm/oap.h b/include/osmocom/gsm/oap.h index fba22c7..ef83b79 100644 --- a/include/osmocom/gsm/oap.h +++ b/include/osmocom/gsm/oap.h @@ -1,6 +1,7 @@ -/* Osmocom Authentication Protocol message encoder/decoder */ - -/* (C) 2015-2016 by sysmocom s.f.m.c. GmbH +/*! \file oap.h + * Osmocom Authentication Protocol message encoder/decoder. */ +/* + * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Neels Hofmeyr diff --git a/include/osmocom/gsm/prim.h b/include/osmocom/gsm/prim.h index 5f61dc7..386b7d8 100644 --- a/include/osmocom/gsm/prim.h +++ b/include/osmocom/gsm/prim.h @@ -1,3 +1,5 @@ +/*! \file prim.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_03_40.h b/include/osmocom/gsm/protocol/gsm_03_40.h index 32d5c2c..a65203f 100644 --- a/include/osmocom/gsm/protocol/gsm_03_40.h +++ b/include/osmocom/gsm/protocol/gsm_03_40.h @@ -1,6 +1,7 @@ -#pragma once +/*! \file gsm_03_40.h + * GSM TS 03.40. */ -/* GSM TS 03.40 */ +#pragma once /** * 9.1.2.5 Type Of Number diff --git a/include/osmocom/gsm/protocol/gsm_03_41.h b/include/osmocom/gsm/protocol/gsm_03_41.h index 40051cd..2e0ad69 100644 --- a/include/osmocom/gsm/protocol/gsm_03_41.h +++ b/include/osmocom/gsm/protocol/gsm_03_41.h @@ -1,3 +1,6 @@ +/*! \file gsm_03_41.h + * GSM TS 03.41 definitions also TS 23.041. */ + #pragma once #include @@ -8,8 +11,6 @@ #ifndef OSMO_IS_LITTLE_ENDIAN #define OSMO_IS_LITTLE_ENDIAN 0 #endif - -/* GSM TS 03.41 definitions also TS 23.041*/ #define GSM341_MAX_PAYLOAD (GSM412_MSG_LEN-sizeof(struct gsm341_ms_message)) #define GSM341_MAX_CHARS (GSM341_MAX_PAYLOAD*8/7) diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 90b6cf1..643f046 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1,3 +1,6 @@ +/*! \file gsm_04_08.h + * GSM TS 04.08 definitions. */ + #pragma once #include @@ -6,7 +9,6 @@ #include #include -/* GSM TS 04.08 definitions */ struct gsm_lchan; /* Chapter 10.5.1.5 */ diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index def8dfc..13820a7 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_08_gprs.h */ + #ifndef _GSM48_GPRS_H #define _GSM48_GPRS_H diff --git a/include/osmocom/gsm/protocol/gsm_04_11.h b/include/osmocom/gsm/protocol/gsm_04_11.h index 651adca..31f25ac 100644 --- a/include/osmocom/gsm/protocol/gsm_04_11.h +++ b/include/osmocom/gsm/protocol/gsm_04_11.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_11.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_04_12.h b/include/osmocom/gsm/protocol/gsm_04_12.h index 30d6e4f..826e69b 100644 --- a/include/osmocom/gsm/protocol/gsm_04_12.h +++ b/include/osmocom/gsm/protocol/gsm_04_12.h @@ -1,8 +1,9 @@ +/*! \file gsm_04_12.h + * GSM TS 04.12 definitions for Short Message Service Cell Broadcast. */ + #pragma once #include - -/* GSM TS 04.12 definitions for Short Message Service Cell Broadcast */ #define GSM412_MSG_LEN 88 /* TS 04.12 Section 3.1 */ #define GSM412_BLOCK_LEN 22 /* TS 04.12 Section 3.1 */ diff --git a/include/osmocom/gsm/protocol/gsm_04_14.h b/include/osmocom/gsm/protocol/gsm_04_14.h index 421b56f..6f7d92c 100644 --- a/include/osmocom/gsm/protocol/gsm_04_14.h +++ b/include/osmocom/gsm/protocol/gsm_04_14.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_14.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_04_80.h b/include/osmocom/gsm/protocol/gsm_04_80.h index 2aebb46..e204c50 100644 --- a/include/osmocom/gsm/protocol/gsm_04_80.h +++ b/include/osmocom/gsm/protocol/gsm_04_80.h @@ -1,6 +1,7 @@ -#pragma once +/*! \file gsm_04_80.h + * GSM TS 04.80 definitions (Supplementary Services Specification, Formats and Coding). */ -/* GSM TS 04.80 definitions (Supplementary Services Specification, Formats and Coding) */ +#pragma once /* Section 3.4 */ #define GSM0480_MTYPE_RELEASE_COMPLETE 0x2A diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index c76cf3b..bc70b93 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -1,9 +1,8 @@ -#pragma once - -/* GSM Radio Signalling Link messages on the A-bis interface +/*! \file gsm_08_58.h + * GSM Radio Signalling Link messages on the A-bis interface. * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ - -/* (C) 2008 by Harald Welte +/* + * (C) 2008 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -22,13 +21,13 @@ * */ +#pragma once + #include /*! \addtogroup rsl * @{ - */ - -/*! \file gsm_08_58.h */ + * \file gsm_08_58.h */ /*! RSL common header */ struct abis_rsl_common_hdr { diff --git a/include/osmocom/gsm/protocol/gsm_09_02.h b/include/osmocom/gsm/protocol/gsm_09_02.h index 3f68b45..0b54fb7 100644 --- a/include/osmocom/gsm/protocol/gsm_09_02.h +++ b/include/osmocom/gsm/protocol/gsm_09_02.h @@ -1,7 +1,8 @@ +/*! \file gsm_09_02.h + * GSM TS 09.02 definitions (MAP). */ + #ifndef PROTO_GSM_09_02_H #define PROTO_GSM_09_02_H - -/* GSM TS 09.02 definitions (MAP) */ /* Section 17.7.4 */ /* SS-Status */ diff --git a/include/osmocom/gsm/protocol/gsm_12_21.h b/include/osmocom/gsm/protocol/gsm_12_21.h index 1bdee9c..3ef3603 100644 --- a/include/osmocom/gsm/protocol/gsm_12_21.h +++ b/include/osmocom/gsm/protocol/gsm_12_21.h @@ -1,9 +1,5 @@ -#pragma once - -/* GSM Network Management messages on the A-bis interface - * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ - -/* (C) 2008-2009 by Harald Welte +/* + * (C) 2008-2009 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -22,11 +18,11 @@ * */ +#pragma once + /*! \addtogroup oml * @{ - */ - -/*! \file gsm_12_21.h */ + * \file gsm_12_21.h */ #include #include diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index a2109b6..94243fe 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -1,3 +1,5 @@ +/*! \file gsm_23_003.h */ + #pragma once /* Chapter 2.2 */ diff --git a/include/osmocom/gsm/protocol/gsm_44_318.h b/include/osmocom/gsm/protocol/gsm_44_318.h index 5d7f878..76e8396 100644 --- a/include/osmocom/gsm/protocol/gsm_44_318.h +++ b/include/osmocom/gsm/protocol/gsm_44_318.h @@ -1,8 +1,9 @@ +/*! \file gsm_44_318.h + * Definitions according to 3GPP TS 44.318 6.8.0 Release 6. */ + #pragma once #include - -/* Definitions according to 3GPP TS 44.318 6.8.0 Release 6 */ /* Table 11.1.1.2.1: Protocol Discriminator */ enum gan_pdisc { diff --git a/include/osmocom/gsm/protocol/ipaccess.h b/include/osmocom/gsm/protocol/ipaccess.h index ba6cb3b..0f5d54f 100644 --- a/include/osmocom/gsm/protocol/ipaccess.h +++ b/include/osmocom/gsm/protocol/ipaccess.h @@ -1,3 +1,5 @@ +/*! \file ipaccess.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/smpp34_osmocom.h b/include/osmocom/gsm/protocol/smpp34_osmocom.h index cff6adb..7c72ac8 100644 --- a/include/osmocom/gsm/protocol/smpp34_osmocom.h +++ b/include/osmocom/gsm/protocol/smpp34_osmocom.h @@ -1,5 +1,7 @@ +/*! \file smpp34_osmocom.h + * Osmocom SMPP extensions. */ + #pragma once -/* Osmocom SMPP extensions */ /* Osmocom specific new TLV definitions */ diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 93e27a1..3d9c66f 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -7,9 +7,7 @@ /*! \defgroup rsl RSL * @{ - */ - -/*! \file rsl.h */ + * \file rsl.h */ void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type); diff --git a/include/osmocom/gsm/rxlev_stat.h b/include/osmocom/gsm/rxlev_stat.h index 7183b17..7aa35cd 100644 --- a/include/osmocom/gsm/rxlev_stat.h +++ b/include/osmocom/gsm/rxlev_stat.h @@ -1,3 +1,5 @@ +/*! \file rxlev_stat.h */ + #pragma once #define NUM_RXLEVS 32 diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index f3e0f22..8e26f99 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -1,3 +1,5 @@ +/*! \file sysinfo.h */ + #pragma once #include diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index fa3b656..c356840 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -9,8 +9,7 @@ /*! \defgroup tlv GSM L3 compatible TLV parser * @{ - */ -/*! \file tlv.h */ + * \file tlv.h */ /* Terminology / wording tag length value (in bits) diff --git a/include/osmocom/sim/class_tables.h b/include/osmocom/sim/class_tables.h index ad89d94..d5be39d 100644 --- a/include/osmocom/sim/class_tables.h +++ b/include/osmocom/sim/class_tables.h @@ -1,7 +1,6 @@ -#pragma once - -/* simtrace - tables determining APDU case for card emulation - * +/*! \file class_tables.h + * simtrace - tables determining APDU case for card emulation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -18,6 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#pragma once + #include struct osim_cla_ins_case { diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h index eb95480..680cad1 100644 --- a/include/osmocom/sim/sim.h +++ b/include/osmocom/sim/sim.h @@ -1,3 +1,7 @@ +/*! \file sim.h + * Routines for helping with SIM (ISO/IEC 7816-4 more generally) communication. + */ + #ifndef _OSMOCOM_SIM_H #define _OSMOCOM_SIM_H @@ -5,11 +9,6 @@ #include #define APDU_HDR_LEN 5 - -/*! - * \file sim.h - * Routines for helping with SIM (ISO/IEC 7816-4 more generally) communication. - */ /*! command-response pairs cases * diff --git a/include/osmocom/vty/buffer.h b/include/osmocom/vty/buffer.h index 56c28f0..b5cce8a 100644 --- a/include/osmocom/vty/buffer.h +++ b/include/osmocom/vty/buffer.h @@ -1,5 +1,6 @@ +/*! \file buffer.h + * Buffering to output and input. */ /* - * Buffering to output and input. * Copyright (C) 1998 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 9a072d7..0fa5175 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -1,5 +1,6 @@ +/*! \file command.h + * Zebra configuration command interface routine. */ /* - * Zebra configuration command interface routine * Copyright (C) 1997, 98 Kunihiro Ishiguro * * This file is part of GNU Zebra. @@ -28,8 +29,7 @@ /*! \defgroup command VTY Command * @{ - */ -/*! \file command.h */ + * \file command.h */ /*! Host configuration variable */ struct host { diff --git a/include/osmocom/vty/logging.h b/include/osmocom/vty/logging.h index 544d117..9bafb98 100644 --- a/include/osmocom/vty/logging.h +++ b/include/osmocom/vty/logging.h @@ -1,3 +1,5 @@ +/*! \file logging.h */ + #pragma once #define LOGGING_STR "Configure log message to this terminal\n" diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index b3fb644..545955c 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -1,3 +1,5 @@ +/*! \file misc.h */ + #pragma once #include diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index a6043b3..8f8ef75 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -1,6 +1,4 @@ -#pragma once - -/* +/*! \file ports.h * TCP port numbers used for VTY interfaces in osmocom projects. See also the * osmocom wiki as well as the osmo-gsm-manuals, which should all be kept in * sync with this file: @@ -8,6 +6,8 @@ * https://git.osmocom.org/osmo-gsm-manuals/tree/common/chapters/port_numbers.adoc */ +#pragma once + /* 4238 used by osmo-bts control interface */ #define OSMO_VTY_PORT_STP 4239 #define OSMO_VTY_PORT_PCU 4240 /* also: osmo_pcap_client */ diff --git a/include/osmocom/vty/stats.h b/include/osmocom/vty/stats.h index 3851b4d..7629928 100644 --- a/include/osmocom/vty/stats.h +++ b/include/osmocom/vty/stats.h @@ -1,3 +1,5 @@ +/*! \file stats.h */ + #pragma once void osmo_stats_vty_add_cmds(); diff --git a/include/osmocom/vty/telnet_interface.h b/include/osmocom/vty/telnet_interface.h index bca9156..d653466 100644 --- a/include/osmocom/vty/telnet_interface.h +++ b/include/osmocom/vty/telnet_interface.h @@ -1,5 +1,7 @@ -/* minimalistic telnet/network interface it might turn into a wire interface */ -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file telnet_interface.h + * minimalistic telnet/network interface it might turn into a wire interface */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -27,9 +29,7 @@ /*! \defgroup telnet_interface Telnet Interface * @{ - */ - -/*! \file telnet_interface.h */ + * \file telnet_interface.h */ /*! A telnet connection */ struct telnet_connection { diff --git a/include/osmocom/vty/vector.h b/include/osmocom/vty/vector.h index c00804d..0a639ad 100644 --- a/include/osmocom/vty/vector.h +++ b/include/osmocom/vty/vector.h @@ -1,5 +1,6 @@ +/*! \file vector.h + * Generic vector interface header. */ /* - * Generic vector interface header. * Copyright (C) 1997, 98 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index d59f5d4..544e1fa 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -5,8 +5,7 @@ /*! \defgroup vty VTY (Virtual TTY) interface * @{ - */ -/*! \file vty.h */ + * \file vty.h */ /* GCC have printf type attribute check. */ #ifdef __GNUC__ diff --git a/src/application.c b/src/application.c index e7c8e0f..aec3fd7 100644 --- a/src/application.c +++ b/src/application.c @@ -1,4 +1,5 @@ -/* Utility functions to setup applications */ +/*! \file application.c + * Routines for helping with the osmocom application setup. */ /* * (C) 2010 by Harald Welte * (C) 2011 by Holger Hans Peter Freyther @@ -19,10 +20,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - */ - -/*! \file application.c - * Routines for helping with the osmocom application setup. */ /*! \mainpage libosmocore Documentation diff --git a/src/backtrace.c b/src/backtrace.c index 0240a75..5ce7482 100644 --- a/src/backtrace.c +++ b/src/backtrace.c @@ -1,3 +1,5 @@ +/*! \file backtrace.c + * Routines related to generating call back traces. */ /* * (C) 2009 by Holger Hans Peter Freyther * (C) 2012 by Harald Welte @@ -18,10 +20,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - */ - -/*! \file backtrace.c - * Routines realted to generating call back traces */ #include diff --git a/src/bitcomp.c b/src/bitcomp.c index acf165e..94f60eb 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -1,6 +1,7 @@ -/* bit compression routines */ - -/* (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev +/*! \file bitcomp.c + * Osmocom bit compression routines */ +/* + * (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev * * All Rights Reserved * @@ -22,11 +23,7 @@ /*! \defgroup bitcomp Bit compression * @{ - */ - -/*! \file bitcomp.c - * Osmocom bit compression routines - */ + * \file bitcomp.c */ #include #include diff --git a/src/bits.c b/src/bits.c index 45ac8e2..af09441 100644 --- a/src/bits.c +++ b/src/bits.c @@ -26,11 +26,9 @@ /*! \addtogroup bits * @{ - * Osmocom bit level support code - */ - -/*! \file bits.c */ - + * Osmocom bit level support code. + * + * \file bits.c */ /*! convert unpacked bits to packed bits, return length in bytes * \param[out] out output buffer of packed bits diff --git a/src/bitvec.c b/src/bitvec.c index 8ed7296..f07b42c 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -1,5 +1,3 @@ -/* bit vector utility routines */ - /* (C) 2009 by Harald Welte * (C) 2012 Ivan Klyuchnikov * (C) 2015 by Sysmocom s.f.m.c. GmbH @@ -24,10 +22,17 @@ /*! \addtogroup bitvec * @{ - * Osmocom bit vector abstraction - */ - -/*! \file bitvec.c */ + * Osmocom bit vector abstraction utility routines. + * + * These functions assume a MSB (most significant bit) first layout of the + * bits, so that for instance the 5 bit number abcde (a is MSB) can be + * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count + * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). + * Note that there are other incompatible encodings, like it is used + * for the EGPRS RLC data block headers (there the bits are numbered from LSB + * to MSB). + * + * \file bitvec.c */ #include #include diff --git a/src/codec/gsm610.c b/src/codec/gsm610.c index df56583..d5a2110 100644 --- a/src/codec/gsm610.c +++ b/src/codec/gsm610.c @@ -1,5 +1,5 @@ -/* GSM 06.10 - GSM FR codec */ - +/*! \file gsm610.c + * GSM 06.10 - GSM FR codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c index 3064748..b1a0b31 100644 --- a/src/codec/gsm620.c +++ b/src/codec/gsm620.c @@ -1,5 +1,5 @@ -/* GSM 06.20 - GSM HR codec */ - +/*! \file gsm620.c + * GSM 06.20 - GSM HR codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm660.c b/src/codec/gsm660.c index 6c9215f..2f5c6a2 100644 --- a/src/codec/gsm660.c +++ b/src/codec/gsm660.c @@ -1,5 +1,5 @@ -/* GSM 06.60 - GSM EFR Codec */ - +/*! \file gsm660.c + * GSM 06.60 - GSM EFR Codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c index 74655bf..1ee74d0 100644 --- a/src/codec/gsm690.c +++ b/src/codec/gsm690.c @@ -1,5 +1,5 @@ -/* GSM 06.90 - GSM AMR Codec */ - +/*! \file gsm690.c + * GSM 06.90 - GSM AMR Codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index bb86b2c..5213dc5 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -100,9 +100,8 @@ * various other modules (mapping, parity, interleaving) in order to * implement the complete channel coding (and decoding) chain for the * various channel types as defined in TS 05.03 / 45.003. - */ - -/*! \file gsm0503_coding.c */ + * + * \file gsm0503_coding.c */ /* * EGPRS coding limits diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 19e6847..b42f242 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -29,16 +29,12 @@ /*! \addtogroup interleaving * @{ - * GSM TS 05.03 interleaving + * GSM TS 05.03 interleaving * - * This module contains interleaving / de-interleaving routines for - * various channel types, as defined in 3GPP TS 05.03 / 45.003 - */ - -/*! \file gsm0503_interleaving.c */ - -/* - * GSM xCCH interleaving and burst mapping + * This module contains interleaving / de-interleaving routines for + * various channel types, as defined in 3GPP TS 05.03 / 45.003. + * + * GSM xCCH interleaving and burst mapping: * * Interleaving: * @@ -57,7 +53,30 @@ * e(B, 58) = h_n(B) * * Where hl(B) and hn(B) are bits in burst B indicating flags. - */ + * + * GSM TCH HR/AHS interleaving and burst mapping: + * + * Interleaving: + * + * Given 288 coded input bits, form 4 blocks of 114 bits, + * where even bits of the first 2 blocks and odd bits of the last 2 blocks + * are used: + * + * i(B, j) = c(n, k) k = 0, ..., 227 + * n = 0, ..., N, N + 1, ... + * B = B_0 + 2n + b + * j, b = table[k]; + * + * Mapping on Burst: + * + * e(B, j) = i(B, j) + * e(B, 59 + j) = i(B, 57 + j) j = 0, ..., 56 + * e(B, 57) = h_l(B) + * e(B, 58) = h_n(B) + * + * Where hl(B) and hn(B) are bits in burst B indicating flags. + * + * \file gsm0503_interleaving.c */ /*! De-Interleave burst bits according to TS 05.03 4.1.4 * \param[out] cB caller-allocated output buffer for 456 soft coded bits @@ -632,30 +651,6 @@ iB[B * 114 + j] = cB[k]; } } - -/* - * GSM TCH HR/AHS interleaving and burst mapping - * - * Interleaving: - * - * Given 288 coded input bits, form 4 blocks of 114 bits, - * where even bits of the first 2 blocks and odd bits of the last 2 blocks - * are used: - * - * i(B, j) = c(n, k) k = 0, ..., 227 - * n = 0, ..., N, N + 1, ... - * B = B_0 + 2n + b - * j, b = table[k]; - * - * Mapping on Burst: - * - * e(B, j) = i(B, j) - * e(B, 59 + j) = i(B, 57 + j) j = 0, ..., 56 - * e(B, 57) = h_l(B) - * e(B, 58) = h_n(B) - * - * Where hl(B) and hn(B) are bits in burst B indicating flags. - */ /*! GSM TCH HR/AHS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 228 unpacked output bits diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 15fd1b6..d414769 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -32,9 +32,8 @@ * * This module contains burst mapping routines as specified in 3GPP TS * 05.03 / 45.003. - */ - -/*! \file gsm0503_mapping.c */ + * + * \file gsm0503_mapping.c */ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn) diff --git a/src/coding/gsm0503_parity.c b/src/coding/gsm0503_parity.c index cc81702..b57caa3 100644 --- a/src/coding/gsm0503_parity.c +++ b/src/coding/gsm0503_parity.c @@ -31,9 +31,8 @@ * * This module contains parity/crc code definitions for the various * parity/crc schemes as defined in 3GPP TS 05.03 / 45.003 - */ - -/*! \file gsm0503_parity.c */ + * + * \file gsm0503_parity.c */ /*! GSM (SACCH) parity (FIRE code) * diff --git a/src/coding/gsm0503_tables.c b/src/coding/gsm0503_tables.c index 32d12ea..dda8cad 100644 --- a/src/coding/gsm0503_tables.c +++ b/src/coding/gsm0503_tables.c @@ -27,14 +27,13 @@ /*! \addtogroup tables * @{ * - * GSM TS 05.03 tables + * GSM TS 05.03 tables. * * This module contains various tables defining parts of 3GPP TS 05.03 * / 45.003, primarily for the purpose of (de)puncturing, interleaving, * etc. - */ - -/*! \file gsm0503_tables.c */ + * + * \file gsm0503_tables.c */ const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8] = { { 1,1, 1,1, 1,1, 1,1 }, diff --git a/src/conv.c b/src/conv.c index 38ce173..420acca 100644 --- a/src/conv.c +++ b/src/conv.c @@ -1,8 +1,6 @@ +/*! \file conv.c + * Generic convolutional encoding / decoding. */ /* - * conv.c - * - * Generic convolutional encoding / decoding - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,10 +22,10 @@ /*! \addtogroup conv * @{ - * Osmocom convolutional encoder and decoder - */ + * Osmocom convolutional encoder and decoder. + * + * \file conv.c */ -/*! \file conv.c */ #include "config.h" #ifdef HAVE_ALLOCA_H #include diff --git a/src/conv_acc.c b/src/conv_acc.c index 13b220b..048bbb1 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -1,6 +1,6 @@ +/*! \file conv_acc.c + * Accelerated Viterbi decoder implementation. */ /* - * Accelerated Viterbi decoder implementation - * * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_generic.c b/src/conv_acc_generic.c index a4787e3..228f3e2 100644 --- a/src/conv_acc_generic.c +++ b/src/conv_acc_generic.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_generic.c * Accelerated Viterbi decoder implementation - * for generic architectures without SSE support - * + * for generic architectures without SSE support. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse.c b/src/conv_acc_sse.c index bcc9d48..e9bbde1 100644 --- a/src/conv_acc_sse.c +++ b/src/conv_acc_sse.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_sse.c * Accelerated Viterbi decoder implementation - * for architectures with only SSE3 available - * + * for architectures with only SSE3 available. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse_avx.c b/src/conv_acc_sse_avx.c index 2ad353a..c399719 100644 --- a/src/conv_acc_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_sse_avx.c * Accelerated Viterbi decoder implementation - * for architectures with both SSE3 and AVX2 support - * + * for architectures with both SSE3 and AVX2 support. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index a62f910..e6eaaa6 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -1,8 +1,8 @@ -/* - * Accelerated Viterbi decoder implementation +/*! \file conv_acc_sse_impl.h + * Accelerated Viterbi decoder implementation: * Actual definitions which are being included - * from both conv_acc_sse.c and conv_acc_sse_avx.c - * + * from both conv_acc_sse.c and conv_acc_sse_avx.c. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/crc16.c b/src/crc16.c index 7d523b6..b5cb956 100644 --- a/src/crc16.c +++ b/src/crc16.c @@ -1,4 +1,4 @@ -/* +/*! \file crc16.c * This was copied from the linux kernel and adjusted for our types. */ /* diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index 9c63052..e92a538 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -1,8 +1,6 @@ +/*! \file crcXXgen.c + * Osmocom generic CRC routines (for max XX bits poly). */ /* - * crcXXgen.c - * - * Generic CRC routines (for max XX bits poly) - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,12 +22,9 @@ /*! \addtogroup crcgen * @{ - * Osmocom generic CRC routines - */ - -/*! \file crcXXgen.c - * Osmocom generic CRC routines (for max XX bits poly) - */ + * Osmocom generic CRC routines (for max XX bits poly). + * + * \file crcXXgen.c.tpl */ #include diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index d706995..836bb71 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -1,5 +1,6 @@ -/* SNMP-like status interface - * +/*! \file control_cmd.c + * SNMP-like status interface. */ +/* * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves * diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 5d04cdf..47efb25 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -1,5 +1,6 @@ -/* SNMP-like status interface - * +/*! \file control_if.c + * SNMP-like status interface. */ +/* * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves * diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index a67dbe2..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -1,5 +1,6 @@ -/* VTY configuration for Control interface - * +/*! \file control_vty.c + * VTY configuration for Control interface. */ +/* * (C) 2016 by sysmocom s.m.f.c. GmbH * * All Rights Reserved diff --git a/src/ctrl/fsm_ctrl_commands.c b/src/ctrl/fsm_ctrl_commands.c index 6c3ecde..38fbd1e 100644 --- a/src/ctrl/fsm_ctrl_commands.c +++ b/src/ctrl/fsm_ctrl_commands.c @@ -1,3 +1,5 @@ +/*! \file fsm_ctrl_commands.c */ + #include #include diff --git a/src/fsm.c b/src/fsm.c index 27389a7..d62fd79 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -1,5 +1,6 @@ -/* Osmocom generic Finite State Machine implementation - * +/*! \file fsm.c + * Osmocom generic Finite State Machine implementation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -82,9 +83,8 @@ * * In order to attach private state to the \ref osmo_fsm_inst, it * offers an opaque priv pointer. - */ - -/*! \file fsm.c */ + * + * \file fsm.c */ LLIST_HEAD(osmo_g_fsms); static bool fsm_log_addr = true; diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c index 5848a11..5de5135 100644 --- a/src/gb/common_vty.c +++ b/src/gb/common_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC VTY common helpers */ -/* (C) 2009-2012 by Harald Welte +/*! \file common_vty.c + * OpenBSC VTY common helpers. */ +/* + * (C) 2009-2012 by Harald Welte * (C) 2009-2010 by Holger Hans Peter Freyther * All Rights Reserved * diff --git a/src/gb/common_vty.h b/src/gb/common_vty.h index 8c6b9ab..a0674a7 100644 --- a/src/gb/common_vty.h +++ b/src/gb/common_vty.h @@ -1,3 +1,5 @@ +/*! \file common_vty.h */ + #include #include diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 142f589..518198f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index f41c4a4..d9f04c5 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp_bss.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c index 88916c1..78a11a3 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp_util.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f3f354c..703d130 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -1,6 +1,7 @@ -/* VTY interface for our GPRS BSS Gateway Protocol (BSSGP) implementation */ - -/* (C) 2010 by Harald Welte +/*! \file gprs_bssgp_vty.c + * VTY interface for our GPRS BSS Gateway Protocol (BSSGP) implementation. */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 51d1c3c..d20ed23 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1,7 +1,8 @@ -/* GPRS Networks Service (NS) messages on the Gb interface - * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) */ - -/* (C) 2009-2012 by Harald Welte +/*! \file gprs_ns.c + * GPRS Networks Service (NS) messages on the Gb interface. + * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05). */ +/* + * (C) 2009-2012 by Harald Welte * * All Rights Reserved * @@ -22,11 +23,7 @@ /*! \addtogroup libgb * @{ - */ - -/*! \file gprs_ns.c */ - -/*! + * * GPRS Networks Service (NS) messages on the Gb interface * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * @@ -36,30 +33,31 @@ * do much, apart from providing congestion notification and status indication. * * Terms: - * NS Network Service - * NSVC NS Virtual Connection - * NSEI NS Entity Identifier - * NSVL NS Virtual Link - * NSVLI NS Virtual Link Identifier - * BVC BSSGP Virtual Connection - * BVCI BSSGP Virtual Connection Identifier - * NSVCG NS Virtual Connection Goup - * Blocked NS-VC cannot be used for user traffic - * Alive Ability of a NS-VC to provide communication * - * There can be multiple BSSGP virtual connections over one (group of) NSVC's. BSSGP will + * NS Network Service + * NSVC NS Virtual Connection + * NSEI NS Entity Identifier + * NSVL NS Virtual Link + * NSVLI NS Virtual Link Identifier + * BVC BSSGP Virtual Connection + * BVCI BSSGP Virtual Connection Identifier + * NSVCG NS Virtual Connection Goup + * Blocked NS-VC cannot be used for user traffic + * Alive Ability of a NS-VC to provide communication + * + * There can be multiple BSSGP virtual connections over one (group of) NSVC's. BSSGP will * therefore identify the BSSGP virtual connection by a BVCI passed down to NS. * NS then has to firgure out which NSVC's are responsible for this BVCI. * Those mappings are administratively configured. - */ - -/* This implementation has the following limitations: - * o Only one NS-VC for each NSE: No load-sharing function - * o NSVCI 65535 and 65534 are reserved for internal use - * o Only UDP is supported as of now, no frame relay support - * o The IP Sub-Network-Service (SNS) as specified in 48.016 is not implemented - * o There are no BLOCK and UNBLOCK timers (yet?) - */ + * + * This implementation has the following limitations: + * - Only one NS-VC for each NSE: No load-sharing function + * - NSVCI 65535 and 65534 are reserved for internal use + * - Only UDP is supported as of now, no frame relay support + * - The IP Sub-Network-Service (SNS) as specified in 48.016 is not implemented + * - There are no BLOCK and UNBLOCK timers (yet?) + * + * \file gprs_ns.c */ #include #include diff --git a/src/gb/gprs_ns_frgre.c b/src/gb/gprs_ns_frgre.c index 285a9a0..52145ff 100644 --- a/src/gb/gprs_ns_frgre.c +++ b/src/gb/gprs_ns_frgre.c @@ -1,9 +1,9 @@ -/* GPRS Networks Service (NS) messages on the Gb interface - * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) */ - -/* NS-over-FR-over-GRE implementation */ - -/* (C) 2009-2010 by Harald Welte +/*! \file gprs_ns_frgre.c + * NS-over-FR-over-GRE implementation. + * GPRS Networks Service (NS) messages on the Gb interface, + * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05). */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index bdccb3f..e320ba2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -1,6 +1,7 @@ -/* VTY interface for our GPRS Networks Service (NS) implementation */ - -/* (C) 2009-2010 by Harald Welte +/*! \file gprs_ns_vty.c + * VTY interface for our GPRS Networks Service (NS) implementation. */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/a5.c b/src/gsm/a5.c index f21554f..e906b6d 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -1,12 +1,11 @@ -/* - * a5.c - * - * Full reimplementation of A5/1,2 (split and threadsafe) +/*! \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 * * All Rights Reserved @@ -29,9 +28,8 @@ /*! \addtogroup crypto * @{ * Osmocom GSM/GPRS ciphering algorithm implementation - */ - -/*! \file gsm/a5.c */ + * + * \file gsm/a5.c */ #include #include diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 287973b..c59ebb7 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -1,7 +1,5 @@ -/* GSM Network Management (OML) messages on the A-bis interface - * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ - -/* (C) 2008-2011 by Harald Welte +/* + * (C) 2008-2011 by Harald Welte * * All Rights Reserved * @@ -22,11 +20,10 @@ /*! \addtogroup oml * @{ - * GSM Network Management (OML) messages on the A-bis interface + * GSM Network Management (OML) messages on the A-bis interface. * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 - */ - -/*! \file abis_nm.c */ + * + * \file abis_nm.c */ #include #include diff --git a/src/gsm/apn.c b/src/gsm/apn.c index ccf36b9..8d4b2bf 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -1,3 +1,5 @@ +/*! \file apn.c */ + #include #include #include diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index 3b645d2..1dddef3 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -1,7 +1,7 @@ - -/* GSM/GPRS/3G authentication core infrastructure */ - -/* (C) 2010-2011 by Harald Welte +/*! \file auth_comp128v1.c + * GSM/GPRS/3G authentication core infrastructure */ +/* + * (C) 2010-2011 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index b0900af..4d23769 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -1,9 +1,8 @@ -/* registers COMP128 version 2 and 3 A3/A8 algorithms for the - * GSM/GPRS/3G authentication core infrastructure - * - */ - -/* (C) 2010-2011 by Harald Welte +/*! \file auth_comp128v23.c + * registers COMP128 version 2 and 3 A3/A8 algorithms for the + * GSM/GPRS/3G authentication core infrastructure. */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2013 by K?vin Redon * * All Rights Reserved diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 1bdd4a8..4156695 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -1,5 +1,3 @@ -/* GSM/GPRS/3G authentication core infrastructure */ - /* (C) 2010-2012 by Harald Welte * * All Rights Reserved @@ -33,9 +31,8 @@ /*! \addtogroup auth * @{ * GSM/GPRS/3G authentication core infrastructure - */ - -/* \file auth_core.c */ + * + * \file auth_core.c */ static LLIST_HEAD(osmo_auths); diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 41e538d..8d50990 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -1,6 +1,7 @@ -/* GSM/GPRS/3G authentication core infrastructure */ - -/* (C) 2011 by Harald Welte +/*! \file auth_milenage.c + * GSM/GPRS/3G authentication core infrastructure */ +/* + * (C) 2011 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c index 78f0e07..0fcc67d 100644 --- a/src/gsm/comp128.c +++ b/src/gsm/comp128.c @@ -1,6 +1,5 @@ -/* - * COMP128 implementation - * +/*! \file comp128.c + * COMP128 v1; common/old GSM Authentication Algorithm (A3/A8). * * This code is inspired by original code from : * Marc Briceno , Ian Goldberg , @@ -11,7 +10,38 @@ * A comment snippet from the original code is included below, it describes * where the doc came from and how the algorithm was reverse engineered. * + * This code derived from a leaked document from the GSM standards. + * Some missing pieces were filled in by reverse-engineering a working SIM. + * We have verified that this is the correct COMP128 algorithm. * + * The first page of the document identifies it as + * + * _Technical Information: GSM System Security Study_. + * 10-1617-01, 10th June 1988. + * + * The bottom of the title page is marked + * + * Racal Research Ltd. + * Worton Drive, Worton Grange Industrial Estate, + * Reading, Berks. RG2 0SB, England. + * Telephone: Reading (0734) 868601 Telex: 847152 + * + * The relevant bits are in Part I, Section 20 (pages 66--67). Enjoy! + * + * Note: There are three typos in the spec (discovered by + * reverse-engineering). + * - First, "z = (2 * x[n] + x[n]) mod 2^(9-j)" should clearly read + * "z = (2 * x[m] + x[n]) mod 2^(9-j)". + * - Second, the "k" loop in the "Form bits from bytes" section is severely + * botched: the k index should run only from 0 to 3, and clearly the range + * on "the (8-k)th bit of byte j" is also off (should be 0..7, not 1..8, + * to be consistent with the subsequent section). + * - Third, SRES is taken from the first 8 nibbles of x[], not the last 8 as + * claimed in the document. (And the document doesn't specify how Kc is + * derived, but that was also easily discovered with reverse engineering.) + * All of these typos have been corrected in the following code. + */ +/* * (C) 2009 by Sylvain Munaut * * All Rights Reserved @@ -32,49 +62,12 @@ * */ -/* - * --- SNIP --- - * - * This code derived from a leaked document from the GSM standards. - * Some missing pieces were filled in by reverse-engineering a working SIM. - * We have verified that this is the correct COMP128 algorithm. - * - * The first page of the document identifies it as - * _Technical Information: GSM System Security Study_. - * 10-1617-01, 10th June 1988. - * The bottom of the title page is marked - * Racal Research Ltd. - * Worton Drive, Worton Grange Industrial Estate, - * Reading, Berks. RG2 0SB, England. - * Telephone: Reading (0734) 868601 Telex: 847152 - * The relevant bits are in Part I, Section 20 (pages 66--67). Enjoy! - * - * Note: There are three typos in the spec (discovered by - * reverse-engineering). - * First, "z = (2 * x[n] + x[n]) mod 2^(9-j)" should clearly read - * "z = (2 * x[m] + x[n]) mod 2^(9-j)". - * Second, the "k" loop in the "Form bits from bytes" section is severely - * botched: the k index should run only from 0 to 3, and clearly the range - * on "the (8-k)th bit of byte j" is also off (should be 0..7, not 1..8, - * to be consistent with the subsequent section). - * Third, SRES is taken from the first 8 nibbles of x[], not the last 8 as - * claimed in the document. (And the document doesn't specify how Kc is - * derived, but that was also easily discovered with reverse engineering.) - * All of these typos have been corrected in the following code. - * - * --- /SNIP --- - */ - #include #include /*! \addtogroup auth * @{ - */ - -/*! \file comp128.c - * COMP128 v1; common/old GSM Authentication Algorithm (A3/A8) - */ + * \file comp128.c */ /* The compression tables (just copied ...) */ static const uint8_t table_0[512] = { diff --git a/src/gsm/comp128v23.c b/src/gsm/comp128v23.c index 1797ebc..12f8a4c 100644 --- a/src/gsm/comp128v23.c +++ b/src/gsm/comp128v23.c @@ -1,11 +1,11 @@ -/* COMP128 version 2 and 3 implementation +/*! \file comp128v23.c + * COMP128 version 2 and 3 implementation, common algorithm used for GSM Authentication (A3/A8). * * This code is a C conversion of the original code from * http://www.hackingprojects.net/ - * */ - -/* (C) 2013 by K?vin Redon +/* + * (C) 2013 by K?vin Redon * * All Rights Reserved * @@ -30,11 +30,7 @@ /*! \addtogroup auth * @{ - */ - -/*! \file comp128v23.c - * COMP128 v2 / v3; Common Algorithm used for GSM Authentication (A3/A8) - */ + * \file comp128v23.c */ static const uint8_t table0[256] = { 197, 235, 60, 151, 98, 96, 3, 100, 248, 118, 42, 117, 172, 211, 181, 203, 61, diff --git a/src/gsm/gan.c b/src/gsm/gan.c index d357b7e..fae93f1 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -1,4 +1,7 @@ -/* (C) 2012 by Harald Welte +/*! \file gan.c + * Generic Access Network (GAN) / UMA according to TS 44.318. */ +/* + * (C) 2012 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -20,11 +23,6 @@ #include #include - -/*! \file gan.c - * Generic Access Network (GAN) / UMA according to TS 44.318 - */ - const struct value_string gan_msgt_vals[] = { { GA_MT_RC_DISCOVERY_REQUEST, "GA-RC DISCOVERY REQUEST" }, diff --git a/src/gsm/gea.c b/src/gsm/gea.c index d4e599c..d95c03e 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -1,8 +1,6 @@ +/*! \file gea.c + * Implementation of GEA3 and GEA4. */ /* - * gea.c - * - * Implementation of GEA3 and GEA4 - * * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved @@ -32,10 +30,7 @@ /*! \addtogroup crypto * @{ - */ - -/*! \file gsm/gea.c */ - + * \file gsm/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 diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index b833048..fc68c40 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -1,6 +1,7 @@ -/* GPRS LLC cipher core infrastructure */ - -/* (C) 2010 by Harald Welte +/*! \file gprs_cipher_core.c + * GPRS LLC cipher core infrastructure */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/gprs_gea.c b/src/gsm/gprs_gea.c index 836ee68..db3f2cc 100644 --- a/src/gsm/gprs_gea.c +++ b/src/gsm/gprs_gea.c @@ -1,8 +1,6 @@ +/*! \file gprs_gea.c + * GEA 3 & 4 plugin */ /* - * gprs_gea.c - * - * GEA 3 & 4 plugin - * * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index 4b32947..b213b26 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -1,13 +1,13 @@ +/*! \file gsm/gprs_rlc.c + * helper functions for (E)GPRS RLC according to 3GPP TS 44.060. + */ + #include #include #include #include #include - -/*! \file gsm/gprs_rlc.c - * helper functions for (E)GPRS RLC according to 3GPP TS 44.060 - */ #define EGPRS_CPS_TYPE1_TBL_SZ 29 #define EGPRS_CPS_TYPE2_TBL_SZ 8 diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 0e3e453..05a0b4a 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -1,3 +1,4 @@ +/*! \file gsm0341.c */ /* * (C) 2014 by Harald Welte * All Rights Reserved diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index dab83eb..7414e95 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_smc.c + * 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 */ - -/* (C) 2008 by Daniel Willmann + * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index d120f2d..67bb249 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_smr.c + * 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 */ - -/* (C) 2008 by Daniel Willmann +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index ef67930..7c7164c 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_utils.c + * 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 */ - -/* (C) 2008 by Daniel Willmann + * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010-2013 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0414.c b/src/gsm/gsm0414.c index 84d393d..616d7d9 100644 --- a/src/gsm/gsm0414.c +++ b/src/gsm/gsm0414.c @@ -1,3 +1,5 @@ +/*! \file gsm0414.c */ + #include #include diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 3c23f6f..557aa14 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -1,5 +1,5 @@ -/* Format functions for GSM 04.80 */ - +/*! \file gsm0480.c + * Format functions for GSM 04.80. */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2009 by Mike Haben diff --git a/src/gsm/gsm0502.c b/src/gsm/gsm0502.c index df1d8e9..6b69893 100644 --- a/src/gsm/gsm0502.c +++ b/src/gsm/gsm0502.c @@ -1,6 +1,7 @@ -/* Paging helper code */ - -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file gsm0502.c + * Paging helper code */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index f595dd6..a8a5e45 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1,4 +1,6 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther +/*! \file gsm0808.c */ +/* + * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves * All Rights Reserved * diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 715cabf..a8c83f1 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1,4 +1,6 @@ -/* (C) 2016 by Sysmocom s.f.m.c. GmbH +/*! \file gsm0808_utils.c */ +/* + * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Philipp Maier diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 227dbef..f69eee2 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -1,7 +1,8 @@ -/* GSM Mobile Radio Interface Layer 3 messages +/*! \file gsm48.c + * GSM Mobile Radio Interface Layer 3 messages * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * (C) 2008, 2009 by Holger Hans Peter Freyther * * All Rights Reserved diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index d3a868d..105acba 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -1,7 +1,8 @@ -/* GSM Mobile Radio Interface Layer 3 messages - * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008 by Harald Welte +/*! \file gsm48_ie.c + * GSM Mobile Radio Interface Layer 3 messages. + * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0. */ +/* + * (C) 2008 by Harald Welte * (C) 2009-2010 by Andreas Eversberg * * All Rights Reserved diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 7bcef4e..43da27e 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -1,4 +1,6 @@ -/* (C) 2009-2016 by Harald Welte +/*! \file gsm_04_08_gprs.c */ +/* + * (C) 2009-2016 by Harald Welte * (C) 2010 by On-Waves * (C) 2014-2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index fd16e98..5a4ceb3 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -1,3 +1,4 @@ +/*! \file gsm_utils.c */ /* * (C) 2008 by Daniel Willmann * (C) 2009,2013 by Holger Hans Peter Freyther diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 780198c..2629eb7 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -1,5 +1,5 @@ -/* Osmocom Generic Subscriber Update Protocol message encoder/decoder */ - +/*! \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 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 2c7cf58..bc84850 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -1,6 +1,7 @@ -/* OpenBSC Abis input driver for ip.access */ - -/* (C) 2009-2017 by Harald Welte +/*! \file ipa.c + * OpenBSC Abis input driver for ip.access */ +/* + * (C) 2009-2017 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * diff --git a/src/gsm/kasumi.c b/src/gsm/kasumi.c index d5d78a7..c3a028b 100644 --- a/src/gsm/kasumi.c +++ b/src/gsm/kasumi.c @@ -1,6 +1,7 @@ -/* Kasumi cipher and KGcore functions */ - -/* (C) 2013 by Max +/*! \file kasumi.c + * Kasumi cipher and KGcore functions. */ +/* + * (C) 2013 by Max * * All Rights Reserved * diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 4ad7556..166bf9a 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1,6 +1,7 @@ -/* LAPD core implementation */ - -/* (C) 2010-2011 by Harald Welte +/*! \file lapd_core.c + * LAPD core implementation */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2010-2011 by Andreas Eversberg * * All Rights Reserved @@ -23,12 +24,9 @@ /*! \addtogroup lapd * @{ - * Osmocom LAPD core, used for Q.921, LAPDm and others - */ - -/*! \file lapd_core.c */ - -/*! + * + * Osmocom LAPD core, used for Q.921, LAPDm and others. + * * Notes on Buffering: rcv_buffer, tx_queue, tx_hist, send_buffer, send_queue * * RX data is stored in the rcv_buffer (pointer). If the message is complete, it @@ -62,6 +60,7 @@ * will not trigger T200. It will be stoped, when T200 is started in MF EST * state. It will also be stoped when leaving MF EST state. * + * \file lapd_core.c */ /* Enable this to test content resolution on network side: diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 1152e0d..db950a6 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -1,6 +1,7 @@ -/* GSM LAPDm (TS 04.06) implementation */ - -/* (C) 2010-2011 by Harald Welte +/*! \file lapdm.c + * GSM LAPDm (TS 04.06) implementation. */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2010-2011 by Andreas Eversberg * * All Rights Reserved @@ -23,10 +24,7 @@ /*! \addtogroup lapdm * @{ - * GSM LAPDm (TS 04.06) implementation - */ - -/*! \file lapdm.c */ + * \file lapdm.c */ #include #include diff --git a/src/gsm/milenage/aes-encblock.c b/src/gsm/milenage/aes-encblock.c index 8f35caa..c4aa260 100644 --- a/src/gsm/milenage/aes-encblock.c +++ b/src/gsm/milenage/aes-encblock.c @@ -1,6 +1,6 @@ +/*! \file aes-encblock.c + * AES encrypt_block. */ /* - * AES encrypt_block - * * Copyright (c) 2003-2007, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes-internal-enc.c b/src/gsm/milenage/aes-internal-enc.c index 8726aa7..4c00f96 100644 --- a/src/gsm/milenage/aes-internal-enc.c +++ b/src/gsm/milenage/aes-internal-enc.c @@ -1,5 +1,5 @@ -/* - * AES (Rijndael) cipher - encrypt +/*! \file aes-internal-enc.c + * AES (Rijndael) cipher - encrypt. * * Modifications to public domain implementation: * - support only 128-bit keys @@ -8,7 +8,8 @@ * - added option (AES_SMALL_TABLES) for reducing code size by about 8 kB at * cost of reduced throughput (quite small difference on Pentium 4, * 10-25% when using -O1 or -O2 optimization) - * + */ +/* * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes-internal.c b/src/gsm/milenage/aes-internal.c index 4161220..60c520c 100644 --- a/src/gsm/milenage/aes-internal.c +++ b/src/gsm/milenage/aes-internal.c @@ -1,5 +1,5 @@ -/* - * AES (Rijndael) cipher +/*! \file aes-internal.c + * AES (Rijndael) cipher. * * Modifications to public domain implementation: * - support only 128-bit keys @@ -8,7 +8,8 @@ * - added option (AES_SMALL_TABLES) for reducing code size by about 8 kB at * cost of reduced throughput (quite small difference on Pentium 4, * 10-25% when using -O1 or -O2 optimization) - * + */ +/* * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes.h b/src/gsm/milenage/aes.h index 7e97f61..ce42b20 100644 --- a/src/gsm/milenage/aes.h +++ b/src/gsm/milenage/aes.h @@ -1,5 +1,6 @@ +/*! \file aes.h + * AES functions */ /* - * AES functions * Copyright (c) 2003-2006, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes_i.h b/src/gsm/milenage/aes_i.h index 5d89abc..6df019a 100644 --- a/src/gsm/milenage/aes_i.h +++ b/src/gsm/milenage/aes_i.h @@ -1,5 +1,6 @@ +/*! \file aes_i.h + * AES (Rijndael) cipher. */ /* - * AES (Rijndael) cipher * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes_wrap.h b/src/gsm/milenage/aes_wrap.h index afa1451..7d4d5d9 100644 --- a/src/gsm/milenage/aes_wrap.h +++ b/src/gsm/milenage/aes_wrap.h @@ -1,12 +1,13 @@ -/* - * AES-based functions +/*! \file aes_wrap.h + * AES-based functions. * * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) * - One-Key CBC MAC (OMAC1) hash with AES-128 * - AES-128 CTR mode encryption * - AES-128 EAX mode encryption/decryption * - AES-128 CBC - * + */ +/* * Copyright (c) 2003-2007, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/common.h b/src/gsm/milenage/common.h index aaf82b9..2aa50fb 100644 --- a/src/gsm/milenage/common.h +++ b/src/gsm/milenage/common.h @@ -1,3 +1,4 @@ +/*! \file common.h */ #include #include diff --git a/src/gsm/milenage/milenage.c b/src/gsm/milenage/milenage.c index b43f986..012b399 100644 --- a/src/gsm/milenage/milenage.c +++ b/src/gsm/milenage/milenage.c @@ -1,5 +1,6 @@ +/*! \file milenage.c + * 3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) */ /* - * 3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) * Copyright (c) 2006-2007 * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/milenage.h b/src/gsm/milenage/milenage.h index 6fb779c..1a4364d 100644 --- a/src/gsm/milenage/milenage.h +++ b/src/gsm/milenage/milenage.h @@ -1,5 +1,7 @@ +/*! \file milenage.h + * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208). + */ /* - * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) * Copyright (c) 2006-2007 * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/oap.c b/src/gsm/oap.c index 88c98f7..b07eafc 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -1,6 +1,7 @@ -/* Osmocom Authentication Protocol message encoder/decoder */ - -/* (C) 2015-2016 by sysmocom s.f.m.c. GmbH +/*! \file oap.c + * Osmocom Authentication Protocol message encoder/decoder */ +/* + * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Neels Hofmeyr diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 4a1f733..e33ea10 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -1,7 +1,5 @@ -/* GSM Radio Signalling Link messages on the A-bis interface - * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * * All Rights Reserved * @@ -30,10 +28,10 @@ /*! \addtogroup rsl * @{ - * GSM Radio Signalling Link (TS 08.58) - */ - -/*! \file rsl.c */ + * GSM Radio Signalling Link messages on the A-bis interface. + * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0. + * + * \file rsl.c */ /*! Size for RSL \ref msgb_alloc */ #define RSL_ALLOC_SIZE 200 diff --git a/src/gsm/rxlev_stat.c b/src/gsm/rxlev_stat.c index d226861..2ff0ac8 100644 --- a/src/gsm/rxlev_stat.c +++ b/src/gsm/rxlev_stat.c @@ -1,6 +1,7 @@ -/* Rx Level statistics */ - -/* (C) 2010 by Harald Welte +/*! \file rxlev_stat.c + * Rx Level statistics */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/sysinfo.c b/src/gsm/sysinfo.c index 201acfc..b73bb0c 100644 --- a/src/gsm/sysinfo.c +++ b/src/gsm/sysinfo.c @@ -1,7 +1,8 @@ -/* GSM 04.08 System Information (SI) encoding and decoding +/*! \file sysinfo.c + * GSM 04.08 System Information (SI) encoding and decoding. * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index d9072c9..b1b1034 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -39,9 +39,8 @@ * particular type. Types are e.g. TV (Tag + single byte value), Tag + * fixed-length value, TLV with 8bit length, TLV with 16bit length, TLV * with variable-length length field, etc. - */ - -/*! \file tlv_parser.c */ + * + * \file tlv_parser.c */ struct tlv_definition tvlv_att_def; struct tlv_definition vtvlv_gan_att_def; diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 62bbd57..561cdb3 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -1,4 +1,5 @@ -/* GSMTAP support code in libmsomcore */ +/*! \file gsmtap_util.c + * GSMTAP support code in libosmocore. */ /* * (C) 2010-2011 by Harald Welte * @@ -43,9 +44,9 @@ /*! \addtogroup gsmtap * @{ - * GSMTAP utility routines. Encapsulates GSM messages over UDP - */ -/*! \file gsmtap_util.c */ + * GSMTAP utility routines. Encapsulates GSM messages over UDP. + * + * \file gsmtap_util.c */ /*! convert RSL channel number to GSMTAP channel type diff --git a/src/logging.c b/src/logging.c index 964128b..c8b86b1 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1,6 +1,7 @@ -/* Debugging/Logging support code */ - -/* (C) 2008-2010 by Harald Welte +/*! \file logging.c + * Debugging/Logging support code. */ +/* + * (C) 2008-2010 by Harald Welte * (C) 2008 by Holger Hans Peter Freyther * All Rights Reserved * @@ -23,9 +24,8 @@ /* \addtogroup logging * @{ * libosmocore Logging sub-system - */ - -/* \file logging.c */ + * + * \file logging.c */ #include "../config.h" diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index 9e5884b..d0aa47b 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -1,6 +1,12 @@ -/* GSMTAP network logging support code */ - -/* (C) 2016 by Harald Welte +/*! \file logging_gsmtap.c + * libosmocore log output encapsulated in GSMTAP. + * + * Encapsulating the log output inside GSMTAP frames allows us to + * observer protocol traces (of Um, Abis, A or any other interface in + * the Osmocom world) with synchronous interspersed log messages. + */ +/* + * (C) 2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,15 +27,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file logging_gsmtap.c - * libosmocore log output encapsulated in GSMTAP - * - * Encapsulating the log output inside GSMTAP frames allows us to - * observer protocol traces (of Um, Abis, A or any other interface in - * the Osmocom world) with synchronous interspersed log messages. - */ + * \file logging_gsmtap.c */ #include "../config.h" diff --git a/src/logging_syslog.c b/src/logging_syslog.c index a80a31e..d0d6a96 100644 --- a/src/logging_syslog.c +++ b/src/logging_syslog.c @@ -1,6 +1,7 @@ -/* Syslog logging support code */ - -/* (C) 2011 by Harald Welte +/*! \file logging_syslog.c + * Syslog logging support code. */ +/* + * (C) 2011 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,11 +22,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file logging_syslog.c - * libosmocore logging output via syslog - */ + * \file logging_syslog.c */ #include "../config.h" diff --git a/src/loggingrb.c b/src/loggingrb.c index 64033fc..5127a2f 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -1,6 +1,7 @@ -/* Ringbuffer-backed logging support code */ - -/* (C) 2012-2013 by Katerina Barone-Adesi +/*! \file loggingrb.c + * Ringbuffer-backed logging support code. */ +/* + * (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,11 +22,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file loggingrb.c - * libosmocore logging backend for a ring-buffer of last log messages - */ + * \file loggingrb.c */ #include #include diff --git a/src/macaddr.c b/src/macaddr.c index 6a1588d..5c68d05 100644 --- a/src/macaddr.c +++ b/src/macaddr.c @@ -1,3 +1,5 @@ +/*! \file macaddr.c + * MAC address utility routines. */ /* * (C) 2013-2014 by Harald Welte * (C) 2014 by Holger Hans Peter Freyther @@ -22,11 +24,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file macaddr.c - * MAC address utility routines - */ + * \file macaddr.c */ #include "config.h" diff --git a/src/msgb.c b/src/msgb.c index bad98f4..2e9f4a2 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -20,6 +20,7 @@ /*! \addtogroup msgb * @{ + * * libosmocore message buffers, inspired by Linux kernel skbuff * * Inspired by the 'struct skbuff' of the Linux kernel, we implement a @@ -46,9 +47,9 @@ * * prepending (pushing) and appending (putting) data * * copying / resizing * * hex-dumping to a string for debug purposes + * + * \file msgb.c */ - -/*! \file msgb.c */ #include #include diff --git a/src/msgfile.c b/src/msgfile.c index bf36bf3..8517099 100644 --- a/src/msgfile.c +++ b/src/msgfile.c @@ -1,6 +1,6 @@ +/*! \file msgfile.c + * Parse a simple file with messages, e.g used for USSD messages. */ /* - * Parse a simple file with messages, e.g used for USSD messages - * * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * All Rights Reserved diff --git a/src/panic.c b/src/panic.c index 251fdad..2a8b1ae 100644 --- a/src/panic.c +++ b/src/panic.c @@ -1,4 +1,5 @@ -/* Panic handling */ +/*! \file panic.c + * Routines for panic handling. */ /* * (C) 2010 by Sylvain Munaut * @@ -22,11 +23,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file panic.c - * Routines for panic handling - */ + * \file panic.c */ #include #include diff --git a/src/plugin.c b/src/plugin.c index b6a5a48..264171c 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,7 @@ -/* plugin infrastructure */ - -/* (C) 2010 by Harald Welte +/*! \file plugin.c + * Routines for loading and managing shared library plug-ins. */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * @@ -22,12 +23,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file plugin.c - * Routines for loading and managing shared library plug-ins. - */ - + * \file plugin.c */ #include "../config.h" diff --git a/src/prim.c b/src/prim.c index f39527f..2035581 100644 --- a/src/prim.c +++ b/src/prim.c @@ -1,3 +1,5 @@ +/*! \file prim.c */ + #include #include diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index bc7a491..b77ffe9 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -1,7 +1,7 @@ -/* overly simplistic talloc replacement for deeply embedded +/*! \file pseudotalloc.c + * overly simplistic talloc replacement for deeply embedded * microcontrollers. Obviously this has none of the properties of real - * talloc, it is particualrly not hierarchical at all */ - + * talloc, it is particualrly not hierarchical at all. */ #include "talloc.h" #include diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index f4c0a74..3ce9f37 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -1,8 +1,9 @@ -#pragma once - -/* overly simplistic talloc replacement for deeply embedded +/*! \file talloc.h + * overly simplistic talloc replacement for deeply embedded * microcontrollers. Obviously this has none of the properties of real - * talloc, it is particualrly not hierarchical at all */ + * talloc, it is particualrly not hierarchical at all. */ + +#pragma once #include #include diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 068d491..2985bbb 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,5 +1,3 @@ -/* utility routines for keeping conters about events and the event rates */ - /* (C) 2009-2010 by Harald Welte * * All Rights Reserved @@ -22,11 +20,9 @@ /*! \addtogroup rate_ctr * @{ - * conters about events and their event rates - */ - -/*! \file rate_ctr.c */ - + * Counters about events and their event rates. + * + * \file rate_ctr.c */ #include #include diff --git a/src/select.c b/src/select.c index 575fd77..f7ee424 100644 --- a/src/select.c +++ b/src/select.c @@ -1,7 +1,9 @@ -/* select filedescriptor handling, taken from: +/*! \file select.c + * select filedescriptor handling. + * Taken from: * userspace logging daemon for the iptables ULOG target - * of the linux 2.4 netfilter subsystem. - * + * of the linux 2.4 netfilter subsystem. */ +/* * (C) 2000-2009 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -37,9 +39,8 @@ /*! \addtogroup select * @{ * select() loop abstraction - */ - -/*! \file select.c */ + * + * \file select.c */ static int maxfd = 0; static LLIST_HEAD(osmo_fds); diff --git a/src/sercomm.c b/src/sercomm.c index d02b39e..07b1aa0 100644 --- a/src/sercomm.c +++ b/src/sercomm.c @@ -1,5 +1,3 @@ -/* Serial communications layer, based on HDLC */ - /* (C) 2010,2017 by Harald Welte * * All Rights Reserved @@ -22,11 +20,9 @@ /*! \addtogroup sercomm * @{ - * Serial communications layer, based on HDLC - */ - -/*! \file sercomm.c - */ + * Serial communications layer, based on HDLC. + * + * \file sercomm.c */ #include "config.h" diff --git a/src/serial.c b/src/serial.c index b8c347b..dddad88 100644 --- a/src/serial.c +++ b/src/serial.c @@ -1,8 +1,6 @@ +/*! \file serial.c + * Utility functions to deal with serial ports */ /* - * serial.c - * - * Utility functions to deal with serial ports - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -25,9 +23,8 @@ /*! \addtogroup serial * @{ * Osmocom serial port helpers - */ - -/*! \file serial.c */ + * + * \file serial.c */ #include #include diff --git a/src/signal.c b/src/signal.c index 301b021..0c56465 100644 --- a/src/signal.c +++ b/src/signal.c @@ -1,5 +1,7 @@ -/* Generic signalling/notification infrastructure */ -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file signal.c + * Generic signalling/notification infrastructure. */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -27,10 +29,9 @@ /*! \addtogroup signal * @{ - * Generic signalling/notification infrastructure - */ - -/*! \file signal.c */ + * Generic signalling/notification infrastructure. + * + * \file signal.c */ void *tall_sigh_ctx; diff --git a/src/sim/card_fs_isim.c b/src/sim/card_fs_isim.c index 339e862..1073429 100644 --- a/src/sim/card_fs_isim.c +++ b/src/sim/card_fs_isim.c @@ -1,4 +1,5 @@ -/* 3GPP ISIM specific structures / routines */ +/*! \file card_fs_isim.c + * 3GPP ISIM specific structures / routines. */ /* * (C) 2014 by Harald Welte * diff --git a/src/sim/card_fs_sim.c b/src/sim/card_fs_sim.c index 432c945..1411129 100644 --- a/src/sim/card_fs_sim.c +++ b/src/sim/card_fs_sim.c @@ -1,4 +1,5 @@ -/* classic SIM card specific structures/routines */ +/*! \file card_fs_sim.c + * classic SIM card specific structures/routines. */ /* * (C) 2012-2014 by Harald Welte * diff --git a/src/sim/card_fs_tetra.c b/src/sim/card_fs_tetra.c index 657e55f..80f3284 100644 --- a/src/sim/card_fs_tetra.c +++ b/src/sim/card_fs_tetra.c @@ -1,4 +1,5 @@ -/* TETRA SIM card specific structures/routines */ +/*! \file card_fs_tetra.c + * TETRA SIM card specific structures/routines. */ /* * (C) 2014 by Harald Welte * diff --git a/src/sim/card_fs_uicc.c b/src/sim/card_fs_uicc.c index 27afe34..8ff8936 100644 --- a/src/sim/card_fs_uicc.c +++ b/src/sim/card_fs_uicc.c @@ -1,4 +1,5 @@ -/* ETSI UICC specific structures / routines */ +/*! \file card_fs_uicc.c + * ETSI UICC specific structures / routines. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/card_fs_usim.c b/src/sim/card_fs_usim.c index 22c193f..9e9fc87 100644 --- a/src/sim/card_fs_usim.c +++ b/src/sim/card_fs_usim.c @@ -1,4 +1,5 @@ -/* 3GPP USIM specific structures / routines */ +/*! \file card_fs_usim.c + * 3GPP USIM specific structures / routines. */ /* * (C) 2012-2014 by Harald Welte * diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index c3e18d8..fcf67f0 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -1,5 +1,6 @@ -/* simtrace - tables determining APDU case for card emulation - * +/*! \file class_tables.c + * simtrace - tables determining APDU case for card emulation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify diff --git a/src/sim/core.c b/src/sim/core.c index 15a1563..8da839c 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -1,4 +1,5 @@ -/* Core routines for SIM/UICC/USIM access */ +/*! \file core.c + * Core routines for SIM/UICC/USIM access. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/gsm_int.h b/src/sim/gsm_int.h index 54a2fbf..42ccca7 100644 --- a/src/sim/gsm_int.h +++ b/src/sim/gsm_int.h @@ -1,3 +1,5 @@ +/*! \file gsm_int.h */ + #include #include diff --git a/src/sim/reader.c b/src/sim/reader.c index e7169b5..f39829b 100644 --- a/src/sim/reader.c +++ b/src/sim/reader.c @@ -1,4 +1,5 @@ -/* Card reader abstraction for libosmosim */ +/*! \file reader.c + * Card reader abstraction for libosmosim. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/reader_pcsc.c b/src/sim/reader_pcsc.c index f020142..5b29638 100644 --- a/src/sim/reader_pcsc.c +++ b/src/sim/reader_pcsc.c @@ -1,4 +1,5 @@ -/* PC/SC Card reader backend for libosmosim */ +/*! \file reader_pcsc.c + * PC/SC Card reader backend for libosmosim. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/sim_int.h b/src/sim/sim_int.h index 7b07b83..885011e 100644 --- a/src/sim/sim_int.h +++ b/src/sim/sim_int.h @@ -1,3 +1,5 @@ +/*! \file sim_int.h */ + #ifndef _SIM_INT_H #include diff --git a/src/socket.c b/src/socket.c index f033912..b74edd4 100644 --- a/src/socket.c +++ b/src/socket.c @@ -23,10 +23,9 @@ /*! \addtogroup socket * @{ - * Osmocom socket convenience functions - */ - -/*! \file socket.c */ + * Osmocom socket convenience functions. + * + * \file socket.c */ #ifdef HAVE_SYS_SOCKET_H diff --git a/src/stat_item.c b/src/stat_item.c index 3b67ba0..c073a3e 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -1,6 +1,7 @@ -/* utility routines for keeping conters about events and the event rates */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH +/*! \file stat_item.c + * utility routines for keeping conters about events and the event rates. */ +/* + * (C) 2015 by Sysmocom s.f.m.c. GmbH * (C) 2009-2010 by Harald Welte * * All Rights Reserved @@ -23,10 +24,7 @@ /*! \addtogroup osmo_stat_item * @{ - */ - -/*! \file stat_item.c */ - + * \file stat_item.c */ #include #include diff --git a/src/statistics.c b/src/statistics.c index ad069ce..fc808f5 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -1,6 +1,7 @@ -/* utility routines for keeping some statistics */ - -/* (C) 2009 by Harald Welte +/*! \file statistics.c + * utility routines for keeping some statistics. */ +/* + * (C) 2009 by Harald Welte * * All Rights Reserved * diff --git a/src/stats.c b/src/stats.c index a523259..b39ec53 100644 --- a/src/stats.c +++ b/src/stats.c @@ -1,3 +1,4 @@ +/*! \file stats.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 342bb88..6e7be73 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -1,3 +1,4 @@ +/*! \file stats_statsd.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/strrb.c b/src/strrb.c index 0c56be2..6bfb179 100644 --- a/src/strrb.c +++ b/src/strrb.c @@ -1,7 +1,21 @@ -/* Ringbuffer implementation, tailored for logging. +/*! \file strrb.c + * Ringbuffer implementation, tailored for logging. * This is a lossy ringbuffer. It keeps up to N of the newest messages, * overwriting the oldest as newer ones come in. * + * Ringbuffer assumptions, invarients, and notes: + * - start is the index of the first used index slot in the ring buffer. + * - end is the index of the next index slot in the ring buffer. + * - start == end => buffer is empty + * - Consequence: the buffer can hold at most size - 1 messages + * (if this were not the case, full and empty buffers would be indistinguishable + * given the conventions in this implementation). + * - Whenever the ringbuffer is full, start is advanced. The second oldest + * message becomes unreachable by valid indexes (end is not a valid index) + * and the oldest message is overwritten (if there was a message there, which + * is the case unless this is the first time the ringbuffer becomes full). + */ +/* * (C) 2012-2013, Katerina Barone-Adesi * All Rights Reserved * @@ -23,11 +37,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file strrb.c - * Lossy string ringbuffer for logging; keeps newest messages. - */ + * \file strrb.c */ #include #include @@ -35,19 +45,6 @@ #include #include - -/* Ringbuffer assumptions, invarients, and notes: - * - start is the index of the first used index slot in the ring buffer. - * - end is the index of the next index slot in the ring buffer. - * - start == end => buffer is empty - * - Consequence: the buffer can hold at most size - 1 messages - * (if this were not the case, full and empty buffers would be indistinguishable - * given the conventions in this implementation). - * - Whenever the ringbuffer is full, start is advanced. The second oldest - * message becomes unreachable by valid indexes (end is not a valid index) - * and the oldest message is overwritten (if there was a message there, which - * is the case unless this is the first time the ringbuffer becomes full). -*/ /*! Create an empty, initialized osmo_strrb. * \param[in] ctx The talloc memory context which should own this. @@ -57,7 +54,6 @@ * This function creates and initializes a ringbuffer. * Note that the ringbuffer stores at most rb_size - 1 messages. */ - struct osmo_strrb *osmo_strrb_create(TALLOC_CTX * ctx, size_t rb_size) { struct osmo_strrb *rb = NULL; diff --git a/src/timer.c b/src/timer.c index e18195a..bf46c24 100644 --- a/src/timer.c +++ b/src/timer.c @@ -27,9 +27,8 @@ /*! \addtogroup timer * @{ * Osmocom timer abstraction; modelled after linux kernel timers - */ - -/*! \file timer.c */ + * + * \file timer.c */ #include #include diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index 3a2ae9a..1bf714e 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -22,10 +22,7 @@ /*! \addtogroup timer * @{ - */ - -/*! \file timer_gettimeofday.c - */ + * \file timer_gettimeofday.c */ #include #include diff --git a/src/utils.c b/src/utils.c index 2bd4c19..9e3414b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -34,9 +34,8 @@ /*! \addtogroup utils * @{ * various utility routines - */ - -/*! \file utils.c */ + * + * \file utils.c */ static char namebuf[255]; diff --git a/src/vty/buffer.c b/src/vty/buffer.c index 8862da9..1935aa1 100644 --- a/src/vty/buffer.c +++ b/src/vty/buffer.c @@ -1,5 +1,6 @@ +/*! \file buffer.c + * Buffering of output and input. */ /* - * Buffering of output and input. * Copyright (C) 1998 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/src/vty/command.c b/src/vty/command.c index a0824d3..33862c0 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -44,8 +44,8 @@ /*! \addtogroup command * @{ * VTY command handling - */ -/*! \file command.c */ + * + * \file command.c */ #define CONFIGFILE_MASK 022 diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index acc8ca6..345be66 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -1,5 +1,7 @@ -/* Osmocom FSM introspection via VTY */ -/* (C) 2016 by Harald Welte +/*! \file fsm_vty.c + * Osmocom FSM introspection via VTY. */ +/* + * (C) 2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 4cb1379..758f0b9 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC logging helper for the VTY */ -/* (C) 2009-2010 by Harald Welte +/*! \file logging_vty.c + * OpenBSC logging helper for the VTY. */ +/* + * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther * All Rights Reserved * diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 0557820..57cdd30 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC stats helper for the VTY */ -/* (C) 2009-2010 by Harald Welte +/*! \file stats_vty.c + * OpenBSC stats helper for the VTY. */ +/* + * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther * (C) 2015 by Sysmocom s.f.m.c. GmbH * All Rights Reserved diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index d59516c..f82a7ff 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -1,4 +1,5 @@ -/* minimalistic telnet/network interface it might turn into a wire interface */ +/*! \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 * @@ -44,8 +45,8 @@ * access. This telnet server gets linked into each libosmovty-using * process in order to enable interactive command-line introspection, * interaction and configuration. - */ -/*! \file telnet_interface.c */ + * + * \file telnet_interface.c */ /* per connection data */ LLIST_HEAD(active_connections); diff --git a/src/vty/utils.c b/src/vty/utils.c index 267d76e..9d1bdf9 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -1,6 +1,7 @@ -/* utility routines for printing common objects in the Osmocom world */ - -/* (C) 2009-2010 by Harald Welte +/*! \file utils.c + * Utility routines for printing common objects in the Osmocom world. */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * @@ -35,8 +36,6 @@ #include #include - -/* \file utils.c */ /*! \addtogroup rate_ctr * @{ diff --git a/src/vty/vector.c b/src/vty/vector.c index c21bca7..ee07cbd 100644 --- a/src/vty/vector.c +++ b/src/vty/vector.c @@ -1,4 +1,6 @@ -/* Generic vector interface routine +/*! \file vector.c + * Generic vector interface routine. */ +/* * Copyright (C) 1997 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/src/vty/vty.c b/src/vty/vty.c index 6e60eb7..644d4ed 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -68,8 +68,7 @@ /* \addtogroup vty * @{ - */ -/*! \file vty.c */ + * \file vty.c */ #define SYSCONFDIR "/usr/local/etc" diff --git a/src/write_queue.c b/src/write_queue.c index d929774..203815b 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -1,4 +1,3 @@ -/* Generic write queue implementation */ /* * (C) 2010-2016 by Holger Hans Peter Freyther * (C) 2010 by On-Waves @@ -27,10 +26,9 @@ /*! \addtogroup write_queue * @{ - * write queue for writing \ref msgb to sockets/fd's - */ - -/*! \file write_queue.c */ + * Write queue for writing \ref msgb to sockets/fds. + * + * \file write_queue.c */ /*! Select loop function for write queue handling * \param[in] fd osmocom file descriptor diff --git a/utils/osmo-arfcn.c b/utils/osmo-arfcn.c index 5103c97..61108f8 100644 --- a/utils/osmo-arfcn.c +++ b/utils/osmo-arfcn.c @@ -1,4 +1,5 @@ -/* Utility program for ARFCN / frequency calculations */ +/*! \file osmo-arfcn.c + * Utility program for ARFCN / frequency calculations. */ /* * (C) 2011 by Harald Welte * diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 6b1e623..76c4927 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -1,6 +1,7 @@ -/* GSM/GPRS/3G authentication testing tool */ - -/* (C) 2010-2012 by Harald Welte +/*! \file osmo-auc-gen.c + * GSM/GPRS/3G authentication testing tool. */ +/* + * (C) 2010-2012 by Harald Welte * * All Rights Reserved * -- To view, visit https://gerrit.osmocom.org/2987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b 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 Thu Jun 22 21:55:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:55:23 +0000 Subject: [ABANDON] libosmocore[master]: doxygen: linuxlist.h: fix some API doc to use doxygen Qt style In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: doxygen: linuxlist.h: fix some API doc to use doxygen Qt style ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I9ae25c9bc6b7504402e583a6ce77b037083dcb80 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 Thu Jun 22 21:58:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:58:25 +0000 Subject: libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 rebased and removed some more additions of \brief since the previous patch set, so reinstating previous +2. -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 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 Thu Jun 22 21:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 21:59:38 +0000 Subject: libosmocore[master]: doxygen: unify use of \file across the board In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 only rebase merge conflicts solved, reinstating previous +2 -- To view, visit https://gerrit.osmocom.org/2987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b 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 Thu Jun 22 22:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:08:58 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 10: (1 comment) https://gerrit.osmocom.org/#/c/2465/10/scripts/osmo-build.sh File scripts/osmo-build.sh: Line 170: branch_and_rev_of_remote_repo() { > Do you mean branch_and_rev_of{remote,local}_repo when speaking about "... n The comment means: can we have only one branch_and_rev() function replacing {remote,local}? Do we really need two separate ways to determine them? Fewer implementations means smaller error surface. -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 10 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:13:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:13:05 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (1 comment) I'd accept this, can someone else also approve please? https://gerrit.osmocom.org/#/c/2691/3/scripts/osmo-build-dep.sh File scripts/osmo-build-dep.sh: Line 54: mkdir -p "$inst/stow" > Yes, it does. ah ok, that explains it. -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:38:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:38:49 +0000 Subject: [PATCH] libosmocore[master]: gsm0808: fix length check of the element decoder functions In-Reply-To: References: Message-ID: Hello Max, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2446 to look at the new patch set (#3). gsm0808: fix length check of the element decoder functions The length check of the decoder functions is not entirely correct. The check also checks for values below zero, which does not make sense, since the length is encoded as uint8_t. For some elements a minimum length is known (in most cases this is 1), so checking for zero is sufficient but in some cases (e.g. channel type) the spec mentions a minimum and maximum length. This is now also reflected in the code. Tweaked-by: nhofmeyr Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6 --- M src/gsm/gsm0808_utils.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/46/2446/3 diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 00da04b..c636adf 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -104,7 +104,7 @@ OSMO_ASSERT(ss); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(ss, 0, sizeof(*ss)); @@ -261,7 +261,7 @@ OSMO_ASSERT(sc); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(sc, 0, sizeof(*sc)); @@ -377,7 +377,7 @@ OSMO_ASSERT(scl); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(scl, 0, sizeof(*scl)); @@ -461,7 +461,7 @@ OSMO_ASSERT(ct); if (!elem) return -EINVAL; - if (len <= 0) + if (len < 3 || len > 11) return -EINVAL; memset(ct, 0, sizeof(*ct)); @@ -537,7 +537,7 @@ OSMO_ASSERT(ei); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(ei, 0, sizeof(*ei)); @@ -614,7 +614,7 @@ OSMO_ASSERT(cil); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(cil, 0, sizeof(*cil)); -- To view, visit https://gerrit.osmocom.org/2446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:38:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:38:50 +0000 Subject: [PATCH] libosmocore[master]: comments: gsm0808_utils: mention various 3GPP specs Message-ID: Review at https://gerrit.osmocom.org/3015 comments: gsm0808_utils: mention various 3GPP specs Tweaked-by: nhofmeyr Change-Id: I990dfe9eeaf96f377484b828143935240a937226 --- M src/gsm/gsm0808_utils.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/3015/1 diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index c636adf..210f64e 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -230,6 +230,7 @@ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc) { + /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t *old_tail; uint8_t *tlv_len; @@ -334,6 +335,7 @@ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl) { + /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t *old_tail; uint8_t *tlv_len; unsigned int i; @@ -369,6 +371,7 @@ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len) { + /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ const uint8_t *old_elem = elem; unsigned int i; int rc; @@ -412,6 +415,7 @@ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct) { + /*! See also 3GPP TS 48.008 3.2.2.11 Channel Type */ unsigned int i; uint8_t byte; uint8_t *old_tail; @@ -454,6 +458,7 @@ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len) { + /*! See also 3GPP TS 48.008 3.2.2.11 Channel Type */ unsigned int i; uint8_t byte; const uint8_t *old_elem = elem; -- To view, visit https://gerrit.osmocom.org/3015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I990dfe9eeaf96f377484b828143935240a937226 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:45:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:45:06 +0000 Subject: libosmocore[master]: comments: gsm0808_utils: mention various 3GPP specs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I990dfe9eeaf96f377484b828143935240a937226 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:45:09 +0000 Subject: libosmocore[master]: gsm0808: fix length check of the element decoder functions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter 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 Jun 22 22:45:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:45:14 +0000 Subject: [MERGED] libosmocore[master]: gsm0808: fix length check of the element decoder functions In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gsm0808: fix length check of the element decoder functions ...................................................................... gsm0808: fix length check of the element decoder functions The length check of the decoder functions is not entirely correct. The check also checks for values below zero, which does not make sense, since the length is encoded as uint8_t. For some elements a minimum length is known (in most cases this is 1), so checking for zero is sufficient but in some cases (e.g. channel type) the spec mentions a minimum and maximum length. This is now also reflected in the code. Tweaked-by: nhofmeyr Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6 --- M src/gsm/gsm0808_utils.c 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 00da04b..c636adf 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -104,7 +104,7 @@ OSMO_ASSERT(ss); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(ss, 0, sizeof(*ss)); @@ -261,7 +261,7 @@ OSMO_ASSERT(sc); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(sc, 0, sizeof(*sc)); @@ -377,7 +377,7 @@ OSMO_ASSERT(scl); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(scl, 0, sizeof(*scl)); @@ -461,7 +461,7 @@ OSMO_ASSERT(ct); if (!elem) return -EINVAL; - if (len <= 0) + if (len < 3 || len > 11) return -EINVAL; memset(ct, 0, sizeof(*ct)); @@ -537,7 +537,7 @@ OSMO_ASSERT(ei); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(ei, 0, sizeof(*ei)); @@ -614,7 +614,7 @@ OSMO_ASSERT(cil); if (!elem) return -EINVAL; - if (len <= 0) + if (len == 0) return -EINVAL; memset(cil, 0, sizeof(*cil)); -- To view, visit https://gerrit.osmocom.org/2446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter 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 Thu Jun 22 22:45:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:45:14 +0000 Subject: [MERGED] libosmocore[master]: comments: gsm0808_utils: mention various 3GPP specs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: comments: gsm0808_utils: mention various 3GPP specs ...................................................................... comments: gsm0808_utils: mention various 3GPP specs Tweaked-by: nhofmeyr Change-Id: I990dfe9eeaf96f377484b828143935240a937226 --- M src/gsm/gsm0808_utils.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index c636adf..210f64e 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -230,6 +230,7 @@ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc) { + /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t *old_tail; uint8_t *tlv_len; @@ -334,6 +335,7 @@ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl) { + /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t *old_tail; uint8_t *tlv_len; unsigned int i; @@ -369,6 +371,7 @@ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len) { + /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ const uint8_t *old_elem = elem; unsigned int i; int rc; @@ -412,6 +415,7 @@ uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct) { + /*! See also 3GPP TS 48.008 3.2.2.11 Channel Type */ unsigned int i; uint8_t byte; uint8_t *old_tail; @@ -454,6 +458,7 @@ int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len) { + /*! See also 3GPP TS 48.008 3.2.2.11 Channel Type */ unsigned int i; uint8_t byte; const uint8_t *old_elem = elem; -- To view, visit https://gerrit.osmocom.org/3015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I990dfe9eeaf96f377484b828143935240a937226 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:47:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:47:43 +0000 Subject: libosmo-sccp[master]: ss7: Fix compilation error (warning) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibcb3ebf9aaa7717cb553242517abce1499bc9c2a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: laforge Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 22 22:47:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 22 Jun 2017 22:47:45 +0000 Subject: [MERGED] libosmo-sccp[master]: ss7: Fix compilation error (warning) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ss7: Fix compilation error (warning) ...................................................................... ss7: Fix compilation error (warning) In osmo_ss7_route_create() as is only initalized if lset can not be initalized. If lset can be initalized, as will not be used so everything is fine. However, the compiler complains that as may not be initalized. Initalizing as to NULL solves the problem. Change-Id: Ibcb3ebf9aaa7717cb553242517abce1499bc9c2a --- M src/osmo_ss7.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 78b22a7..9477543 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -723,7 +723,7 @@ { struct osmo_ss7_route *rt; struct osmo_ss7_linkset *lset; - struct osmo_ss7_as *as; + struct osmo_ss7_as *as = NULL; OSMO_ASSERT(ss7_initialized); lset = osmo_ss7_linkset_find_by_name(rtbl->inst, linkset_name); -- To view, visit https://gerrit.osmocom.org/3002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibcb3ebf9aaa7717cb553242517abce1499bc9c2a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: laforge From gerrit-no-reply at lists.osmocom.org Fri Jun 23 00:18:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:25 +0000 Subject: [MERGED] libosmocore[master]: api doc typo fix in core/logging.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: api doc typo fix in core/logging.h ...................................................................... api doc typo fix in core/logging.h Change-Id: I3f1cd5b10e7beccb61f370d7f8fa2666e56542cf --- M include/osmocom/core/logging.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 4721713..bb5aa42 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -108,7 +108,7 @@ #define DLM3UA -16 /*!< Osmocom M3UA */ #define OSMO_NUM_DLIB 16 /*!< Number of logging sub-systems in libraries */ -/*! Configuration of singgle log category / sub-system */ +/*! Configuration of single log category / sub-system */ struct log_category { uint8_t loglevel; /*!< configured log-level */ uint8_t enabled; /*!< is logging enabled? */ -- To view, visit https://gerrit.osmocom.org/2985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f1cd5b10e7beccb61f370d7f8fa2666e56542cf 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 Fri Jun 23 00:18:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:27 +0000 Subject: [MERGED] libosmocore[master]: doxygen: config: one enum val per line In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: config: one enum val per line ...................................................................... doxygen: config: one enum val per line In the generated API doc, do not print multiple enum values on the same line, because this makes the lists pretty much unreadable. Change-Id: I63d6f42567f532851e19eb8a6c842e418ce666af --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gsm.in M Doxyfile.vty.in 5 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.codec.in b/Doxyfile.codec.in index 247a8b3..037ef7a 100644 --- a/Doxyfile.codec.in +++ b/Doxyfile.codec.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in index 9a0058d..43c4f82 100644 --- a/Doxyfile.coding.in +++ b/Doxyfile.coding.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.core.in b/Doxyfile.core.in index 2ca0ced..c47ff3c 100644 --- a/Doxyfile.core.in +++ b/Doxyfile.core.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index 742adc2..dbb5df6 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. diff --git a/Doxyfile.vty.in b/Doxyfile.vty.in index 917af09..0e138ee 100644 --- a/Doxyfile.vty.in +++ b/Doxyfile.vty.in @@ -1069,7 +1069,7 @@ # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 1 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. -- To view, visit https://gerrit.osmocom.org/2988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63d6f42567f532851e19eb8a6c842e418ce666af 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 Fri Jun 23 00:18:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:27 +0000 Subject: [MERGED] libosmocore[master]: doxygen: unify use of \file across the board In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: unify use of \file across the board ...................................................................... doxygen: unify use of \file across the board Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b --- M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/backtrace.h M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/crc16.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/crcgen.h M include/osmocom/core/defs.h M include/osmocom/core/endian.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/loggingrb.h M include/osmocom/core/macaddr.h M include/osmocom/core/msgb.h M include/osmocom/core/msgfile.h M include/osmocom/core/panic.h M include/osmocom/core/plugin.h M include/osmocom/core/prim.h M include/osmocom/core/process.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/serial.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/stats.h M include/osmocom/core/strrb.h M include/osmocom/core/talloc.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/crypt/gprs_cipher.h M include/osmocom/ctrl/control_cmd.h M include/osmocom/ctrl/control_if.h M include/osmocom/ctrl/control_vty.h M include/osmocom/ctrl/ports.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_bssgp_bss.h M include/osmocom/gprs/gprs_msgb.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_ns_frgre.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_04_60.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/apn.h M include/osmocom/gsm/bitvec_gsm.h M include/osmocom/gsm/comp128.h M include/osmocom/gsm/comp128v23.h M include/osmocom/gsm/gan.h M include/osmocom/gsm/gea.h 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 include/osmocom/gsm/gsm0480.h M include/osmocom/gsm/gsm0502.h M include/osmocom/gsm/gsm0808.h M include/osmocom/gsm/gsm0808_utils.h M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/gsm48.h M include/osmocom/gsm/gsm48_ie.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/gsup.h M include/osmocom/gsm/ipa.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/meas_rep.h M include/osmocom/gsm/mncc.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/prim.h M include/osmocom/gsm/protocol/gsm_03_40.h M include/osmocom/gsm/protocol/gsm_03_41.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M include/osmocom/gsm/protocol/gsm_04_11.h M include/osmocom/gsm/protocol/gsm_04_12.h M include/osmocom/gsm/protocol/gsm_04_14.h M include/osmocom/gsm/protocol/gsm_04_80.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_09_02.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/protocol/gsm_23_003.h M include/osmocom/gsm/protocol/gsm_44_318.h M include/osmocom/gsm/protocol/ipaccess.h M include/osmocom/gsm/protocol/smpp34_osmocom.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/rxlev_stat.h M include/osmocom/gsm/sysinfo.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/class_tables.h M include/osmocom/sim/sim.h M include/osmocom/vty/buffer.h M include/osmocom/vty/command.h M include/osmocom/vty/logging.h M include/osmocom/vty/misc.h M include/osmocom/vty/ports.h M include/osmocom/vty/stats.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vector.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm660.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/conv_acc.c M src/conv_acc_generic.c M src/conv_acc_sse.c M src/conv_acc_sse_avx.c M src/conv_acc_sse_impl.h M src/crc16.c M src/crcXXgen.c.tpl M src/ctrl/control_cmd.c M src/ctrl/control_if.c M src/ctrl/control_vty.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/common_vty.c M src/gb/common_vty.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_bssgp_util.c M src/gb/gprs_bssgp_vty.c M src/gb/gprs_ns.c M src/gb/gprs_ns_frgre.c M src/gb/gprs_ns_vty.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/apn.c M src/gsm/auth_comp128v1.c M src/gsm/auth_comp128v23.c M src/gsm/auth_core.c M src/gsm/auth_milenage.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_gea.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0414.c M src/gsm/gsm0480.c M src/gsm/gsm0502.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/kasumi.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/milenage/aes-encblock.c M src/gsm/milenage/aes-internal-enc.c M src/gsm/milenage/aes-internal.c M src/gsm/milenage/aes.h M src/gsm/milenage/aes_i.h M src/gsm/milenage/aes_wrap.h M src/gsm/milenage/common.h M src/gsm/milenage/milenage.c M src/gsm/milenage/milenage.h M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/rxlev_stat.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/msgfile.c M src/panic.c M src/plugin.c M src/prim.c M src/pseudotalloc/pseudotalloc.c M src/pseudotalloc/talloc.h M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/card_fs_isim.c M src/sim/card_fs_sim.c M src/sim/card_fs_tetra.c M src/sim/card_fs_uicc.c M src/sim/card_fs_usim.c M src/sim/class_tables.c M src/sim/core.c M src/sim/gsm_int.h M src/sim/reader.c M src/sim/reader_pcsc.c M src/sim/sim_int.h M src/socket.c M src/stat_item.c M src/statistics.c M src/stats.c M src/stats_statsd.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/buffer.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c M utils/osmo-arfcn.c M utils/osmo-auc-gen.c 251 files changed, 874 insertions(+), 867 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h index 3e9b688..3e62a01 100644 --- a/include/osmocom/codec/codec.h +++ b/include/osmocom/codec/codec.h @@ -1,3 +1,5 @@ +/*! \file codec.h */ + #pragma once #include diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index a9c59e4..a2d4115 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -1,3 +1,7 @@ +/*! \file gsm0503_coding.h + * GSM TS 05.03 coding + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \addtogroup coding * @{ - */ - -/*! \file gsm0503_coding.h - * GSM TS 05.03 coding - */ + * \file gsm0503_coding.h */ #define GSM0503_GPRS_BURSTS_NBITS (116 * 4) #define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index 1463fb3..05b5e27 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_interleaving.h + * GSM TS 05.03 interleaving. + */ + #pragma once #include /*! \addtogroup interleaving * @{ - */ - -/*! \file gsm0503_interleaving.h - * GSM TS 05.03 interleaving - */ + * \file gsm0503_interleaving.h */ void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB); void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB); diff --git a/include/osmocom/coding/gsm0503_mapping.h b/include/osmocom/coding/gsm0503_mapping.h index 435c913..fbd3bfd 100644 --- a/include/osmocom/coding/gsm0503_mapping.h +++ b/include/osmocom/coding/gsm0503_mapping.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_mapping.c + * GSM TS 05.03 burst mapping. + */ + #pragma once #include /*! \addtogroup mapping * @{ - */ - -/*! \file gsm0503_mapping.c - * GSM TS 05.03 burst mapping - */ + * \file gsm0503_mapping.h */ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn); diff --git a/include/osmocom/coding/gsm0503_parity.h b/include/osmocom/coding/gsm0503_parity.h index 2743bdb..28a5444 100644 --- a/include/osmocom/coding/gsm0503_parity.h +++ b/include/osmocom/coding/gsm0503_parity.h @@ -1,14 +1,14 @@ +/*! \file gsm0503_parity.h + * GSM TS 05.03 parity. + */ + #pragma once #include /*! \addtogroup parity * @{ - */ - -/*! \file gsm0503_parity.h - * GSM TS 05.03 parity - */ + * \file gsm0503_parity.h */ const struct osmo_crc64gen_code gsm0503_fire_crc40; const struct osmo_crc16gen_code gsm0503_cs234_crc16; diff --git a/include/osmocom/coding/gsm0503_tables.h b/include/osmocom/coding/gsm0503_tables.h index f8c43c6..55c4ebe 100644 --- a/include/osmocom/coding/gsm0503_tables.h +++ b/include/osmocom/coding/gsm0503_tables.h @@ -1,3 +1,7 @@ +/*! \file gsm0503_tables.h + * GSM TS 05.03 tables. + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \addtogroup tables * @{ - */ - -/*! \file gsm0503_tables.h - * GSM TS 05.03 tables - */ + * \file gsm0503_tables.h */ extern const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8]; extern const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8]; diff --git a/include/osmocom/core/backtrace.h b/include/osmocom/core/backtrace.h index 0c9b6ef..d661dd0 100644 --- a/include/osmocom/core/backtrace.h +++ b/include/osmocom/core/backtrace.h @@ -1,3 +1,5 @@ +/*! \file backtrace.h */ + #pragma once void osmo_generate_backtrace(void); diff --git a/include/osmocom/core/bitcomp.h b/include/osmocom/core/bitcomp.h index a184a1c..dc356bd 100644 --- a/include/osmocom/core/bitcomp.h +++ b/include/osmocom/core/bitcomp.h @@ -1,8 +1,7 @@ -#pragma once - -/* bit compression routines */ - -/* (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev +/*! \file bitcomp.h + * Osmocom bit compression routines. */ +/* + * (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev * * All Rights Reserved * @@ -22,13 +21,11 @@ * */ +#pragma once + /*! \defgroup bitcomp Bit compression * @{ - */ - -/*! \file bitcomp.h - * Osmocom bit compression routines - */ + * \file bitcomp.h */ #include #include diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 61af716..17fe1c6 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -1,3 +1,11 @@ +/*! \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 #include @@ -9,15 +17,7 @@ /*! \defgroup bits soft, unpacked and packed bits * @{ - */ - -/*! \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)) - */ + * \file bits.h */ typedef int8_t sbit_t; /*!< soft bit (-127...127) */ typedef uint8_t ubit_t; /*!< unpacked bit (0 or 1) */ diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 9187ce2..d4c7d68 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -1,7 +1,3 @@ -#pragma once - -/* bit vector utility routines */ - /* (C) 2009 by Harald Welte * (C) 2012 Ivan Klyuchnikov * (C) 2015 Sysmocom s.f.m.c. GmbH @@ -24,21 +20,11 @@ * */ +#pragma once + /*! \defgroup bitvec Bit vectors * @{ - */ - -/*! \file bitvec.h - * Osmocom bit vector abstraction - * - * These functions assume a MSB (most significant bit) first layout of the - * bits, so that for instance the 5 bit number abcde (a is MSB) can be - * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count - * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). - * Note that there are other incompatible encodings, like it is used - * for the EGPRS RLC data block headers (there the bits are numbered from LSB - * to MSB). - */ + * \file bitvec.h */ #include #include diff --git a/include/osmocom/core/byteswap.h b/include/osmocom/core/byteswap.h index 4274b8f..1ea5b3d 100644 --- a/include/osmocom/core/byteswap.h +++ b/include/osmocom/core/byteswap.h @@ -1,3 +1,5 @@ +/*! \file byteswap.h */ + #pragma once #include #include diff --git a/include/osmocom/core/conv.h b/include/osmocom/core/conv.h index 1888fe1..8b344f4 100644 --- a/include/osmocom/core/conv.h +++ b/include/osmocom/core/conv.h @@ -1,6 +1,6 @@ +/*! \file conv.h + * Osmocom convolutional encoder and decoder. */ /* - * conv.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -22,11 +22,7 @@ /*! \defgroup conv Convolutional encoding and decoding routines * @{ - */ - -/*! \file conv.h - * Osmocom convolutional encoder and decoder - */ + * \file conv.h */ #pragma once diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h index f1564bd..52807af 100644 --- a/include/osmocom/core/crc16.h +++ b/include/osmocom/core/crc16.h @@ -1,4 +1,4 @@ -/* +/*! \file crc16.h * This was copied from the linux kernel and adjusted for our types. */ /* diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl index 4718809..2c909f9 100644 --- a/include/osmocom/core/crcXXgen.h.tpl +++ b/include/osmocom/core/crcXXgen.h.tpl @@ -1,6 +1,6 @@ +/*! \file crcXXgen.h + * Osmocom generic CRC routines (for max XX bits poly) header. */ /* - * crcXXgen.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,12 +24,7 @@ /*! \addtogroup crcgen * @{ - */ - -/*! \file crcXXgen.h - * Osmocom generic CRC routines (for max XX bits poly) header - */ - + * \file crcXXgen.h.tpl */ #include #include diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h index b39b55d..d73e6e8 100644 --- a/include/osmocom/core/crcgen.h +++ b/include/osmocom/core/crcgen.h @@ -1,6 +1,6 @@ +/*! \file crcgen.h + * Osmocom generic CRC routines global header. */ /* - * crcgen.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,11 +24,7 @@ /*! \defgroup crcgen Osmocom generic CRC routines * @{ - */ - -/*! \file crcgen.h - * Osmocom generic CRC routines global header - */ + * \file crcgen.h */ #include #include diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index 88c41b9..5e5aa90 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -1,12 +1,12 @@ +/*! \file defs.h + * General definitions that are meant to be included from header files. + */ + #pragma once /*! \defgroup utils General-purpose utility functions * @{ - */ - -/*! \file defs.h - * General definitions that are meant to be included from header files. - */ + * \file defs.h */ /*! Check for gcc and version. * diff --git a/include/osmocom/core/endian.h b/include/osmocom/core/endian.h index 621f34e..6107b12 100644 --- a/include/osmocom/core/endian.h +++ b/include/osmocom/core/endian.h @@ -1,6 +1,5 @@ -#pragma once - -/** +/*! \file endian.h + * * GNU and FreeBSD have various ways to express the * endianess but none of them is similiar enough. This * will create two defines that allows to decide on the @@ -12,6 +11,8 @@ * */ +#pragma once + #if defined(__FreeBSD__) #include #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index fb182f3..2fbb250 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -1,3 +1,7 @@ +/*! \file fsm.h + * Finite State Machine + */ + #pragma once #include @@ -9,11 +13,7 @@ /*! \defgroup fsm Finite State Machine abstraction * @{ - */ - -/*! \file fsm.h - * Finite State Machine - */ + * \file fsm.h */ struct osmo_fsm_inst; diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index 0dc25bb..1e19315 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -1,8 +1,6 @@ -#pragma once - -/* gsmtap header, pseudo-header in front of the actua GSM payload */ - -/* GSMTAP is a generic header format for GSM protocol captures, +/*! \file gsmtap.h + * gsmtap header, pseudo-header in front of the actua GSM payload. + * GSMTAP is a generic header format for GSM protocol captures, * it uses the IANA-assigned UDP port number 4729 and carries * payload in various formats of GSM interfaces such as Um MAC * blocks or Um bursts. @@ -11,6 +9,8 @@ * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/) */ +#pragma once + #include /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index b60257e..59b81e5 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -6,8 +6,7 @@ /*! \defgroup gsmtap GSMTAP * @{ - */ -/*! \file gsmtap_util.h */ + * \file gsmtap_util.h */ uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id); diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index 5098c5f..cb753d1 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -1,11 +1,4 @@ -#pragma once - -/*! \defgroup linuxlist Simple doubly linked list implementation - * @{ - */ - -/*! - * \file linuxlist.h +/*! \file linuxlist.h * * Simple doubly linked list implementation. * @@ -16,6 +9,12 @@ * using the generic single-entry routines. */ +#pragma once + +/*! \defgroup linuxlist Simple doubly linked list implementation + * @{ + * \file linuxlist.h */ + #include #ifndef inline diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index bb5aa42..68a9c13 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -2,9 +2,7 @@ /*! \defgroup logging Osmocom logging framework * @{ - */ - -/*! \file logging.h */ + * \file logging.h */ #include #include diff --git a/include/osmocom/core/loggingrb.h b/include/osmocom/core/loggingrb.h index dcd7917..a9fb404 100644 --- a/include/osmocom/core/loggingrb.h +++ b/include/osmocom/core/loggingrb.h @@ -1,5 +1,3 @@ -#pragma once - /* (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * @@ -19,13 +17,11 @@ * */ +#pragma once /*! \defgroup loggingrb Osmocom ringbuffer-backed logging * @{ - */ - -/*! \file loggingrb.h - */ + * \file loggingrb.h */ struct log_info; diff --git a/include/osmocom/core/macaddr.h b/include/osmocom/core/macaddr.h index 8de6238..83f0bde 100644 --- a/include/osmocom/core/macaddr.h +++ b/include/osmocom/core/macaddr.h @@ -1,3 +1,5 @@ +/*! \file macaddr.h */ + #pragma once int osmo_macaddr_parse(uint8_t *out, const char *in); diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 7fad943..91b7ec7 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -27,9 +27,7 @@ /*! \defgroup msgb Message buffers * @{ - */ - -/*! \file msgb.h */ + * \file msgb.h */ #define MSGB_DEBUG diff --git a/include/osmocom/core/msgfile.h b/include/osmocom/core/msgfile.h index cab97b2..800b431 100644 --- a/include/osmocom/core/msgfile.h +++ b/include/osmocom/core/msgfile.h @@ -1,3 +1,4 @@ +/*! \file msgfile.h */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/include/osmocom/core/panic.h b/include/osmocom/core/panic.h index 92c557f..2bb4240 100644 --- a/include/osmocom/core/panic.h +++ b/include/osmocom/core/panic.h @@ -2,9 +2,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file panic.h */ + * \file panic.h */ #include diff --git a/include/osmocom/core/plugin.h b/include/osmocom/core/plugin.h index aef1dfc..6db8709 100644 --- a/include/osmocom/core/plugin.h +++ b/include/osmocom/core/plugin.h @@ -1,3 +1,5 @@ +/*! \file plugin.h */ + #pragma once int osmo_plugin_load_all(const char *directory); diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h index 7288ba6..88ae08b 100644 --- a/include/osmocom/core/prim.h +++ b/include/osmocom/core/prim.h @@ -2,9 +2,7 @@ /*! \defgroup prim Osmocom primitives * @{ - */ - -/*! \file prim.h */ + * \file prim.h */ #include #include diff --git a/include/osmocom/core/process.h b/include/osmocom/core/process.h index 1dde021..8cfca8a 100644 --- a/include/osmocom/core/process.h +++ b/include/osmocom/core/process.h @@ -1,2 +1,3 @@ +/*! \file process.h */ #warning "Update from osmocom/core/process.h to osmocom/core/application.h" #include diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index b75967a..74414e9 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -2,9 +2,7 @@ /*! \defgroup rate_ctr Rate counters * @{ - */ - -/*! \file rate_ctr.h */ + * \file rate_ctr.h */ #include diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index fe84c5b..9b5f372 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -1,3 +1,7 @@ +/*! \file select.h + * select loop abstraction. + */ + #pragma once #include @@ -5,11 +9,7 @@ /*! \defgroup select Select loop abstraction * @{ - */ - -/*! \file select.h - * select loop abstraction - */ + * \file select.h */ /*! Indicate interest in reading from the file descriptor */ #define BSC_FD_READ 0x0001 diff --git a/include/osmocom/core/sercomm.h b/include/osmocom/core/sercomm.h index cf15613..072f4d9 100644 --- a/include/osmocom/core/sercomm.h +++ b/include/osmocom/core/sercomm.h @@ -1,3 +1,7 @@ +/*! \file sercomm.h + * Osmocom Sercomm HDLC (de)multiplex. + */ + #ifndef _SERCOMM_H #define _SERCOMM_H @@ -5,11 +9,7 @@ /*! \defgroup sercomm Seriall Communications (HDLC) * @{ - */ - -/*! \file sercomm.h - * Osmocom Sercomm HDLC (de)multiplex - */ + * \file sercomm.h */ /*! A low sercomm_dlci means high priority. A high DLCI means low priority */ enum sercomm_dlci { diff --git a/include/osmocom/core/serial.h b/include/osmocom/core/serial.h index e3f7a9f..39614a4 100644 --- a/include/osmocom/core/serial.h +++ b/include/osmocom/core/serial.h @@ -1,6 +1,6 @@ +/*! \file serial.h + * Osmocom serial port helpers. */ /* - * serial.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -22,11 +22,7 @@ /*! \defgroup serial Utility functions to deal with serial ports * @{ - */ - -/*! \file serial.h - * Osmocom serial port helpers - */ + * \file serial.h */ #pragma once diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index d7132f9..ae78f15 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -4,8 +4,7 @@ /*! \defgroup signal Intra-application signals * @{ - */ -/*! \file signal.h */ + * \file signal.h */ /*! subsystem signaling numbers: we split the numberspace for * applications and libraries: from 0 to UINT_MAX/2 for applications, diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index d6a5662..d2118ef 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -1,12 +1,11 @@ +/*! \file socket.h + * Osmocom socket convenience functions. */ + #pragma once /*! \defgroup socket Socket convenience functions * @{ - */ - -/*! \file socket.h - * Osmocom socket convenience functions - */ + * \file socket.h */ #include diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 957918a..4cee8a8 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -2,9 +2,7 @@ /*! \defgroup osmo_stat_item Statistics value item * @{ - */ - -/*! \file stat_item.h */ + * \file stat_item.h */ #include diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 09b836a..161b34c 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -1,4 +1,6 @@ -/* (C) 2015 by Sysmocom s.f.m.c. GmbH +/*! \file stats.h */ +/* + * (C) 2015 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved * diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h index 2b4d89f..b87239d 100644 --- a/include/osmocom/core/strrb.h +++ b/include/osmocom/core/strrb.h @@ -1,6 +1,7 @@ -#pragma once - -/* (C) 2012-2013 by Katerina Barone-Adesi +/*! \file strrb.h + * Osmocom string ringbuffer handling routines. */ +/* + * (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -19,13 +20,11 @@ * */ +#pragma once + /*! \defgroup osmo_strrb Osmocom ringbuffers for log strings * @{ - */ - -/*! \file strrb.h - * Osmocom string ringbuffer handling routines - */ + * \file strrb.h */ #include #include diff --git a/include/osmocom/core/talloc.h b/include/osmocom/core/talloc.h index df7ea7f..191a463 100644 --- a/include/osmocom/core/talloc.h +++ b/include/osmocom/core/talloc.h @@ -1,4 +1,5 @@ -/* Convenience wrapper. libosmocore used to ship its own internal copy of +/*! \file talloc.h + * Convenience wrapper. libosmocore used to ship its own internal copy of * talloc, before libtalloc became a standard component on most systems */ #pragma once #include diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index a039ac8..40b39b9 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -1,3 +1,5 @@ +/*! \file timer.h + * Osmocom timer handling routines. */ /* * (C) 2008, 2009 by Holger Hans Peter Freyther * All Rights Reserved @@ -33,11 +35,7 @@ * - osmo_timers_update() will call the callbacks and * remove the timers. * @{ - */ - -/*! \file timer.h - * Osmocom timer handling routines. - */ + * \file timer.h */ #pragma once diff --git a/include/osmocom/core/timer_compat.h b/include/osmocom/core/timer_compat.h index 44259af..77d4ce0 100644 --- a/include/osmocom/core/timer_compat.h +++ b/include/osmocom/core/timer_compat.h @@ -1,3 +1,6 @@ +/*! \file timer_compat.h + * Compatibility header with some helpers + */ /* * (C) 2011 Sylvain Munaut * All Rights Reserved @@ -20,11 +23,7 @@ /*! \defgroup timer Osmocom timers * @{ - */ - -/*! \file timer_compat.h - * Compatibility header with some helpers - */ + * \file timer_compat.h */ #pragma once diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index ce49cbe..855e653 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -5,9 +5,7 @@ /*! \defgroup utils General-purpose utility functions * @{ - */ - -/*! \file utils.h */ + * \file utils.h */ /*! Determine number of elements in an array of static size */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/include/osmocom/core/write_queue.h b/include/osmocom/core/write_queue.h index 27d090d..2303f87 100644 --- a/include/osmocom/core/write_queue.h +++ b/include/osmocom/core/write_queue.h @@ -1,4 +1,5 @@ -/* Generic write queue implementation */ +/*! \file write_queue.h + * Generic write queue implementation */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves @@ -24,10 +25,7 @@ /*! \defgroup write_queue Osmocom msgb write queues * @{ - */ - -/*! \file write_queue.h - */ + * \file write_queue.h */ #include #include diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index af4ae15..2f88a3a 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -2,9 +2,7 @@ /*! \addtogroup auth * @{ - */ - -/*! \file auth.h */ + * \file auth.h */ #include diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index c302f10..20f0514 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -1,3 +1,5 @@ +/*! \file gprs_cipher.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 3cef9d8..77532e6 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -1,3 +1,5 @@ +/*! \file control_cmd.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h index 4cd3369..6e49742 100644 --- a/include/osmocom/ctrl/control_if.h +++ b/include/osmocom/ctrl/control_if.h @@ -1,3 +1,5 @@ +/*! \file control_if.h */ + #pragma once #include diff --git a/include/osmocom/ctrl/control_vty.h b/include/osmocom/ctrl/control_vty.h index d0ef69f..af9ee99 100644 --- a/include/osmocom/ctrl/control_vty.h +++ b/include/osmocom/ctrl/control_vty.h @@ -1,3 +1,5 @@ +/*! \file control_vty.h */ + #pragma once /* Add the 'ctrl' section to VTY, containing the 'bind' command. */ diff --git a/include/osmocom/ctrl/ports.h b/include/osmocom/ctrl/ports.h index d28066e..f974daf 100644 --- a/include/osmocom/ctrl/ports.h +++ b/include/osmocom/ctrl/ports.h @@ -1,6 +1,4 @@ -#pragma once - -/* +/*! \file ports.h * TCP port numbers used for CTRL interfaces in osmocom projects. See also the * osmocom wiki as well as the osmo-gsm-manuals, which should all be kept in * sync with this file: @@ -8,6 +6,8 @@ * https://git.osmocom.org/osmo-gsm-manuals/tree/common/chapters/port_numbers.adoc */ +#pragma once + #define OSMO_CTRL_PORT_BTS 4238 #define OSMO_CTRL_PORT_NITB_BSC 4249 #define OSMO_CTRL_PORT_BSC_NAT 4250 diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index 0e9f7d6..2dead69 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -1,3 +1,5 @@ +/*! \file gprs_bssgp.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index d79b210..9374e73 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -1,11 +1,7 @@ -#pragma once - -#include -#include - -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2012 by Harald Welte +/*! \file gprs_bssgp_bss.h + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ +/* + * (C) 2009-2012 by Harald Welte * * All Rights Reserved * @@ -24,6 +20,10 @@ * */ +#pragma once + +#include +#include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); diff --git a/include/osmocom/gprs/gprs_msgb.h b/include/osmocom/gprs/gprs_msgb.h index 9ccc9a5..43471e2 100644 --- a/include/osmocom/gprs/gprs_msgb.h +++ b/include/osmocom/gprs/gprs_msgb.h @@ -1,3 +1,5 @@ +/*! \file gprs_msgb.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 5ecaed8..938ad99 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -1,3 +1,5 @@ +/*! \file gprs_ns.h */ + #pragma once #include diff --git a/include/osmocom/gprs/gprs_ns_frgre.h b/include/osmocom/gprs/gprs_ns_frgre.h index 72ef7d1..d48ce08 100644 --- a/include/osmocom/gprs/gprs_ns_frgre.h +++ b/include/osmocom/gprs/gprs_ns_frgre.h @@ -1,3 +1,5 @@ +/*! \file gprs_ns_frgre.h */ + #pragma once int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg); diff --git a/include/osmocom/gprs/gprs_rlc.h b/include/osmocom/gprs/gprs_rlc.h index 5765281..05d3de6 100644 --- a/include/osmocom/gprs/gprs_rlc.h +++ b/include/osmocom/gprs/gprs_rlc.h @@ -1,3 +1,5 @@ +/*! \file gprs_rlc.h */ + #pragma once #include diff --git a/include/osmocom/gprs/protocol/gsm_04_60.h b/include/osmocom/gprs/protocol/gsm_04_60.h index 42028bd..96e9ab7 100644 --- a/include/osmocom/gprs/protocol/gsm_04_60.h +++ b/include/osmocom/gprs/protocol/gsm_04_60.h @@ -1,10 +1,11 @@ -#pragma once - -/* General Packet Radio Service (GPRS) +/*! \file gsm_04_60.h + * General Packet Radio Service (GPRS). * Radio Link Control / Medium Access Control (RLC/MAC) protocol * 3GPP TS 04.60 version 8.27.0 Release 1999 */ +#pragma once + #include #if OSMO_IS_LITTLE_ENDIAN == 1 diff --git a/include/osmocom/gprs/protocol/gsm_08_16.h b/include/osmocom/gprs/protocol/gsm_08_16.h index c3dbe69..fc74336 100644 --- a/include/osmocom/gprs/protocol/gsm_08_16.h +++ b/include/osmocom/gprs/protocol/gsm_08_16.h @@ -1,16 +1,15 @@ -#pragma once - -/* GPRS Networks Service (NS) messages on the Gb interface +/*! \file gsm_08_16.h + * GPRS Networks Service (NS) messages on the Gb interface. * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * 3GPP TS 48.016 version 6.5.0 Release 6 / ETSI TS 148 016 V6.5.0 (2005-11) */ + +#pragma once #include /*! \addtogroup libgb * @{ - */ - -/*! \file gprs_ns.h */ + * \file gprs_ns.h */ /*! Common header of GPRS NS */ struct gprs_ns_hdr { diff --git a/include/osmocom/gprs/protocol/gsm_08_18.h b/include/osmocom/gprs/protocol/gsm_08_18.h index 8bc9a8e..3179455 100644 --- a/include/osmocom/gprs/protocol/gsm_08_18.h +++ b/include/osmocom/gprs/protocol/gsm_08_18.h @@ -1,3 +1,5 @@ +/*! \file gsm_08_18.h */ + #pragma once #include diff --git a/include/osmocom/gsm/a5.h b/include/osmocom/gsm/a5.h index 893fb02..fae3fdd 100644 --- a/include/osmocom/gsm/a5.h +++ b/include/osmocom/gsm/a5.h @@ -1,6 +1,6 @@ +/*! \file gsm/a5.h + * Osmocom GSM A5 ciphering algorithm header. */ /* - * a5.h - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -29,11 +29,7 @@ /*! \defgroup a5 GSM A5 ciphering algorithm * @{ - */ - -/*! \file gsm/a5.h - * Osmocom GSM A5 ciphering algorithm header - */ + * \file a5.h */ /*! Converts a frame number into the 22 bit number used in A5/x * \param[in] fn The true framenumber diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index acddb7f..e031ee1 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -1,14 +1,12 @@ #pragma once -/*! \defgroup oml A-bis OML - * @{ - */ - #include #include #include -/*! \file abis_nm.h */ +/*! \defgroup oml A-bis OML + * @{ + * \file abis_nm.h */ extern const char abis_nm_ipa_magic[13]; extern const char abis_nm_osmo_magic[12]; diff --git a/include/osmocom/gsm/apn.h b/include/osmocom/gsm/apn.h index b4ece3a..8d35324 100644 --- a/include/osmocom/gsm/apn.h +++ b/include/osmocom/gsm/apn.h @@ -1,3 +1,5 @@ +/*! \file apn.h */ + #pragma once #include diff --git a/include/osmocom/gsm/bitvec_gsm.h b/include/osmocom/gsm/bitvec_gsm.h index 20741ef..32f0cd2 100644 --- a/include/osmocom/gsm/bitvec_gsm.h +++ b/include/osmocom/gsm/bitvec_gsm.h @@ -5,8 +5,7 @@ /*! \defgroup bitvec helpers for GSM * @{ - */ -/*! \file bitvec_gsm.h */ + * \file bitvec_gsm.h */ void bitvec_add_range1024(struct bitvec *bv, const struct gsm48_range_1024 *r); diff --git a/include/osmocom/gsm/comp128.h b/include/osmocom/gsm/comp128.h index 8ff76b1..8626f4b 100644 --- a/include/osmocom/gsm/comp128.h +++ b/include/osmocom/gsm/comp128.h @@ -1,5 +1,5 @@ -/* - * COMP128 header +/*! \file comp128.h + * COMP128 header. * * See comp128.c for details */ diff --git a/include/osmocom/gsm/comp128v23.h b/include/osmocom/gsm/comp128v23.h index 31d3933..affe8a2 100644 --- a/include/osmocom/gsm/comp128v23.h +++ b/include/osmocom/gsm/comp128v23.h @@ -1,5 +1,5 @@ -/* - * COMP128v23 header +/*! \file comp128v23.h + * COMP128v23 header. * * See comp128v23.c for details */ diff --git a/include/osmocom/gsm/gan.h b/include/osmocom/gsm/gan.h index 6f2b535..efede1d 100644 --- a/include/osmocom/gsm/gan.h +++ b/include/osmocom/gsm/gan.h @@ -1,3 +1,5 @@ +/*! \file gan.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gea.h b/include/osmocom/gsm/gea.h index 3051101..5c23d2a 100644 --- a/include/osmocom/gsm/gea.h +++ b/include/osmocom/gsm/gea.h @@ -1,5 +1,5 @@ -/* - * GEA3 header +/*! \file gea.h + * GEA3 header. * * See gea.c for details */ diff --git a/include/osmocom/gsm/gsm0341.h b/include/osmocom/gsm/gsm0341.h index 29ba3e1..2fc83e4 100644 --- a/include/osmocom/gsm/gsm0341.h +++ b/include/osmocom/gsm/gsm0341.h @@ -1,3 +1,5 @@ +/*! \file gsm0341.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 89964fa..0cd1f94 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_smc.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index bc908a7..19f9c5d 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_smr.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h index 7005010..1c51111 100644 --- a/include/osmocom/gsm/gsm0411_utils.h +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -1,3 +1,5 @@ +/*! \file gsm0411_utils.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 6ca23e9..672ffe5 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -1,3 +1,5 @@ +/*! \file gsm0480.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h index 6ee5a60..fe5cf7e 100644 --- a/include/osmocom/gsm/gsm0502.h +++ b/include/osmocom/gsm/gsm0502.h @@ -1,3 +1,5 @@ +/*! \file gsm0502.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 9be229c..4369cab 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -1,4 +1,6 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther +/*! \file gsm0808.h */ +/* + * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves * All Rights Reserved * diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 0937630..57ba171 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -1,4 +1,6 @@ -/* (C) 2016 by Sysmocom s.f.m.c. GmbH +/*! \file gsm0808_utils.h */ +/* + * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Philipp Maier diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 29e646c..2bc7583 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -1,4 +1,7 @@ +/*! \file gsm23003.h */ + #pragma once + #include /* 23.003 Chapter 12.1 */ diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 6a52c2d..424748e 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -1,3 +1,5 @@ +/*! \file gsm48.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h index 8445486..f7cc24e 100644 --- a/include/osmocom/gsm/gsm48_ie.h +++ b/include/osmocom/gsm/gsm48_ie.h @@ -1,3 +1,5 @@ +/*! \file gsm48_ie.h */ + #pragma once #include diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index e76d9ee..998f681 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -1,4 +1,5 @@ -/* GSM utility functions, e.g. coding and decoding */ +/*! \file gsm_utils.h + * GSM utility functions, e.g. coding and decoding. */ /* * (C) 2008 by Daniel Willmann * (C) 2009 by Holger Hans Peter Freyther diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 04b31d0..886ea5d 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -1,6 +1,7 @@ -/* Osmocom Generic Subscriber Update Protocol message encoder/decoder */ - -/* (C) 2014 by sysmocom s.f.m.c. GmbH, Author: Jacob Erlbeck +/*! \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 * All Rights Reserved * diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index cabee13..7e1d723 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -1,3 +1,5 @@ +/*! \file ipa.h */ + #pragma once #include diff --git a/include/osmocom/gsm/kasumi.h b/include/osmocom/gsm/kasumi.h index 222aece..d9de10b 100644 --- a/include/osmocom/gsm/kasumi.h +++ b/include/osmocom/gsm/kasumi.h @@ -1,5 +1,5 @@ -/* - * KASUMI header +/*! \file kasumi.h + * KASUMI header. * * See kasumi.c for details * The parameters are described in TS 135 202. diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 322c7ec..01f61ce 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -1,3 +1,5 @@ +/*! \file l1sap.h */ + #pragma once #include diff --git a/include/osmocom/gsm/lapd_core.h b/include/osmocom/gsm/lapd_core.h index 8d3a0f8..cfc357a 100644 --- a/include/osmocom/gsm/lapd_core.h +++ b/include/osmocom/gsm/lapd_core.h @@ -1,3 +1,6 @@ +/*! \file lapd_core.h + * primitive related stuff + */ #pragma once #include @@ -8,10 +11,7 @@ /*! \defgroup lapd LAPD implementation common part * @{ - */ - -/*! \file lapd_core.h - * primitive related stuff + * \file lapd_core.h */ /*! LAPD related primitives (L2<->L3 SAP)*/ diff --git a/include/osmocom/gsm/lapdm.h b/include/osmocom/gsm/lapdm.h index ec14cdd..e01d065 100644 --- a/include/osmocom/gsm/lapdm.h +++ b/include/osmocom/gsm/lapdm.h @@ -5,9 +5,7 @@ /*! \defgroup lapdm LAPDm implementation according to GSM TS 04.06 * @{ - */ - -/*! \file lapdm.h */ + * \file lapdm.h */ /*! LAPDm mode/role */ enum lapdm_mode { diff --git a/include/osmocom/gsm/meas_rep.h b/include/osmocom/gsm/meas_rep.h index 90c981d..79f9f06 100644 --- a/include/osmocom/gsm/meas_rep.h +++ b/include/osmocom/gsm/meas_rep.h @@ -1,3 +1,5 @@ +/*! \file meas_rep.h */ + #pragma once #include diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index 171db7a..f2450d9 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -1,3 +1,5 @@ +/*! \file mncc.h */ + #pragma once #include diff --git a/include/osmocom/gsm/oap.h b/include/osmocom/gsm/oap.h index fba22c7..ef83b79 100644 --- a/include/osmocom/gsm/oap.h +++ b/include/osmocom/gsm/oap.h @@ -1,6 +1,7 @@ -/* Osmocom Authentication Protocol message encoder/decoder */ - -/* (C) 2015-2016 by sysmocom s.f.m.c. GmbH +/*! \file oap.h + * Osmocom Authentication Protocol message encoder/decoder. */ +/* + * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Neels Hofmeyr diff --git a/include/osmocom/gsm/prim.h b/include/osmocom/gsm/prim.h index 5f61dc7..386b7d8 100644 --- a/include/osmocom/gsm/prim.h +++ b/include/osmocom/gsm/prim.h @@ -1,3 +1,5 @@ +/*! \file prim.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_03_40.h b/include/osmocom/gsm/protocol/gsm_03_40.h index 32d5c2c..a65203f 100644 --- a/include/osmocom/gsm/protocol/gsm_03_40.h +++ b/include/osmocom/gsm/protocol/gsm_03_40.h @@ -1,6 +1,7 @@ -#pragma once +/*! \file gsm_03_40.h + * GSM TS 03.40. */ -/* GSM TS 03.40 */ +#pragma once /** * 9.1.2.5 Type Of Number diff --git a/include/osmocom/gsm/protocol/gsm_03_41.h b/include/osmocom/gsm/protocol/gsm_03_41.h index 40051cd..2e0ad69 100644 --- a/include/osmocom/gsm/protocol/gsm_03_41.h +++ b/include/osmocom/gsm/protocol/gsm_03_41.h @@ -1,3 +1,6 @@ +/*! \file gsm_03_41.h + * GSM TS 03.41 definitions also TS 23.041. */ + #pragma once #include @@ -8,8 +11,6 @@ #ifndef OSMO_IS_LITTLE_ENDIAN #define OSMO_IS_LITTLE_ENDIAN 0 #endif - -/* GSM TS 03.41 definitions also TS 23.041*/ #define GSM341_MAX_PAYLOAD (GSM412_MSG_LEN-sizeof(struct gsm341_ms_message)) #define GSM341_MAX_CHARS (GSM341_MAX_PAYLOAD*8/7) diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 90b6cf1..643f046 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1,3 +1,6 @@ +/*! \file gsm_04_08.h + * GSM TS 04.08 definitions. */ + #pragma once #include @@ -6,7 +9,6 @@ #include #include -/* GSM TS 04.08 definitions */ struct gsm_lchan; /* Chapter 10.5.1.5 */ diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index def8dfc..13820a7 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_08_gprs.h */ + #ifndef _GSM48_GPRS_H #define _GSM48_GPRS_H diff --git a/include/osmocom/gsm/protocol/gsm_04_11.h b/include/osmocom/gsm/protocol/gsm_04_11.h index 651adca..31f25ac 100644 --- a/include/osmocom/gsm/protocol/gsm_04_11.h +++ b/include/osmocom/gsm/protocol/gsm_04_11.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_11.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_04_12.h b/include/osmocom/gsm/protocol/gsm_04_12.h index 30d6e4f..826e69b 100644 --- a/include/osmocom/gsm/protocol/gsm_04_12.h +++ b/include/osmocom/gsm/protocol/gsm_04_12.h @@ -1,8 +1,9 @@ +/*! \file gsm_04_12.h + * GSM TS 04.12 definitions for Short Message Service Cell Broadcast. */ + #pragma once #include - -/* GSM TS 04.12 definitions for Short Message Service Cell Broadcast */ #define GSM412_MSG_LEN 88 /* TS 04.12 Section 3.1 */ #define GSM412_BLOCK_LEN 22 /* TS 04.12 Section 3.1 */ diff --git a/include/osmocom/gsm/protocol/gsm_04_14.h b/include/osmocom/gsm/protocol/gsm_04_14.h index 421b56f..6f7d92c 100644 --- a/include/osmocom/gsm/protocol/gsm_04_14.h +++ b/include/osmocom/gsm/protocol/gsm_04_14.h @@ -1,3 +1,5 @@ +/*! \file gsm_04_14.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/gsm_04_80.h b/include/osmocom/gsm/protocol/gsm_04_80.h index 2aebb46..e204c50 100644 --- a/include/osmocom/gsm/protocol/gsm_04_80.h +++ b/include/osmocom/gsm/protocol/gsm_04_80.h @@ -1,6 +1,7 @@ -#pragma once +/*! \file gsm_04_80.h + * GSM TS 04.80 definitions (Supplementary Services Specification, Formats and Coding). */ -/* GSM TS 04.80 definitions (Supplementary Services Specification, Formats and Coding) */ +#pragma once /* Section 3.4 */ #define GSM0480_MTYPE_RELEASE_COMPLETE 0x2A diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index c76cf3b..bc70b93 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -1,9 +1,8 @@ -#pragma once - -/* GSM Radio Signalling Link messages on the A-bis interface +/*! \file gsm_08_58.h + * GSM Radio Signalling Link messages on the A-bis interface. * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ - -/* (C) 2008 by Harald Welte +/* + * (C) 2008 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -22,13 +21,13 @@ * */ +#pragma once + #include /*! \addtogroup rsl * @{ - */ - -/*! \file gsm_08_58.h */ + * \file gsm_08_58.h */ /*! RSL common header */ struct abis_rsl_common_hdr { diff --git a/include/osmocom/gsm/protocol/gsm_09_02.h b/include/osmocom/gsm/protocol/gsm_09_02.h index 3f68b45..0b54fb7 100644 --- a/include/osmocom/gsm/protocol/gsm_09_02.h +++ b/include/osmocom/gsm/protocol/gsm_09_02.h @@ -1,7 +1,8 @@ +/*! \file gsm_09_02.h + * GSM TS 09.02 definitions (MAP). */ + #ifndef PROTO_GSM_09_02_H #define PROTO_GSM_09_02_H - -/* GSM TS 09.02 definitions (MAP) */ /* Section 17.7.4 */ /* SS-Status */ diff --git a/include/osmocom/gsm/protocol/gsm_12_21.h b/include/osmocom/gsm/protocol/gsm_12_21.h index 1bdee9c..3ef3603 100644 --- a/include/osmocom/gsm/protocol/gsm_12_21.h +++ b/include/osmocom/gsm/protocol/gsm_12_21.h @@ -1,9 +1,5 @@ -#pragma once - -/* GSM Network Management messages on the A-bis interface - * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ - -/* (C) 2008-2009 by Harald Welte +/* + * (C) 2008-2009 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -22,11 +18,11 @@ * */ +#pragma once + /*! \addtogroup oml * @{ - */ - -/*! \file gsm_12_21.h */ + * \file gsm_12_21.h */ #include #include diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index a2109b6..94243fe 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -1,3 +1,5 @@ +/*! \file gsm_23_003.h */ + #pragma once /* Chapter 2.2 */ diff --git a/include/osmocom/gsm/protocol/gsm_44_318.h b/include/osmocom/gsm/protocol/gsm_44_318.h index 5d7f878..76e8396 100644 --- a/include/osmocom/gsm/protocol/gsm_44_318.h +++ b/include/osmocom/gsm/protocol/gsm_44_318.h @@ -1,8 +1,9 @@ +/*! \file gsm_44_318.h + * Definitions according to 3GPP TS 44.318 6.8.0 Release 6. */ + #pragma once #include - -/* Definitions according to 3GPP TS 44.318 6.8.0 Release 6 */ /* Table 11.1.1.2.1: Protocol Discriminator */ enum gan_pdisc { diff --git a/include/osmocom/gsm/protocol/ipaccess.h b/include/osmocom/gsm/protocol/ipaccess.h index ba6cb3b..0f5d54f 100644 --- a/include/osmocom/gsm/protocol/ipaccess.h +++ b/include/osmocom/gsm/protocol/ipaccess.h @@ -1,3 +1,5 @@ +/*! \file ipaccess.h */ + #pragma once #include diff --git a/include/osmocom/gsm/protocol/smpp34_osmocom.h b/include/osmocom/gsm/protocol/smpp34_osmocom.h index cff6adb..7c72ac8 100644 --- a/include/osmocom/gsm/protocol/smpp34_osmocom.h +++ b/include/osmocom/gsm/protocol/smpp34_osmocom.h @@ -1,5 +1,7 @@ +/*! \file smpp34_osmocom.h + * Osmocom SMPP extensions. */ + #pragma once -/* Osmocom SMPP extensions */ /* Osmocom specific new TLV definitions */ diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 93e27a1..3d9c66f 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -7,9 +7,7 @@ /*! \defgroup rsl RSL * @{ - */ - -/*! \file rsl.h */ + * \file rsl.h */ void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type); diff --git a/include/osmocom/gsm/rxlev_stat.h b/include/osmocom/gsm/rxlev_stat.h index 7183b17..7aa35cd 100644 --- a/include/osmocom/gsm/rxlev_stat.h +++ b/include/osmocom/gsm/rxlev_stat.h @@ -1,3 +1,5 @@ +/*! \file rxlev_stat.h */ + #pragma once #define NUM_RXLEVS 32 diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index f3e0f22..8e26f99 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -1,3 +1,5 @@ +/*! \file sysinfo.h */ + #pragma once #include diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index fa3b656..c356840 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -9,8 +9,7 @@ /*! \defgroup tlv GSM L3 compatible TLV parser * @{ - */ -/*! \file tlv.h */ + * \file tlv.h */ /* Terminology / wording tag length value (in bits) diff --git a/include/osmocom/sim/class_tables.h b/include/osmocom/sim/class_tables.h index ad89d94..d5be39d 100644 --- a/include/osmocom/sim/class_tables.h +++ b/include/osmocom/sim/class_tables.h @@ -1,7 +1,6 @@ -#pragma once - -/* simtrace - tables determining APDU case for card emulation - * +/*! \file class_tables.h + * simtrace - tables determining APDU case for card emulation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -18,6 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#pragma once + #include struct osim_cla_ins_case { diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h index eb95480..680cad1 100644 --- a/include/osmocom/sim/sim.h +++ b/include/osmocom/sim/sim.h @@ -1,3 +1,7 @@ +/*! \file sim.h + * Routines for helping with SIM (ISO/IEC 7816-4 more generally) communication. + */ + #ifndef _OSMOCOM_SIM_H #define _OSMOCOM_SIM_H @@ -5,11 +9,6 @@ #include #define APDU_HDR_LEN 5 - -/*! - * \file sim.h - * Routines for helping with SIM (ISO/IEC 7816-4 more generally) communication. - */ /*! command-response pairs cases * diff --git a/include/osmocom/vty/buffer.h b/include/osmocom/vty/buffer.h index 56c28f0..b5cce8a 100644 --- a/include/osmocom/vty/buffer.h +++ b/include/osmocom/vty/buffer.h @@ -1,5 +1,6 @@ +/*! \file buffer.h + * Buffering to output and input. */ /* - * Buffering to output and input. * Copyright (C) 1998 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 9a072d7..0fa5175 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -1,5 +1,6 @@ +/*! \file command.h + * Zebra configuration command interface routine. */ /* - * Zebra configuration command interface routine * Copyright (C) 1997, 98 Kunihiro Ishiguro * * This file is part of GNU Zebra. @@ -28,8 +29,7 @@ /*! \defgroup command VTY Command * @{ - */ -/*! \file command.h */ + * \file command.h */ /*! Host configuration variable */ struct host { diff --git a/include/osmocom/vty/logging.h b/include/osmocom/vty/logging.h index 544d117..9bafb98 100644 --- a/include/osmocom/vty/logging.h +++ b/include/osmocom/vty/logging.h @@ -1,3 +1,5 @@ +/*! \file logging.h */ + #pragma once #define LOGGING_STR "Configure log message to this terminal\n" diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index b3fb644..545955c 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -1,3 +1,5 @@ +/*! \file misc.h */ + #pragma once #include diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index a6043b3..8f8ef75 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -1,6 +1,4 @@ -#pragma once - -/* +/*! \file ports.h * TCP port numbers used for VTY interfaces in osmocom projects. See also the * osmocom wiki as well as the osmo-gsm-manuals, which should all be kept in * sync with this file: @@ -8,6 +6,8 @@ * https://git.osmocom.org/osmo-gsm-manuals/tree/common/chapters/port_numbers.adoc */ +#pragma once + /* 4238 used by osmo-bts control interface */ #define OSMO_VTY_PORT_STP 4239 #define OSMO_VTY_PORT_PCU 4240 /* also: osmo_pcap_client */ diff --git a/include/osmocom/vty/stats.h b/include/osmocom/vty/stats.h index 3851b4d..7629928 100644 --- a/include/osmocom/vty/stats.h +++ b/include/osmocom/vty/stats.h @@ -1,3 +1,5 @@ +/*! \file stats.h */ + #pragma once void osmo_stats_vty_add_cmds(); diff --git a/include/osmocom/vty/telnet_interface.h b/include/osmocom/vty/telnet_interface.h index bca9156..d653466 100644 --- a/include/osmocom/vty/telnet_interface.h +++ b/include/osmocom/vty/telnet_interface.h @@ -1,5 +1,7 @@ -/* minimalistic telnet/network interface it might turn into a wire interface */ -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file telnet_interface.h + * minimalistic telnet/network interface it might turn into a wire interface */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -27,9 +29,7 @@ /*! \defgroup telnet_interface Telnet Interface * @{ - */ - -/*! \file telnet_interface.h */ + * \file telnet_interface.h */ /*! A telnet connection */ struct telnet_connection { diff --git a/include/osmocom/vty/vector.h b/include/osmocom/vty/vector.h index c00804d..0a639ad 100644 --- a/include/osmocom/vty/vector.h +++ b/include/osmocom/vty/vector.h @@ -1,5 +1,6 @@ +/*! \file vector.h + * Generic vector interface header. */ /* - * Generic vector interface header. * Copyright (C) 1997, 98 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index d59f5d4..544e1fa 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -5,8 +5,7 @@ /*! \defgroup vty VTY (Virtual TTY) interface * @{ - */ -/*! \file vty.h */ + * \file vty.h */ /* GCC have printf type attribute check. */ #ifdef __GNUC__ diff --git a/src/application.c b/src/application.c index e7c8e0f..aec3fd7 100644 --- a/src/application.c +++ b/src/application.c @@ -1,4 +1,5 @@ -/* Utility functions to setup applications */ +/*! \file application.c + * Routines for helping with the osmocom application setup. */ /* * (C) 2010 by Harald Welte * (C) 2011 by Holger Hans Peter Freyther @@ -19,10 +20,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - */ - -/*! \file application.c - * Routines for helping with the osmocom application setup. */ /*! \mainpage libosmocore Documentation diff --git a/src/backtrace.c b/src/backtrace.c index 0240a75..5ce7482 100644 --- a/src/backtrace.c +++ b/src/backtrace.c @@ -1,3 +1,5 @@ +/*! \file backtrace.c + * Routines related to generating call back traces. */ /* * (C) 2009 by Holger Hans Peter Freyther * (C) 2012 by Harald Welte @@ -18,10 +20,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - */ - -/*! \file backtrace.c - * Routines realted to generating call back traces */ #include diff --git a/src/bitcomp.c b/src/bitcomp.c index acf165e..94f60eb 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -1,6 +1,7 @@ -/* bit compression routines */ - -/* (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev +/*! \file bitcomp.c + * Osmocom bit compression routines */ +/* + * (C) 2016 sysmocom s.f.m.c. GmbH by Max Suraev * * All Rights Reserved * @@ -22,11 +23,7 @@ /*! \defgroup bitcomp Bit compression * @{ - */ - -/*! \file bitcomp.c - * Osmocom bit compression routines - */ + * \file bitcomp.c */ #include #include diff --git a/src/bits.c b/src/bits.c index 45ac8e2..af09441 100644 --- a/src/bits.c +++ b/src/bits.c @@ -26,11 +26,9 @@ /*! \addtogroup bits * @{ - * Osmocom bit level support code - */ - -/*! \file bits.c */ - + * Osmocom bit level support code. + * + * \file bits.c */ /*! convert unpacked bits to packed bits, return length in bytes * \param[out] out output buffer of packed bits diff --git a/src/bitvec.c b/src/bitvec.c index 8ed7296..f07b42c 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -1,5 +1,3 @@ -/* bit vector utility routines */ - /* (C) 2009 by Harald Welte * (C) 2012 Ivan Klyuchnikov * (C) 2015 by Sysmocom s.f.m.c. GmbH @@ -24,10 +22,17 @@ /*! \addtogroup bitvec * @{ - * Osmocom bit vector abstraction - */ - -/*! \file bitvec.c */ + * Osmocom bit vector abstraction utility routines. + * + * These functions assume a MSB (most significant bit) first layout of the + * bits, so that for instance the 5 bit number abcde (a is MSB) can be + * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count + * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). + * Note that there are other incompatible encodings, like it is used + * for the EGPRS RLC data block headers (there the bits are numbered from LSB + * to MSB). + * + * \file bitvec.c */ #include #include diff --git a/src/codec/gsm610.c b/src/codec/gsm610.c index df56583..d5a2110 100644 --- a/src/codec/gsm610.c +++ b/src/codec/gsm610.c @@ -1,5 +1,5 @@ -/* GSM 06.10 - GSM FR codec */ - +/*! \file gsm610.c + * GSM 06.10 - GSM FR codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c index 3064748..b1a0b31 100644 --- a/src/codec/gsm620.c +++ b/src/codec/gsm620.c @@ -1,5 +1,5 @@ -/* GSM 06.20 - GSM HR codec */ - +/*! \file gsm620.c + * GSM 06.20 - GSM HR codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm660.c b/src/codec/gsm660.c index 6c9215f..2f5c6a2 100644 --- a/src/codec/gsm660.c +++ b/src/codec/gsm660.c @@ -1,5 +1,5 @@ -/* GSM 06.60 - GSM EFR Codec */ - +/*! \file gsm660.c + * GSM 06.60 - GSM EFR Codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c index 74655bf..1ee74d0 100644 --- a/src/codec/gsm690.c +++ b/src/codec/gsm690.c @@ -1,5 +1,5 @@ -/* GSM 06.90 - GSM AMR Codec */ - +/*! \file gsm690.c + * GSM 06.90 - GSM AMR Codec. */ /* * (C) 2010 Sylvain Munaut * diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index bb86b2c..5213dc5 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -100,9 +100,8 @@ * various other modules (mapping, parity, interleaving) in order to * implement the complete channel coding (and decoding) chain for the * various channel types as defined in TS 05.03 / 45.003. - */ - -/*! \file gsm0503_coding.c */ + * + * \file gsm0503_coding.c */ /* * EGPRS coding limits diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index 19e6847..b42f242 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -29,16 +29,12 @@ /*! \addtogroup interleaving * @{ - * GSM TS 05.03 interleaving + * GSM TS 05.03 interleaving * - * This module contains interleaving / de-interleaving routines for - * various channel types, as defined in 3GPP TS 05.03 / 45.003 - */ - -/*! \file gsm0503_interleaving.c */ - -/* - * GSM xCCH interleaving and burst mapping + * This module contains interleaving / de-interleaving routines for + * various channel types, as defined in 3GPP TS 05.03 / 45.003. + * + * GSM xCCH interleaving and burst mapping: * * Interleaving: * @@ -57,7 +53,30 @@ * e(B, 58) = h_n(B) * * Where hl(B) and hn(B) are bits in burst B indicating flags. - */ + * + * GSM TCH HR/AHS interleaving and burst mapping: + * + * Interleaving: + * + * Given 288 coded input bits, form 4 blocks of 114 bits, + * where even bits of the first 2 blocks and odd bits of the last 2 blocks + * are used: + * + * i(B, j) = c(n, k) k = 0, ..., 227 + * n = 0, ..., N, N + 1, ... + * B = B_0 + 2n + b + * j, b = table[k]; + * + * Mapping on Burst: + * + * e(B, j) = i(B, j) + * e(B, 59 + j) = i(B, 57 + j) j = 0, ..., 56 + * e(B, 57) = h_l(B) + * e(B, 58) = h_n(B) + * + * Where hl(B) and hn(B) are bits in burst B indicating flags. + * + * \file gsm0503_interleaving.c */ /*! De-Interleave burst bits according to TS 05.03 4.1.4 * \param[out] cB caller-allocated output buffer for 456 soft coded bits @@ -632,30 +651,6 @@ iB[B * 114 + j] = cB[k]; } } - -/* - * GSM TCH HR/AHS interleaving and burst mapping - * - * Interleaving: - * - * Given 288 coded input bits, form 4 blocks of 114 bits, - * where even bits of the first 2 blocks and odd bits of the last 2 blocks - * are used: - * - * i(B, j) = c(n, k) k = 0, ..., 227 - * n = 0, ..., N, N + 1, ... - * B = B_0 + 2n + b - * j, b = table[k]; - * - * Mapping on Burst: - * - * e(B, j) = i(B, j) - * e(B, 59 + j) = i(B, 57 + j) j = 0, ..., 56 - * e(B, 57) = h_l(B) - * e(B, 58) = h_n(B) - * - * Where hl(B) and hn(B) are bits in burst B indicating flags. - */ /*! GSM TCH HR/AHS De-Interleaving and burst mapping * \param[out] cB caller-allocated buffer for 228 unpacked output bits diff --git a/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 15fd1b6..d414769 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -32,9 +32,8 @@ * * This module contains burst mapping routines as specified in 3GPP TS * 05.03 / 45.003. - */ - -/*! \file gsm0503_mapping.c */ + * + * \file gsm0503_mapping.c */ void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn) diff --git a/src/coding/gsm0503_parity.c b/src/coding/gsm0503_parity.c index cc81702..b57caa3 100644 --- a/src/coding/gsm0503_parity.c +++ b/src/coding/gsm0503_parity.c @@ -31,9 +31,8 @@ * * This module contains parity/crc code definitions for the various * parity/crc schemes as defined in 3GPP TS 05.03 / 45.003 - */ - -/*! \file gsm0503_parity.c */ + * + * \file gsm0503_parity.c */ /*! GSM (SACCH) parity (FIRE code) * diff --git a/src/coding/gsm0503_tables.c b/src/coding/gsm0503_tables.c index 32d12ea..dda8cad 100644 --- a/src/coding/gsm0503_tables.c +++ b/src/coding/gsm0503_tables.c @@ -27,14 +27,13 @@ /*! \addtogroup tables * @{ * - * GSM TS 05.03 tables + * GSM TS 05.03 tables. * * This module contains various tables defining parts of 3GPP TS 05.03 * / 45.003, primarily for the purpose of (de)puncturing, interleaving, * etc. - */ - -/*! \file gsm0503_tables.c */ + * + * \file gsm0503_tables.c */ const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8] = { { 1,1, 1,1, 1,1, 1,1 }, diff --git a/src/conv.c b/src/conv.c index 38ce173..420acca 100644 --- a/src/conv.c +++ b/src/conv.c @@ -1,8 +1,6 @@ +/*! \file conv.c + * Generic convolutional encoding / decoding. */ /* - * conv.c - * - * Generic convolutional encoding / decoding - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,10 +22,10 @@ /*! \addtogroup conv * @{ - * Osmocom convolutional encoder and decoder - */ + * Osmocom convolutional encoder and decoder. + * + * \file conv.c */ -/*! \file conv.c */ #include "config.h" #ifdef HAVE_ALLOCA_H #include diff --git a/src/conv_acc.c b/src/conv_acc.c index 13b220b..048bbb1 100644 --- a/src/conv_acc.c +++ b/src/conv_acc.c @@ -1,6 +1,6 @@ +/*! \file conv_acc.c + * Accelerated Viterbi decoder implementation. */ /* - * Accelerated Viterbi decoder implementation - * * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_generic.c b/src/conv_acc_generic.c index a4787e3..228f3e2 100644 --- a/src/conv_acc_generic.c +++ b/src/conv_acc_generic.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_generic.c * Accelerated Viterbi decoder implementation - * for generic architectures without SSE support - * + * for generic architectures without SSE support. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse.c b/src/conv_acc_sse.c index bcc9d48..e9bbde1 100644 --- a/src/conv_acc_sse.c +++ b/src/conv_acc_sse.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_sse.c * Accelerated Viterbi decoder implementation - * for architectures with only SSE3 available - * + * for architectures with only SSE3 available. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse_avx.c b/src/conv_acc_sse_avx.c index 2ad353a..c399719 100644 --- a/src/conv_acc_sse_avx.c +++ b/src/conv_acc_sse_avx.c @@ -1,7 +1,7 @@ -/* +/*! \file conv_acc_sse_avx.c * Accelerated Viterbi decoder implementation - * for architectures with both SSE3 and AVX2 support - * + * for architectures with both SSE3 and AVX2 support. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/conv_acc_sse_impl.h b/src/conv_acc_sse_impl.h index a62f910..e6eaaa6 100644 --- a/src/conv_acc_sse_impl.h +++ b/src/conv_acc_sse_impl.h @@ -1,8 +1,8 @@ -/* - * Accelerated Viterbi decoder implementation +/*! \file conv_acc_sse_impl.h + * Accelerated Viterbi decoder implementation: * Actual definitions which are being included - * from both conv_acc_sse.c and conv_acc_sse_avx.c - * + * from both conv_acc_sse.c and conv_acc_sse_avx.c. */ +/* * Copyright (C) 2013, 2014 Thomas Tsou * * All Rights Reserved diff --git a/src/crc16.c b/src/crc16.c index 7d523b6..b5cb956 100644 --- a/src/crc16.c +++ b/src/crc16.c @@ -1,4 +1,4 @@ -/* +/*! \file crc16.c * This was copied from the linux kernel and adjusted for our types. */ /* diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index 9c63052..e92a538 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -1,8 +1,6 @@ +/*! \file crcXXgen.c + * Osmocom generic CRC routines (for max XX bits poly). */ /* - * crcXXgen.c - * - * Generic CRC routines (for max XX bits poly) - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -24,12 +22,9 @@ /*! \addtogroup crcgen * @{ - * Osmocom generic CRC routines - */ - -/*! \file crcXXgen.c - * Osmocom generic CRC routines (for max XX bits poly) - */ + * Osmocom generic CRC routines (for max XX bits poly). + * + * \file crcXXgen.c.tpl */ #include diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index d706995..836bb71 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -1,5 +1,6 @@ -/* SNMP-like status interface - * +/*! \file control_cmd.c + * SNMP-like status interface. */ +/* * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves * diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 5d04cdf..47efb25 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -1,5 +1,6 @@ -/* SNMP-like status interface - * +/*! \file control_if.c + * SNMP-like status interface. */ +/* * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves * diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index a67dbe2..a968bc0 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -1,5 +1,6 @@ -/* VTY configuration for Control interface - * +/*! \file control_vty.c + * VTY configuration for Control interface. */ +/* * (C) 2016 by sysmocom s.m.f.c. GmbH * * All Rights Reserved diff --git a/src/ctrl/fsm_ctrl_commands.c b/src/ctrl/fsm_ctrl_commands.c index 6c3ecde..38fbd1e 100644 --- a/src/ctrl/fsm_ctrl_commands.c +++ b/src/ctrl/fsm_ctrl_commands.c @@ -1,3 +1,5 @@ +/*! \file fsm_ctrl_commands.c */ + #include #include diff --git a/src/fsm.c b/src/fsm.c index 27389a7..d62fd79 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -1,5 +1,6 @@ -/* Osmocom generic Finite State Machine implementation - * +/*! \file fsm.c + * Osmocom generic Finite State Machine implementation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -82,9 +83,8 @@ * * In order to attach private state to the \ref osmo_fsm_inst, it * offers an opaque priv pointer. - */ - -/*! \file fsm.c */ + * + * \file fsm.c */ LLIST_HEAD(osmo_g_fsms); static bool fsm_log_addr = true; diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c index 5848a11..5de5135 100644 --- a/src/gb/common_vty.c +++ b/src/gb/common_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC VTY common helpers */ -/* (C) 2009-2012 by Harald Welte +/*! \file common_vty.c + * OpenBSC VTY common helpers. */ +/* + * (C) 2009-2012 by Harald Welte * (C) 2009-2010 by Holger Hans Peter Freyther * All Rights Reserved * diff --git a/src/gb/common_vty.h b/src/gb/common_vty.h index 8c6b9ab..a0674a7 100644 --- a/src/gb/common_vty.h +++ b/src/gb/common_vty.h @@ -1,3 +1,5 @@ +/*! \file common_vty.h */ + #include #include diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 142f589..518198f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index f41c4a4..d9f04c5 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp_bss.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c index 88916c1..78a11a3 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -1,6 +1,7 @@ -/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */ - -/* (C) 2009-2017 by Harald Welte +/*! \file gprs_bssgp_util.c + * GPRS BSSGP protocol implementation as per 3GPP TS 08.18. */ +/* + * (C) 2009-2017 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f3f354c..703d130 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -1,6 +1,7 @@ -/* VTY interface for our GPRS BSS Gateway Protocol (BSSGP) implementation */ - -/* (C) 2010 by Harald Welte +/*! \file gprs_bssgp_vty.c + * VTY interface for our GPRS BSS Gateway Protocol (BSSGP) implementation. */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 51d1c3c..d20ed23 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1,7 +1,8 @@ -/* GPRS Networks Service (NS) messages on the Gb interface - * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) */ - -/* (C) 2009-2012 by Harald Welte +/*! \file gprs_ns.c + * GPRS Networks Service (NS) messages on the Gb interface. + * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05). */ +/* + * (C) 2009-2012 by Harald Welte * * All Rights Reserved * @@ -22,11 +23,7 @@ /*! \addtogroup libgb * @{ - */ - -/*! \file gprs_ns.c */ - -/*! + * * GPRS Networks Service (NS) messages on the Gb interface * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * @@ -36,30 +33,31 @@ * do much, apart from providing congestion notification and status indication. * * Terms: - * NS Network Service - * NSVC NS Virtual Connection - * NSEI NS Entity Identifier - * NSVL NS Virtual Link - * NSVLI NS Virtual Link Identifier - * BVC BSSGP Virtual Connection - * BVCI BSSGP Virtual Connection Identifier - * NSVCG NS Virtual Connection Goup - * Blocked NS-VC cannot be used for user traffic - * Alive Ability of a NS-VC to provide communication * - * There can be multiple BSSGP virtual connections over one (group of) NSVC's. BSSGP will + * NS Network Service + * NSVC NS Virtual Connection + * NSEI NS Entity Identifier + * NSVL NS Virtual Link + * NSVLI NS Virtual Link Identifier + * BVC BSSGP Virtual Connection + * BVCI BSSGP Virtual Connection Identifier + * NSVCG NS Virtual Connection Goup + * Blocked NS-VC cannot be used for user traffic + * Alive Ability of a NS-VC to provide communication + * + * There can be multiple BSSGP virtual connections over one (group of) NSVC's. BSSGP will * therefore identify the BSSGP virtual connection by a BVCI passed down to NS. * NS then has to firgure out which NSVC's are responsible for this BVCI. * Those mappings are administratively configured. - */ - -/* This implementation has the following limitations: - * o Only one NS-VC for each NSE: No load-sharing function - * o NSVCI 65535 and 65534 are reserved for internal use - * o Only UDP is supported as of now, no frame relay support - * o The IP Sub-Network-Service (SNS) as specified in 48.016 is not implemented - * o There are no BLOCK and UNBLOCK timers (yet?) - */ + * + * This implementation has the following limitations: + * - Only one NS-VC for each NSE: No load-sharing function + * - NSVCI 65535 and 65534 are reserved for internal use + * - Only UDP is supported as of now, no frame relay support + * - The IP Sub-Network-Service (SNS) as specified in 48.016 is not implemented + * - There are no BLOCK and UNBLOCK timers (yet?) + * + * \file gprs_ns.c */ #include #include diff --git a/src/gb/gprs_ns_frgre.c b/src/gb/gprs_ns_frgre.c index 285a9a0..52145ff 100644 --- a/src/gb/gprs_ns_frgre.c +++ b/src/gb/gprs_ns_frgre.c @@ -1,9 +1,9 @@ -/* GPRS Networks Service (NS) messages on the Gb interface - * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) */ - -/* NS-over-FR-over-GRE implementation */ - -/* (C) 2009-2010 by Harald Welte +/*! \file gprs_ns_frgre.c + * NS-over-FR-over-GRE implementation. + * GPRS Networks Service (NS) messages on the Gb interface, + * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05). */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index bdccb3f..e320ba2 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -1,6 +1,7 @@ -/* VTY interface for our GPRS Networks Service (NS) implementation */ - -/* (C) 2009-2010 by Harald Welte +/*! \file gprs_ns_vty.c + * VTY interface for our GPRS Networks Service (NS) implementation. */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/a5.c b/src/gsm/a5.c index f21554f..e906b6d 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -1,12 +1,11 @@ -/* - * a5.c - * - * Full reimplementation of A5/1,2 (split and threadsafe) +/*! \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 * * All Rights Reserved @@ -29,9 +28,8 @@ /*! \addtogroup crypto * @{ * Osmocom GSM/GPRS ciphering algorithm implementation - */ - -/*! \file gsm/a5.c */ + * + * \file gsm/a5.c */ #include #include diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 287973b..c59ebb7 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -1,7 +1,5 @@ -/* GSM Network Management (OML) messages on the A-bis interface - * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ - -/* (C) 2008-2011 by Harald Welte +/* + * (C) 2008-2011 by Harald Welte * * All Rights Reserved * @@ -22,11 +20,10 @@ /*! \addtogroup oml * @{ - * GSM Network Management (OML) messages on the A-bis interface + * GSM Network Management (OML) messages on the A-bis interface. * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 - */ - -/*! \file abis_nm.c */ + * + * \file abis_nm.c */ #include #include diff --git a/src/gsm/apn.c b/src/gsm/apn.c index ccf36b9..8d4b2bf 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -1,3 +1,5 @@ +/*! \file apn.c */ + #include #include #include diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index 3b645d2..1dddef3 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -1,7 +1,7 @@ - -/* GSM/GPRS/3G authentication core infrastructure */ - -/* (C) 2010-2011 by Harald Welte +/*! \file auth_comp128v1.c + * GSM/GPRS/3G authentication core infrastructure */ +/* + * (C) 2010-2011 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/auth_comp128v23.c b/src/gsm/auth_comp128v23.c index b0900af..4d23769 100644 --- a/src/gsm/auth_comp128v23.c +++ b/src/gsm/auth_comp128v23.c @@ -1,9 +1,8 @@ -/* registers COMP128 version 2 and 3 A3/A8 algorithms for the - * GSM/GPRS/3G authentication core infrastructure - * - */ - -/* (C) 2010-2011 by Harald Welte +/*! \file auth_comp128v23.c + * registers COMP128 version 2 and 3 A3/A8 algorithms for the + * GSM/GPRS/3G authentication core infrastructure. */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2013 by K?vin Redon * * All Rights Reserved diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index 1bdd4a8..4156695 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -1,5 +1,3 @@ -/* GSM/GPRS/3G authentication core infrastructure */ - /* (C) 2010-2012 by Harald Welte * * All Rights Reserved @@ -33,9 +31,8 @@ /*! \addtogroup auth * @{ * GSM/GPRS/3G authentication core infrastructure - */ - -/* \file auth_core.c */ + * + * \file auth_core.c */ static LLIST_HEAD(osmo_auths); diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 41e538d..8d50990 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -1,6 +1,7 @@ -/* GSM/GPRS/3G authentication core infrastructure */ - -/* (C) 2011 by Harald Welte +/*! \file auth_milenage.c + * GSM/GPRS/3G authentication core infrastructure */ +/* + * (C) 2011 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c index 78f0e07..0fcc67d 100644 --- a/src/gsm/comp128.c +++ b/src/gsm/comp128.c @@ -1,6 +1,5 @@ -/* - * COMP128 implementation - * +/*! \file comp128.c + * COMP128 v1; common/old GSM Authentication Algorithm (A3/A8). * * This code is inspired by original code from : * Marc Briceno , Ian Goldberg , @@ -11,7 +10,38 @@ * A comment snippet from the original code is included below, it describes * where the doc came from and how the algorithm was reverse engineered. * + * This code derived from a leaked document from the GSM standards. + * Some missing pieces were filled in by reverse-engineering a working SIM. + * We have verified that this is the correct COMP128 algorithm. * + * The first page of the document identifies it as + * + * _Technical Information: GSM System Security Study_. + * 10-1617-01, 10th June 1988. + * + * The bottom of the title page is marked + * + * Racal Research Ltd. + * Worton Drive, Worton Grange Industrial Estate, + * Reading, Berks. RG2 0SB, England. + * Telephone: Reading (0734) 868601 Telex: 847152 + * + * The relevant bits are in Part I, Section 20 (pages 66--67). Enjoy! + * + * Note: There are three typos in the spec (discovered by + * reverse-engineering). + * - First, "z = (2 * x[n] + x[n]) mod 2^(9-j)" should clearly read + * "z = (2 * x[m] + x[n]) mod 2^(9-j)". + * - Second, the "k" loop in the "Form bits from bytes" section is severely + * botched: the k index should run only from 0 to 3, and clearly the range + * on "the (8-k)th bit of byte j" is also off (should be 0..7, not 1..8, + * to be consistent with the subsequent section). + * - Third, SRES is taken from the first 8 nibbles of x[], not the last 8 as + * claimed in the document. (And the document doesn't specify how Kc is + * derived, but that was also easily discovered with reverse engineering.) + * All of these typos have been corrected in the following code. + */ +/* * (C) 2009 by Sylvain Munaut * * All Rights Reserved @@ -32,49 +62,12 @@ * */ -/* - * --- SNIP --- - * - * This code derived from a leaked document from the GSM standards. - * Some missing pieces were filled in by reverse-engineering a working SIM. - * We have verified that this is the correct COMP128 algorithm. - * - * The first page of the document identifies it as - * _Technical Information: GSM System Security Study_. - * 10-1617-01, 10th June 1988. - * The bottom of the title page is marked - * Racal Research Ltd. - * Worton Drive, Worton Grange Industrial Estate, - * Reading, Berks. RG2 0SB, England. - * Telephone: Reading (0734) 868601 Telex: 847152 - * The relevant bits are in Part I, Section 20 (pages 66--67). Enjoy! - * - * Note: There are three typos in the spec (discovered by - * reverse-engineering). - * First, "z = (2 * x[n] + x[n]) mod 2^(9-j)" should clearly read - * "z = (2 * x[m] + x[n]) mod 2^(9-j)". - * Second, the "k" loop in the "Form bits from bytes" section is severely - * botched: the k index should run only from 0 to 3, and clearly the range - * on "the (8-k)th bit of byte j" is also off (should be 0..7, not 1..8, - * to be consistent with the subsequent section). - * Third, SRES is taken from the first 8 nibbles of x[], not the last 8 as - * claimed in the document. (And the document doesn't specify how Kc is - * derived, but that was also easily discovered with reverse engineering.) - * All of these typos have been corrected in the following code. - * - * --- /SNIP --- - */ - #include #include /*! \addtogroup auth * @{ - */ - -/*! \file comp128.c - * COMP128 v1; common/old GSM Authentication Algorithm (A3/A8) - */ + * \file comp128.c */ /* The compression tables (just copied ...) */ static const uint8_t table_0[512] = { diff --git a/src/gsm/comp128v23.c b/src/gsm/comp128v23.c index 1797ebc..12f8a4c 100644 --- a/src/gsm/comp128v23.c +++ b/src/gsm/comp128v23.c @@ -1,11 +1,11 @@ -/* COMP128 version 2 and 3 implementation +/*! \file comp128v23.c + * COMP128 version 2 and 3 implementation, common algorithm used for GSM Authentication (A3/A8). * * This code is a C conversion of the original code from * http://www.hackingprojects.net/ - * */ - -/* (C) 2013 by K?vin Redon +/* + * (C) 2013 by K?vin Redon * * All Rights Reserved * @@ -30,11 +30,7 @@ /*! \addtogroup auth * @{ - */ - -/*! \file comp128v23.c - * COMP128 v2 / v3; Common Algorithm used for GSM Authentication (A3/A8) - */ + * \file comp128v23.c */ static const uint8_t table0[256] = { 197, 235, 60, 151, 98, 96, 3, 100, 248, 118, 42, 117, 172, 211, 181, 203, 61, diff --git a/src/gsm/gan.c b/src/gsm/gan.c index d357b7e..fae93f1 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -1,4 +1,7 @@ -/* (C) 2012 by Harald Welte +/*! \file gan.c + * Generic Access Network (GAN) / UMA according to TS 44.318. */ +/* + * (C) 2012 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -20,11 +23,6 @@ #include #include - -/*! \file gan.c - * Generic Access Network (GAN) / UMA according to TS 44.318 - */ - const struct value_string gan_msgt_vals[] = { { GA_MT_RC_DISCOVERY_REQUEST, "GA-RC DISCOVERY REQUEST" }, diff --git a/src/gsm/gea.c b/src/gsm/gea.c index d4e599c..d95c03e 100644 --- a/src/gsm/gea.c +++ b/src/gsm/gea.c @@ -1,8 +1,6 @@ +/*! \file gea.c + * Implementation of GEA3 and GEA4. */ /* - * gea.c - * - * Implementation of GEA3 and GEA4 - * * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved @@ -32,10 +30,7 @@ /*! \addtogroup crypto * @{ - */ - -/*! \file gsm/gea.c */ - + * \file gsm/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 diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index b833048..fc68c40 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -1,6 +1,7 @@ -/* GPRS LLC cipher core infrastructure */ - -/* (C) 2010 by Harald Welte +/*! \file gprs_cipher_core.c + * GPRS LLC cipher core infrastructure */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/gprs_gea.c b/src/gsm/gprs_gea.c index 836ee68..db3f2cc 100644 --- a/src/gsm/gprs_gea.c +++ b/src/gsm/gprs_gea.c @@ -1,8 +1,6 @@ +/*! \file gprs_gea.c + * GEA 3 & 4 plugin */ /* - * gprs_gea.c - * - * GEA 3 & 4 plugin - * * Copyright (C) 2016 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index 4b32947..b213b26 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -1,13 +1,13 @@ +/*! \file gsm/gprs_rlc.c + * helper functions for (E)GPRS RLC according to 3GPP TS 44.060. + */ + #include #include #include #include #include - -/*! \file gsm/gprs_rlc.c - * helper functions for (E)GPRS RLC according to 3GPP TS 44.060 - */ #define EGPRS_CPS_TYPE1_TBL_SZ 29 #define EGPRS_CPS_TYPE2_TBL_SZ 8 diff --git a/src/gsm/gsm0341.c b/src/gsm/gsm0341.c index 0e3e453..05a0b4a 100644 --- a/src/gsm/gsm0341.c +++ b/src/gsm/gsm0341.c @@ -1,3 +1,4 @@ +/*! \file gsm0341.c */ /* * (C) 2014 by Harald Welte * All Rights Reserved diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index dab83eb..7414e95 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_smc.c + * 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 */ - -/* (C) 2008 by Daniel Willmann + * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index d120f2d..67bb249 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_smr.c + * 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 */ - -/* (C) 2008 by Daniel Willmann +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index ef67930..7c7164c 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -1,8 +1,9 @@ -/* Point-to-Point (PP) Short Message Service (SMS) +/*! \file gsm0411_utils.c + * 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 */ - -/* (C) 2008 by Daniel Willmann + * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0. */ +/* + * (C) 2008 by Daniel Willmann * (C) 2009 by Harald Welte * (C) 2010-2013 by Holger Hans Peter Freyther * (C) 2010 by On-Waves diff --git a/src/gsm/gsm0414.c b/src/gsm/gsm0414.c index 84d393d..616d7d9 100644 --- a/src/gsm/gsm0414.c +++ b/src/gsm/gsm0414.c @@ -1,3 +1,5 @@ +/*! \file gsm0414.c */ + #include #include diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 3c23f6f..557aa14 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -1,5 +1,5 @@ -/* Format functions for GSM 04.80 */ - +/*! \file gsm0480.c + * Format functions for GSM 04.80. */ /* * (C) 2010 by Holger Hans Peter Freyther * (C) 2009 by Mike Haben diff --git a/src/gsm/gsm0502.c b/src/gsm/gsm0502.c index df1d8e9..6b69893 100644 --- a/src/gsm/gsm0502.c +++ b/src/gsm/gsm0502.c @@ -1,6 +1,7 @@ -/* Paging helper code */ - -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file gsm0502.c + * Paging helper code */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index f595dd6..a8a5e45 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1,4 +1,6 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther +/*! \file gsm0808.c */ +/* + * (C) 2009,2010 by Holger Hans Peter Freyther * (C) 2009,2010 by On-Waves * All Rights Reserved * diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 34e10bb..e2cd91b 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1,4 +1,6 @@ -/* (C) 2016 by Sysmocom s.f.m.c. GmbH +/*! \file gsm0808_utils.c */ +/* + * (C) 2016 by Sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Philipp Maier diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 227dbef..f69eee2 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -1,7 +1,8 @@ -/* GSM Mobile Radio Interface Layer 3 messages +/*! \file gsm48.c + * GSM Mobile Radio Interface Layer 3 messages * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * (C) 2008, 2009 by Holger Hans Peter Freyther * * All Rights Reserved diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index d3a868d..105acba 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -1,7 +1,8 @@ -/* GSM Mobile Radio Interface Layer 3 messages - * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008 by Harald Welte +/*! \file gsm48_ie.c + * GSM Mobile Radio Interface Layer 3 messages. + * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0. */ +/* + * (C) 2008 by Harald Welte * (C) 2009-2010 by Andreas Eversberg * * All Rights Reserved diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 7bcef4e..43da27e 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -1,4 +1,6 @@ -/* (C) 2009-2016 by Harald Welte +/*! \file gsm_04_08_gprs.c */ +/* + * (C) 2009-2016 by Harald Welte * (C) 2010 by On-Waves * (C) 2014-2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index fd16e98..5a4ceb3 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -1,3 +1,4 @@ +/*! \file gsm_utils.c */ /* * (C) 2008 by Daniel Willmann * (C) 2009,2013 by Holger Hans Peter Freyther diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 780198c..2629eb7 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -1,5 +1,5 @@ -/* Osmocom Generic Subscriber Update Protocol message encoder/decoder */ - +/*! \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 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 2c7cf58..bc84850 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -1,6 +1,7 @@ -/* OpenBSC Abis input driver for ip.access */ - -/* (C) 2009-2017 by Harald Welte +/*! \file ipa.c + * OpenBSC Abis input driver for ip.access */ +/* + * (C) 2009-2017 by Harald Welte * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * diff --git a/src/gsm/kasumi.c b/src/gsm/kasumi.c index d5d78a7..c3a028b 100644 --- a/src/gsm/kasumi.c +++ b/src/gsm/kasumi.c @@ -1,6 +1,7 @@ -/* Kasumi cipher and KGcore functions */ - -/* (C) 2013 by Max +/*! \file kasumi.c + * Kasumi cipher and KGcore functions. */ +/* + * (C) 2013 by Max * * All Rights Reserved * diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 4ad7556..166bf9a 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1,6 +1,7 @@ -/* LAPD core implementation */ - -/* (C) 2010-2011 by Harald Welte +/*! \file lapd_core.c + * LAPD core implementation */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2010-2011 by Andreas Eversberg * * All Rights Reserved @@ -23,12 +24,9 @@ /*! \addtogroup lapd * @{ - * Osmocom LAPD core, used for Q.921, LAPDm and others - */ - -/*! \file lapd_core.c */ - -/*! + * + * Osmocom LAPD core, used for Q.921, LAPDm and others. + * * Notes on Buffering: rcv_buffer, tx_queue, tx_hist, send_buffer, send_queue * * RX data is stored in the rcv_buffer (pointer). If the message is complete, it @@ -62,6 +60,7 @@ * will not trigger T200. It will be stoped, when T200 is started in MF EST * state. It will also be stoped when leaving MF EST state. * + * \file lapd_core.c */ /* Enable this to test content resolution on network side: diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 1152e0d..db950a6 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -1,6 +1,7 @@ -/* GSM LAPDm (TS 04.06) implementation */ - -/* (C) 2010-2011 by Harald Welte +/*! \file lapdm.c + * GSM LAPDm (TS 04.06) implementation. */ +/* + * (C) 2010-2011 by Harald Welte * (C) 2010-2011 by Andreas Eversberg * * All Rights Reserved @@ -23,10 +24,7 @@ /*! \addtogroup lapdm * @{ - * GSM LAPDm (TS 04.06) implementation - */ - -/*! \file lapdm.c */ + * \file lapdm.c */ #include #include diff --git a/src/gsm/milenage/aes-encblock.c b/src/gsm/milenage/aes-encblock.c index 8f35caa..c4aa260 100644 --- a/src/gsm/milenage/aes-encblock.c +++ b/src/gsm/milenage/aes-encblock.c @@ -1,6 +1,6 @@ +/*! \file aes-encblock.c + * AES encrypt_block. */ /* - * AES encrypt_block - * * Copyright (c) 2003-2007, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes-internal-enc.c b/src/gsm/milenage/aes-internal-enc.c index 8726aa7..4c00f96 100644 --- a/src/gsm/milenage/aes-internal-enc.c +++ b/src/gsm/milenage/aes-internal-enc.c @@ -1,5 +1,5 @@ -/* - * AES (Rijndael) cipher - encrypt +/*! \file aes-internal-enc.c + * AES (Rijndael) cipher - encrypt. * * Modifications to public domain implementation: * - support only 128-bit keys @@ -8,7 +8,8 @@ * - added option (AES_SMALL_TABLES) for reducing code size by about 8 kB at * cost of reduced throughput (quite small difference on Pentium 4, * 10-25% when using -O1 or -O2 optimization) - * + */ +/* * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes-internal.c b/src/gsm/milenage/aes-internal.c index 4161220..60c520c 100644 --- a/src/gsm/milenage/aes-internal.c +++ b/src/gsm/milenage/aes-internal.c @@ -1,5 +1,5 @@ -/* - * AES (Rijndael) cipher +/*! \file aes-internal.c + * AES (Rijndael) cipher. * * Modifications to public domain implementation: * - support only 128-bit keys @@ -8,7 +8,8 @@ * - added option (AES_SMALL_TABLES) for reducing code size by about 8 kB at * cost of reduced throughput (quite small difference on Pentium 4, * 10-25% when using -O1 or -O2 optimization) - * + */ +/* * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes.h b/src/gsm/milenage/aes.h index 7e97f61..ce42b20 100644 --- a/src/gsm/milenage/aes.h +++ b/src/gsm/milenage/aes.h @@ -1,5 +1,6 @@ +/*! \file aes.h + * AES functions */ /* - * AES functions * Copyright (c) 2003-2006, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes_i.h b/src/gsm/milenage/aes_i.h index 5d89abc..6df019a 100644 --- a/src/gsm/milenage/aes_i.h +++ b/src/gsm/milenage/aes_i.h @@ -1,5 +1,6 @@ +/*! \file aes_i.h + * AES (Rijndael) cipher. */ /* - * AES (Rijndael) cipher * Copyright (c) 2003-2005, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/aes_wrap.h b/src/gsm/milenage/aes_wrap.h index afa1451..7d4d5d9 100644 --- a/src/gsm/milenage/aes_wrap.h +++ b/src/gsm/milenage/aes_wrap.h @@ -1,12 +1,13 @@ -/* - * AES-based functions +/*! \file aes_wrap.h + * AES-based functions. * * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) * - One-Key CBC MAC (OMAC1) hash with AES-128 * - AES-128 CTR mode encryption * - AES-128 EAX mode encryption/decryption * - AES-128 CBC - * + */ +/* * Copyright (c) 2003-2007, Jouni Malinen * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/common.h b/src/gsm/milenage/common.h index aaf82b9..2aa50fb 100644 --- a/src/gsm/milenage/common.h +++ b/src/gsm/milenage/common.h @@ -1,3 +1,4 @@ +/*! \file common.h */ #include #include diff --git a/src/gsm/milenage/milenage.c b/src/gsm/milenage/milenage.c index b43f986..012b399 100644 --- a/src/gsm/milenage/milenage.c +++ b/src/gsm/milenage/milenage.c @@ -1,5 +1,6 @@ +/*! \file milenage.c + * 3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) */ /* - * 3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) * Copyright (c) 2006-2007 * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/milenage/milenage.h b/src/gsm/milenage/milenage.h index 6fb779c..1a4364d 100644 --- a/src/gsm/milenage/milenage.h +++ b/src/gsm/milenage/milenage.h @@ -1,5 +1,7 @@ +/*! \file milenage.h + * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208). + */ /* - * UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) * Copyright (c) 2006-2007 * * This program is free software; you can redistribute it and/or modify diff --git a/src/gsm/oap.c b/src/gsm/oap.c index 88c98f7..b07eafc 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -1,6 +1,7 @@ -/* Osmocom Authentication Protocol message encoder/decoder */ - -/* (C) 2015-2016 by sysmocom s.f.m.c. GmbH +/*! \file oap.c + * Osmocom Authentication Protocol message encoder/decoder */ +/* + * (C) 2015-2016 by sysmocom s.f.m.c. GmbH * All Rights Reserved * * Author: Neels Hofmeyr diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 4a1f733..e33ea10 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -1,7 +1,5 @@ -/* GSM Radio Signalling Link messages on the A-bis interface - * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * * All Rights Reserved * @@ -30,10 +28,10 @@ /*! \addtogroup rsl * @{ - * GSM Radio Signalling Link (TS 08.58) - */ - -/*! \file rsl.c */ + * GSM Radio Signalling Link messages on the A-bis interface. + * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0. + * + * \file rsl.c */ /*! Size for RSL \ref msgb_alloc */ #define RSL_ALLOC_SIZE 200 diff --git a/src/gsm/rxlev_stat.c b/src/gsm/rxlev_stat.c index d226861..2ff0ac8 100644 --- a/src/gsm/rxlev_stat.c +++ b/src/gsm/rxlev_stat.c @@ -1,6 +1,7 @@ -/* Rx Level statistics */ - -/* (C) 2010 by Harald Welte +/*! \file rxlev_stat.c + * Rx Level statistics */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/sysinfo.c b/src/gsm/sysinfo.c index 201acfc..b73bb0c 100644 --- a/src/gsm/sysinfo.c +++ b/src/gsm/sysinfo.c @@ -1,7 +1,8 @@ -/* GSM 04.08 System Information (SI) encoding and decoding +/*! \file sysinfo.c + * GSM 04.08 System Information (SI) encoding and decoding. * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ - -/* (C) 2008-2010 by Harald Welte +/* + * (C) 2008-2010 by Harald Welte * * All Rights Reserved * diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index d9072c9..b1b1034 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -39,9 +39,8 @@ * particular type. Types are e.g. TV (Tag + single byte value), Tag + * fixed-length value, TLV with 8bit length, TLV with 16bit length, TLV * with variable-length length field, etc. - */ - -/*! \file tlv_parser.c */ + * + * \file tlv_parser.c */ struct tlv_definition tvlv_att_def; struct tlv_definition vtvlv_gan_att_def; diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 62bbd57..561cdb3 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -1,4 +1,5 @@ -/* GSMTAP support code in libmsomcore */ +/*! \file gsmtap_util.c + * GSMTAP support code in libosmocore. */ /* * (C) 2010-2011 by Harald Welte * @@ -43,9 +44,9 @@ /*! \addtogroup gsmtap * @{ - * GSMTAP utility routines. Encapsulates GSM messages over UDP - */ -/*! \file gsmtap_util.c */ + * GSMTAP utility routines. Encapsulates GSM messages over UDP. + * + * \file gsmtap_util.c */ /*! convert RSL channel number to GSMTAP channel type diff --git a/src/logging.c b/src/logging.c index 964128b..c8b86b1 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1,6 +1,7 @@ -/* Debugging/Logging support code */ - -/* (C) 2008-2010 by Harald Welte +/*! \file logging.c + * Debugging/Logging support code. */ +/* + * (C) 2008-2010 by Harald Welte * (C) 2008 by Holger Hans Peter Freyther * All Rights Reserved * @@ -23,9 +24,8 @@ /* \addtogroup logging * @{ * libosmocore Logging sub-system - */ - -/* \file logging.c */ + * + * \file logging.c */ #include "../config.h" diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index 9e5884b..d0aa47b 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -1,6 +1,12 @@ -/* GSMTAP network logging support code */ - -/* (C) 2016 by Harald Welte +/*! \file logging_gsmtap.c + * libosmocore log output encapsulated in GSMTAP. + * + * Encapsulating the log output inside GSMTAP frames allows us to + * observer protocol traces (of Um, Abis, A or any other interface in + * the Osmocom world) with synchronous interspersed log messages. + */ +/* + * (C) 2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,15 +27,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file logging_gsmtap.c - * libosmocore log output encapsulated in GSMTAP - * - * Encapsulating the log output inside GSMTAP frames allows us to - * observer protocol traces (of Um, Abis, A or any other interface in - * the Osmocom world) with synchronous interspersed log messages. - */ + * \file logging_gsmtap.c */ #include "../config.h" diff --git a/src/logging_syslog.c b/src/logging_syslog.c index a80a31e..d0d6a96 100644 --- a/src/logging_syslog.c +++ b/src/logging_syslog.c @@ -1,6 +1,7 @@ -/* Syslog logging support code */ - -/* (C) 2011 by Harald Welte +/*! \file logging_syslog.c + * Syslog logging support code. */ +/* + * (C) 2011 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,11 +22,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file logging_syslog.c - * libosmocore logging output via syslog - */ + * \file logging_syslog.c */ #include "../config.h" diff --git a/src/loggingrb.c b/src/loggingrb.c index 64033fc..5127a2f 100644 --- a/src/loggingrb.c +++ b/src/loggingrb.c @@ -1,6 +1,7 @@ -/* Ringbuffer-backed logging support code */ - -/* (C) 2012-2013 by Katerina Barone-Adesi +/*! \file loggingrb.c + * Ringbuffer-backed logging support code. */ +/* + * (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -21,11 +22,7 @@ /*! \addtogroup logging * @{ - */ - -/*! \file loggingrb.c - * libosmocore logging backend for a ring-buffer of last log messages - */ + * \file loggingrb.c */ #include #include diff --git a/src/macaddr.c b/src/macaddr.c index 6a1588d..5c68d05 100644 --- a/src/macaddr.c +++ b/src/macaddr.c @@ -1,3 +1,5 @@ +/*! \file macaddr.c + * MAC address utility routines. */ /* * (C) 2013-2014 by Harald Welte * (C) 2014 by Holger Hans Peter Freyther @@ -22,11 +24,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file macaddr.c - * MAC address utility routines - */ + * \file macaddr.c */ #include "config.h" diff --git a/src/msgb.c b/src/msgb.c index bad98f4..2e9f4a2 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -20,6 +20,7 @@ /*! \addtogroup msgb * @{ + * * libosmocore message buffers, inspired by Linux kernel skbuff * * Inspired by the 'struct skbuff' of the Linux kernel, we implement a @@ -46,9 +47,9 @@ * * prepending (pushing) and appending (putting) data * * copying / resizing * * hex-dumping to a string for debug purposes + * + * \file msgb.c */ - -/*! \file msgb.c */ #include #include diff --git a/src/msgfile.c b/src/msgfile.c index bf36bf3..8517099 100644 --- a/src/msgfile.c +++ b/src/msgfile.c @@ -1,6 +1,6 @@ +/*! \file msgfile.c + * Parse a simple file with messages, e.g used for USSD messages. */ /* - * Parse a simple file with messages, e.g used for USSD messages - * * (C) 2010 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * All Rights Reserved diff --git a/src/panic.c b/src/panic.c index 251fdad..2a8b1ae 100644 --- a/src/panic.c +++ b/src/panic.c @@ -1,4 +1,5 @@ -/* Panic handling */ +/*! \file panic.c + * Routines for panic handling. */ /* * (C) 2010 by Sylvain Munaut * @@ -22,11 +23,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file panic.c - * Routines for panic handling - */ + * \file panic.c */ #include #include diff --git a/src/plugin.c b/src/plugin.c index b6a5a48..264171c 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,7 @@ -/* plugin infrastructure */ - -/* (C) 2010 by Harald Welte +/*! \file plugin.c + * Routines for loading and managing shared library plug-ins. */ +/* + * (C) 2010 by Harald Welte * * All Rights Reserved * @@ -22,12 +23,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file plugin.c - * Routines for loading and managing shared library plug-ins. - */ - + * \file plugin.c */ #include "../config.h" diff --git a/src/prim.c b/src/prim.c index f39527f..2035581 100644 --- a/src/prim.c +++ b/src/prim.c @@ -1,3 +1,5 @@ +/*! \file prim.c */ + #include #include diff --git a/src/pseudotalloc/pseudotalloc.c b/src/pseudotalloc/pseudotalloc.c index bc7a491..b77ffe9 100644 --- a/src/pseudotalloc/pseudotalloc.c +++ b/src/pseudotalloc/pseudotalloc.c @@ -1,7 +1,7 @@ -/* overly simplistic talloc replacement for deeply embedded +/*! \file pseudotalloc.c + * overly simplistic talloc replacement for deeply embedded * microcontrollers. Obviously this has none of the properties of real - * talloc, it is particualrly not hierarchical at all */ - + * talloc, it is particualrly not hierarchical at all. */ #include "talloc.h" #include diff --git a/src/pseudotalloc/talloc.h b/src/pseudotalloc/talloc.h index f4c0a74..3ce9f37 100644 --- a/src/pseudotalloc/talloc.h +++ b/src/pseudotalloc/talloc.h @@ -1,8 +1,9 @@ -#pragma once - -/* overly simplistic talloc replacement for deeply embedded +/*! \file talloc.h + * overly simplistic talloc replacement for deeply embedded * microcontrollers. Obviously this has none of the properties of real - * talloc, it is particualrly not hierarchical at all */ + * talloc, it is particualrly not hierarchical at all. */ + +#pragma once #include #include diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 068d491..2985bbb 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -1,5 +1,3 @@ -/* utility routines for keeping conters about events and the event rates */ - /* (C) 2009-2010 by Harald Welte * * All Rights Reserved @@ -22,11 +20,9 @@ /*! \addtogroup rate_ctr * @{ - * conters about events and their event rates - */ - -/*! \file rate_ctr.c */ - + * Counters about events and their event rates. + * + * \file rate_ctr.c */ #include #include diff --git a/src/select.c b/src/select.c index 575fd77..f7ee424 100644 --- a/src/select.c +++ b/src/select.c @@ -1,7 +1,9 @@ -/* select filedescriptor handling, taken from: +/*! \file select.c + * select filedescriptor handling. + * Taken from: * userspace logging daemon for the iptables ULOG target - * of the linux 2.4 netfilter subsystem. - * + * of the linux 2.4 netfilter subsystem. */ +/* * (C) 2000-2009 by Harald Welte * * This program is free software; you can redistribute it and/or modify @@ -37,9 +39,8 @@ /*! \addtogroup select * @{ * select() loop abstraction - */ - -/*! \file select.c */ + * + * \file select.c */ static int maxfd = 0; static LLIST_HEAD(osmo_fds); diff --git a/src/sercomm.c b/src/sercomm.c index d02b39e..07b1aa0 100644 --- a/src/sercomm.c +++ b/src/sercomm.c @@ -1,5 +1,3 @@ -/* Serial communications layer, based on HDLC */ - /* (C) 2010,2017 by Harald Welte * * All Rights Reserved @@ -22,11 +20,9 @@ /*! \addtogroup sercomm * @{ - * Serial communications layer, based on HDLC - */ - -/*! \file sercomm.c - */ + * Serial communications layer, based on HDLC. + * + * \file sercomm.c */ #include "config.h" diff --git a/src/serial.c b/src/serial.c index b8c347b..dddad88 100644 --- a/src/serial.c +++ b/src/serial.c @@ -1,8 +1,6 @@ +/*! \file serial.c + * Utility functions to deal with serial ports */ /* - * serial.c - * - * Utility functions to deal with serial ports - * * Copyright (C) 2011 Sylvain Munaut * * All Rights Reserved @@ -25,9 +23,8 @@ /*! \addtogroup serial * @{ * Osmocom serial port helpers - */ - -/*! \file serial.c */ + * + * \file serial.c */ #include #include diff --git a/src/signal.c b/src/signal.c index 301b021..0c56465 100644 --- a/src/signal.c +++ b/src/signal.c @@ -1,5 +1,7 @@ -/* Generic signalling/notification infrastructure */ -/* (C) 2009 by Holger Hans Peter Freyther +/*! \file signal.c + * Generic signalling/notification infrastructure. */ +/* + * (C) 2009 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -27,10 +29,9 @@ /*! \addtogroup signal * @{ - * Generic signalling/notification infrastructure - */ - -/*! \file signal.c */ + * Generic signalling/notification infrastructure. + * + * \file signal.c */ void *tall_sigh_ctx; diff --git a/src/sim/card_fs_isim.c b/src/sim/card_fs_isim.c index 339e862..1073429 100644 --- a/src/sim/card_fs_isim.c +++ b/src/sim/card_fs_isim.c @@ -1,4 +1,5 @@ -/* 3GPP ISIM specific structures / routines */ +/*! \file card_fs_isim.c + * 3GPP ISIM specific structures / routines. */ /* * (C) 2014 by Harald Welte * diff --git a/src/sim/card_fs_sim.c b/src/sim/card_fs_sim.c index 432c945..1411129 100644 --- a/src/sim/card_fs_sim.c +++ b/src/sim/card_fs_sim.c @@ -1,4 +1,5 @@ -/* classic SIM card specific structures/routines */ +/*! \file card_fs_sim.c + * classic SIM card specific structures/routines. */ /* * (C) 2012-2014 by Harald Welte * diff --git a/src/sim/card_fs_tetra.c b/src/sim/card_fs_tetra.c index 657e55f..80f3284 100644 --- a/src/sim/card_fs_tetra.c +++ b/src/sim/card_fs_tetra.c @@ -1,4 +1,5 @@ -/* TETRA SIM card specific structures/routines */ +/*! \file card_fs_tetra.c + * TETRA SIM card specific structures/routines. */ /* * (C) 2014 by Harald Welte * diff --git a/src/sim/card_fs_uicc.c b/src/sim/card_fs_uicc.c index 27afe34..8ff8936 100644 --- a/src/sim/card_fs_uicc.c +++ b/src/sim/card_fs_uicc.c @@ -1,4 +1,5 @@ -/* ETSI UICC specific structures / routines */ +/*! \file card_fs_uicc.c + * ETSI UICC specific structures / routines. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/card_fs_usim.c b/src/sim/card_fs_usim.c index 22c193f..9e9fc87 100644 --- a/src/sim/card_fs_usim.c +++ b/src/sim/card_fs_usim.c @@ -1,4 +1,5 @@ -/* 3GPP USIM specific structures / routines */ +/*! \file card_fs_usim.c + * 3GPP USIM specific structures / routines. */ /* * (C) 2012-2014 by Harald Welte * diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index c3e18d8..fcf67f0 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -1,5 +1,6 @@ -/* simtrace - tables determining APDU case for card emulation - * +/*! \file class_tables.c + * simtrace - tables determining APDU case for card emulation. */ +/* * (C) 2016 by Harald Welte * * This program is free software; you can redistribute it and/or modify diff --git a/src/sim/core.c b/src/sim/core.c index 15a1563..8da839c 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -1,4 +1,5 @@ -/* Core routines for SIM/UICC/USIM access */ +/*! \file core.c + * Core routines for SIM/UICC/USIM access. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/gsm_int.h b/src/sim/gsm_int.h index 54a2fbf..42ccca7 100644 --- a/src/sim/gsm_int.h +++ b/src/sim/gsm_int.h @@ -1,3 +1,5 @@ +/*! \file gsm_int.h */ + #include #include diff --git a/src/sim/reader.c b/src/sim/reader.c index e7169b5..f39829b 100644 --- a/src/sim/reader.c +++ b/src/sim/reader.c @@ -1,4 +1,5 @@ -/* Card reader abstraction for libosmosim */ +/*! \file reader.c + * Card reader abstraction for libosmosim. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/reader_pcsc.c b/src/sim/reader_pcsc.c index f020142..5b29638 100644 --- a/src/sim/reader_pcsc.c +++ b/src/sim/reader_pcsc.c @@ -1,4 +1,5 @@ -/* PC/SC Card reader backend for libosmosim */ +/*! \file reader_pcsc.c + * PC/SC Card reader backend for libosmosim. */ /* * (C) 2012 by Harald Welte * diff --git a/src/sim/sim_int.h b/src/sim/sim_int.h index 7b07b83..885011e 100644 --- a/src/sim/sim_int.h +++ b/src/sim/sim_int.h @@ -1,3 +1,5 @@ +/*! \file sim_int.h */ + #ifndef _SIM_INT_H #include diff --git a/src/socket.c b/src/socket.c index f033912..b74edd4 100644 --- a/src/socket.c +++ b/src/socket.c @@ -23,10 +23,9 @@ /*! \addtogroup socket * @{ - * Osmocom socket convenience functions - */ - -/*! \file socket.c */ + * Osmocom socket convenience functions. + * + * \file socket.c */ #ifdef HAVE_SYS_SOCKET_H diff --git a/src/stat_item.c b/src/stat_item.c index 3b67ba0..c073a3e 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -1,6 +1,7 @@ -/* utility routines for keeping conters about events and the event rates */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH +/*! \file stat_item.c + * utility routines for keeping conters about events and the event rates. */ +/* + * (C) 2015 by Sysmocom s.f.m.c. GmbH * (C) 2009-2010 by Harald Welte * * All Rights Reserved @@ -23,10 +24,7 @@ /*! \addtogroup osmo_stat_item * @{ - */ - -/*! \file stat_item.c */ - + * \file stat_item.c */ #include #include diff --git a/src/statistics.c b/src/statistics.c index ad069ce..fc808f5 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -1,6 +1,7 @@ -/* utility routines for keeping some statistics */ - -/* (C) 2009 by Harald Welte +/*! \file statistics.c + * utility routines for keeping some statistics. */ +/* + * (C) 2009 by Harald Welte * * All Rights Reserved * diff --git a/src/stats.c b/src/stats.c index a523259..b39ec53 100644 --- a/src/stats.c +++ b/src/stats.c @@ -1,3 +1,4 @@ +/*! \file stats.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 342bb88..6e7be73 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -1,3 +1,4 @@ +/*! \file stats_statsd.c */ /* * (C) 2015 by Sysmocom s.f.m.c. GmbH * diff --git a/src/strrb.c b/src/strrb.c index 0c56be2..6bfb179 100644 --- a/src/strrb.c +++ b/src/strrb.c @@ -1,7 +1,21 @@ -/* Ringbuffer implementation, tailored for logging. +/*! \file strrb.c + * Ringbuffer implementation, tailored for logging. * This is a lossy ringbuffer. It keeps up to N of the newest messages, * overwriting the oldest as newer ones come in. * + * Ringbuffer assumptions, invarients, and notes: + * - start is the index of the first used index slot in the ring buffer. + * - end is the index of the next index slot in the ring buffer. + * - start == end => buffer is empty + * - Consequence: the buffer can hold at most size - 1 messages + * (if this were not the case, full and empty buffers would be indistinguishable + * given the conventions in this implementation). + * - Whenever the ringbuffer is full, start is advanced. The second oldest + * message becomes unreachable by valid indexes (end is not a valid index) + * and the oldest message is overwritten (if there was a message there, which + * is the case unless this is the first time the ringbuffer becomes full). + */ +/* * (C) 2012-2013, Katerina Barone-Adesi * All Rights Reserved * @@ -23,11 +37,7 @@ /*! \addtogroup utils * @{ - */ - -/*! \file strrb.c - * Lossy string ringbuffer for logging; keeps newest messages. - */ + * \file strrb.c */ #include #include @@ -35,19 +45,6 @@ #include #include - -/* Ringbuffer assumptions, invarients, and notes: - * - start is the index of the first used index slot in the ring buffer. - * - end is the index of the next index slot in the ring buffer. - * - start == end => buffer is empty - * - Consequence: the buffer can hold at most size - 1 messages - * (if this were not the case, full and empty buffers would be indistinguishable - * given the conventions in this implementation). - * - Whenever the ringbuffer is full, start is advanced. The second oldest - * message becomes unreachable by valid indexes (end is not a valid index) - * and the oldest message is overwritten (if there was a message there, which - * is the case unless this is the first time the ringbuffer becomes full). -*/ /*! Create an empty, initialized osmo_strrb. * \param[in] ctx The talloc memory context which should own this. @@ -57,7 +54,6 @@ * This function creates and initializes a ringbuffer. * Note that the ringbuffer stores at most rb_size - 1 messages. */ - struct osmo_strrb *osmo_strrb_create(TALLOC_CTX * ctx, size_t rb_size) { struct osmo_strrb *rb = NULL; diff --git a/src/timer.c b/src/timer.c index e18195a..bf46c24 100644 --- a/src/timer.c +++ b/src/timer.c @@ -27,9 +27,8 @@ /*! \addtogroup timer * @{ * Osmocom timer abstraction; modelled after linux kernel timers - */ - -/*! \file timer.c */ + * + * \file timer.c */ #include #include diff --git a/src/timer_gettimeofday.c b/src/timer_gettimeofday.c index 3a2ae9a..1bf714e 100644 --- a/src/timer_gettimeofday.c +++ b/src/timer_gettimeofday.c @@ -22,10 +22,7 @@ /*! \addtogroup timer * @{ - */ - -/*! \file timer_gettimeofday.c - */ + * \file timer_gettimeofday.c */ #include #include diff --git a/src/utils.c b/src/utils.c index 2bd4c19..9e3414b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -34,9 +34,8 @@ /*! \addtogroup utils * @{ * various utility routines - */ - -/*! \file utils.c */ + * + * \file utils.c */ static char namebuf[255]; diff --git a/src/vty/buffer.c b/src/vty/buffer.c index 8862da9..1935aa1 100644 --- a/src/vty/buffer.c +++ b/src/vty/buffer.c @@ -1,5 +1,6 @@ +/*! \file buffer.c + * Buffering of output and input. */ /* - * Buffering of output and input. * Copyright (C) 1998 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/src/vty/command.c b/src/vty/command.c index a0824d3..33862c0 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -44,8 +44,8 @@ /*! \addtogroup command * @{ * VTY command handling - */ -/*! \file command.c */ + * + * \file command.c */ #define CONFIGFILE_MASK 022 diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index acc8ca6..345be66 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -1,5 +1,7 @@ -/* Osmocom FSM introspection via VTY */ -/* (C) 2016 by Harald Welte +/*! \file fsm_vty.c + * Osmocom FSM introspection via VTY. */ +/* + * (C) 2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 4cb1379..758f0b9 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC logging helper for the VTY */ -/* (C) 2009-2010 by Harald Welte +/*! \file logging_vty.c + * OpenBSC logging helper for the VTY. */ +/* + * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther * All Rights Reserved * diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 0557820..57cdd30 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -1,5 +1,7 @@ -/* OpenBSC stats helper for the VTY */ -/* (C) 2009-2010 by Harald Welte +/*! \file stats_vty.c + * OpenBSC stats helper for the VTY. */ +/* + * (C) 2009-2010 by Harald Welte * (C) 2009-2014 by Holger Hans Peter Freyther * (C) 2015 by Sysmocom s.f.m.c. GmbH * All Rights Reserved diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index d59516c..f82a7ff 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -1,4 +1,5 @@ -/* minimalistic telnet/network interface it might turn into a wire interface */ +/*! \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 * @@ -44,8 +45,8 @@ * access. This telnet server gets linked into each libosmovty-using * process in order to enable interactive command-line introspection, * interaction and configuration. - */ -/*! \file telnet_interface.c */ + * + * \file telnet_interface.c */ /* per connection data */ LLIST_HEAD(active_connections); diff --git a/src/vty/utils.c b/src/vty/utils.c index 267d76e..9d1bdf9 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -1,6 +1,7 @@ -/* utility routines for printing common objects in the Osmocom world */ - -/* (C) 2009-2010 by Harald Welte +/*! \file utils.c + * Utility routines for printing common objects in the Osmocom world. */ +/* + * (C) 2009-2010 by Harald Welte * * All Rights Reserved * @@ -35,8 +36,6 @@ #include #include - -/* \file utils.c */ /*! \addtogroup rate_ctr * @{ diff --git a/src/vty/vector.c b/src/vty/vector.c index c21bca7..ee07cbd 100644 --- a/src/vty/vector.c +++ b/src/vty/vector.c @@ -1,4 +1,6 @@ -/* Generic vector interface routine +/*! \file vector.c + * Generic vector interface routine. */ +/* * Copyright (C) 1997 Kunihiro Ishiguro * * This file is part of GNU Zebra. diff --git a/src/vty/vty.c b/src/vty/vty.c index 6e60eb7..644d4ed 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -68,8 +68,7 @@ /* \addtogroup vty * @{ - */ -/*! \file vty.c */ + * \file vty.c */ #define SYSCONFDIR "/usr/local/etc" diff --git a/src/write_queue.c b/src/write_queue.c index d929774..203815b 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -1,4 +1,3 @@ -/* Generic write queue implementation */ /* * (C) 2010-2016 by Holger Hans Peter Freyther * (C) 2010 by On-Waves @@ -27,10 +26,9 @@ /*! \addtogroup write_queue * @{ - * write queue for writing \ref msgb to sockets/fd's - */ - -/*! \file write_queue.c */ + * Write queue for writing \ref msgb to sockets/fds. + * + * \file write_queue.c */ /*! Select loop function for write queue handling * \param[in] fd osmocom file descriptor diff --git a/utils/osmo-arfcn.c b/utils/osmo-arfcn.c index 5103c97..61108f8 100644 --- a/utils/osmo-arfcn.c +++ b/utils/osmo-arfcn.c @@ -1,4 +1,5 @@ -/* Utility program for ARFCN / frequency calculations */ +/*! \file osmo-arfcn.c + * Utility program for ARFCN / frequency calculations. */ /* * (C) 2011 by Harald Welte * diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 6b1e623..76c4927 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -1,6 +1,7 @@ -/* GSM/GPRS/3G authentication testing tool */ - -/* (C) 2010-2012 by Harald Welte +/*! \file osmo-auc-gen.c + * GSM/GPRS/3G authentication testing tool. */ +/* + * (C) 2010-2012 by Harald Welte * * All Rights Reserved * -- To view, visit https://gerrit.osmocom.org/2987 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b 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 Fri Jun 23 00:18:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:28 +0000 Subject: [MERGED] libosmocore[master]: doxygen: various fixes in core/timer.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: various fixes in core/timer.h ...................................................................... doxygen: various fixes in core/timer.h Move a longish comment to the timer group so that it appears in the API doc. Un-doxygen some floating comments that were associated with unrelated code items ('/**' --> '/*'). Add braces to some function names so that the API doc will render as reference links. Change-Id: I3ea5b88cbe9cb54702429158bf47e768e04e8fe7 --- M include/osmocom/core/timer.h 1 file changed, 16 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 28785db..a039ac8 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -19,11 +19,24 @@ */ /*! \defgroup timer Osmocom timers + * Timer management: + * - Create a struct osmo_timer_list + * - Fill out timeout and use osmo_timer_add(), or + * use osmo_timer_schedule() to schedule a timer in + * x seconds and microseconds from now... + * - Use osmo_timer_del() to remove the timer + * + * Internally: + * - We hook into select.c to give a timeval of the + * nearest timer. On already passed timers we give + * it a 0 to immediately fire after the select + * - osmo_timers_update() will call the callbacks and + * remove the timers. * @{ */ /*! \file timer.h - * Osmocom timer handling routines + * Osmocom timer handling routines. */ #pragma once @@ -34,22 +47,6 @@ #include #include -/** - * Timer management: - * - Create a struct osmo_timer_list - * - Fill out timeout and use add_timer or - * use osmo_timer_schedule to schedule a timer in - * x seconds and microseconds from now... - * - Use osmo_timer_del to remove the timer - * - * Internally: - * - We hook into select.c to give a timeval of the - * nearest timer. On already passed timers we give - * it a 0 to immediately fire after the select - * - osmo_timers_update will call the callbacks and - * remove the timers. - * - */ /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ @@ -61,7 +58,7 @@ void *data; /*!< user data for callback */ }; -/** +/* * timer management */ @@ -88,7 +85,7 @@ int osmo_gettimeofday(struct timeval *tv, struct timezone *tz); -/** +/* * timer override */ -- To view, visit https://gerrit.osmocom.org/2986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ea5b88cbe9cb54702429158bf47e768e04e8fe7 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 Fri Jun 23 00:18:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:28 +0000 Subject: [MERGED] libosmocore[master]: doxygen: enable AUTOBRIEF, drop \brief In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: enable AUTOBRIEF, drop \brief ...................................................................... doxygen: enable AUTOBRIEF, drop \brief Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gb.in M Doxyfile.gsm.in M Doxyfile.vty.in M include/osmocom/codec/codec.h M include/osmocom/coding/gsm0503_coding.h M include/osmocom/coding/gsm0503_interleaving.h M include/osmocom/coding/gsm0503_mapping.h M include/osmocom/coding/gsm0503_parity.h M include/osmocom/coding/gsm0503_tables.h M include/osmocom/core/application.h M include/osmocom/core/bitXXgen.h.tpl M include/osmocom/core/bitcomp.h M include/osmocom/core/bits.h M include/osmocom/core/bitvec.h M include/osmocom/core/byteswap.h M include/osmocom/core/conv.h M include/osmocom/core/crcXXgen.h.tpl M include/osmocom/core/defs.h M include/osmocom/core/fsm.h M include/osmocom/core/gsmtap.h M include/osmocom/core/gsmtap_util.h M include/osmocom/core/linuxlist.h M include/osmocom/core/logging.h M include/osmocom/core/msgb.h M include/osmocom/core/panic.h M include/osmocom/core/prim.h M include/osmocom/core/rate_ctr.h M include/osmocom/core/select.h M include/osmocom/core/sercomm.h M include/osmocom/core/signal.h M include/osmocom/core/socket.h M include/osmocom/core/stat_item.h M include/osmocom/core/statistics.h M include/osmocom/core/strrb.h M include/osmocom/core/timer.h M include/osmocom/core/timer_compat.h M include/osmocom/core/utils.h M include/osmocom/core/write_queue.h M include/osmocom/crypt/auth.h M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gprs/gprs_rlc.h M include/osmocom/gprs/protocol/gsm_08_16.h M include/osmocom/gprs/protocol/gsm_08_18.h M include/osmocom/gsm/a5.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/kasumi.h M include/osmocom/gsm/l1sap.h M include/osmocom/gsm/lapd_core.h M include/osmocom/gsm/lapdm.h M include/osmocom/gsm/oap.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_08_08.h M include/osmocom/gsm/protocol/gsm_08_58.h M include/osmocom/gsm/protocol/gsm_12_21.h M include/osmocom/gsm/rsl.h M include/osmocom/gsm/tlv.h M include/osmocom/sim/sim.h M include/osmocom/vty/command.h M include/osmocom/vty/telnet_interface.h M include/osmocom/vty/vty.h M src/application.c M src/backtrace.c M src/bitcomp.c M src/bits.c M src/bitvec.c M src/codec/gsm610.c M src/codec/gsm620.c M src/codec/gsm690.c M src/coding/gsm0503_coding.c M src/coding/gsm0503_interleaving.c M src/coding/gsm0503_mapping.c M src/coding/gsm0503_parity.c M src/coding/gsm0503_tables.c M src/conv.c M src/crc16.c M src/crcXXgen.c.tpl M src/ctrl/control_if.c M src/ctrl/fsm_ctrl_commands.c M src/fsm.c M src/gb/gprs_bssgp_bss.c M src/gb/gprs_ns.c M src/gsm/a5.c M src/gsm/abis_nm.c M src/gsm/auth_core.c M src/gsm/comp128.c M src/gsm/comp128v23.c M src/gsm/gan.c M src/gsm/gea.c M src/gsm/gprs_cipher_core.c M src/gsm/gprs_rlc.c M src/gsm/gsm0341.c M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_utils.c M src/gsm/gsm0808.c M src/gsm/gsm0808_utils.c M src/gsm/gsm48.c M src/gsm/gsm48_ie.c M src/gsm/gsm_04_08_gprs.c M src/gsm/gsm_utils.c M src/gsm/gsup.c M src/gsm/ipa.c M src/gsm/lapd_core.c M src/gsm/lapdm.c M src/gsm/oap.c M src/gsm/rsl.c M src/gsm/sysinfo.c M src/gsm/tlv_parser.c M src/gsmtap_util.c M src/logging.c M src/logging_gsmtap.c M src/logging_syslog.c M src/loggingrb.c M src/macaddr.c M src/msgb.c M src/panic.c M src/plugin.c M src/prim.c M src/rate_ctr.c M src/select.c M src/sercomm.c M src/serial.c M src/signal.c M src/sim/core.c M src/socket.c M src/stat_item.c M src/strrb.c M src/timer.c M src/timer_gettimeofday.c M src/utils.c M src/vty/command.c M src/vty/fsm_vty.c M src/vty/logging_vty.c M src/vty/stats_vty.c M src/vty/telnet_interface.c M src/vty/utils.c M src/vty/vector.c M src/vty/vty.c M src/write_queue.c M utils/conv_gen.py 144 files changed, 1,572 insertions(+), 1,573 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/2983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87 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 Fri Jun 23 00:18:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:29 +0000 Subject: [MERGED] libosmocore[master]: doxygen: add missing gb API doc generation In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: add missing gb API doc generation ...................................................................... doxygen: add missing gb API doc generation Files in include/osmocom/gprs/ and src/gb/ are not included in any doxygen generated API docs. Add Doxyfile.gb.in and adjust configure.ac and Makefile.am. Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 --- M .gitignore A Doxyfile.gb.in M Makefile.am M configure.ac 4 files changed, 1,730 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 89459f0..f26b699 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ Doxyfile.vty Doxyfile.codec Doxyfile.coding +Doxyfile.gb debian/autoreconf.after debian/autoreconf.before @@ -115,6 +116,7 @@ doc/vty/html doc/vty/doxygen_sqlite3.db doc/gsm +doc/gb doc/html.tar doc/*.tag tags diff --git a/Doxyfile.gb.in b/Doxyfile.gb.in new file mode 100644 index 0000000..36b4f2b --- /dev/null +++ b/Doxyfile.gb.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 = libosmogb + +# 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 Gb 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/gb + +# 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/gprs @srcdir@/src/gb + +# 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 = 1 + +# 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 = doc/libosmocore.tag=../../core/html + +# 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/libosmogb.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 3f6df9b..b8de3ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,11 +19,14 @@ html_DATA = $(top_builddir)/doc/html.tar +doc: $(html_DATA) + $(html_DATA): $(top_builddir)/doc/core/html/index.html \ $(top_builddir)/doc/gsm/html/index.html \ $(top_builddir)/doc/vty/html/index.html \ $(top_builddir)/doc/codec/html/index.html \ - $(top_builddir)/doc/coding/html/index.html + $(top_builddir)/doc/coding/html/index.html \ + $(top_builddir)/doc/gb/html/index.html cd $(top_builddir)/doc && tar cf html.tar */html $(top_builddir)/doc/core/html/index.html: $(SOURCES) Doxyfile.core @@ -50,13 +53,18 @@ mkdir -p doc/coding $(DOXYGEN) Doxyfile.coding +$(top_builddir)/doc/gb/html/index.html: $(SOURCES) Doxyfile.gb + @rm -rf doc/gb + mkdir -p doc/gb + $(DOXYGEN) Doxyfile.gb + install-data-hook: cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar uninstall-hook: - cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding} + cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,gb} -DX_CLEAN = doc/{core,gsm,vty,codec,coding}/html/search/* doc/{core,gsm,vty,codec,coding}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding}/doxygen_sqlite3.db doc/*.tag +DX_CLEAN = doc/{core,gsm,vty,codec,coding,gb}/html/search/* doc/{core,gsm,vty,codec,coding,gb}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding,gb}/doxygen_sqlite3.db doc/*.tag endif MOSTLYCLEANFILES = $(DX_CLEAN) diff --git a/configure.ac b/configure.ac index 340a896..1e258a4 100644 --- a/configure.ac +++ b/configure.ac @@ -308,4 +308,5 @@ Doxyfile.vty Doxyfile.codec Doxyfile.coding + Doxyfile.gb Makefile) -- To view, visit https://gerrit.osmocom.org/2982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93 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 Fri Jun 23 00:18:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:29 +0000 Subject: [MERGED] libosmocore[master]: doxygen: include all undocumented items in the API doc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: include all undocumented items in the API doc ...................................................................... doxygen: include all undocumented items in the API doc Currently, files that omit the \file directive and all functions, enums, structs lacking a doxygen style comment are completely missing from the doxygen API docs. Set EXTRACT_ALL = YES so that all files and code items are at least listed in the doxygen API. Change-Id: I39f558ec0a33a61a1fcec0554f53c8e7668733de --- M Doxyfile.codec.in M Doxyfile.coding.in M Doxyfile.core.in M Doxyfile.gsm.in M Doxyfile.vty.in 5 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.codec.in b/Doxyfile.codec.in index 8435379..b826a36 100644 --- a/Doxyfile.codec.in +++ b/Doxyfile.codec.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.coding.in b/Doxyfile.coding.in index 28e3241..7c1a28e 100644 --- a/Doxyfile.coding.in +++ b/Doxyfile.coding.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.core.in b/Doxyfile.core.in index 58d35be..cc3d842 100644 --- a/Doxyfile.core.in +++ b/Doxyfile.core.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index feaef0e..9673ea7 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. diff --git a/Doxyfile.vty.in b/Doxyfile.vty.in index 073ee0c..204436f 100644 --- a/Doxyfile.vty.in +++ b/Doxyfile.vty.in @@ -318,7 +318,7 @@ # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. -- To view, visit https://gerrit.osmocom.org/2981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I39f558ec0a33a61a1fcec0554f53c8e7668733de 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 Fri Jun 23 00:18:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:18:29 +0000 Subject: [MERGED] libosmocore[master]: doxygen: drop INPUT gsm/protocol, already part of gsm/ In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: drop INPUT gsm/protocol, already part of gsm/ ...................................................................... doxygen: drop INPUT gsm/protocol, already part of gsm/ include/osmocom/gsm/protocol is also implicitly included in its parent dir because of the recursive rule. Naming it again makes doxygen use it twice. It doesn't seem to be harmful, but not needed either. Change-Id: I5dc22ca65740a88540dacc61c0742fede172de9c --- 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 1dae2b5..feaef0e 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@/include/osmocom/gsm/protocol @srcdir@/src/gsm +INPUT = @srcdir@/include/osmocom/gsm @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/2980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5dc22ca65740a88540dacc61c0742fede172de9c 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 Fri Jun 23 00:51:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:51:07 +0000 Subject: [PATCH] libosmocore[master]: fix map entry for gsm0808_chan_type_to_speech_codec Message-ID: Review at https://gerrit.osmocom.org/3016 fix map entry for gsm0808_chan_type_to_speech_codec Recent commit 3149b0d076477303a38df735fe579b1b06ee17b2 adds function gsm0808_chan_type_to_speech_codec() but adds a mismatching name in libosmogsm.map. Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 --- M src/gsm/libosmogsm.map 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/3016/1 diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 36cba39..2da8649 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,7 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; -gsm0808_convert_to_speech_codec_type; +gsm0808_chan_type_to_speech_codec; gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/3016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 00:51:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:51:07 +0000 Subject: [PATCH] libosmocore[master]: fix map entry for gsm0808_speech_codec_from_chan_type Message-ID: Review at https://gerrit.osmocom.org/3017 fix map entry for gsm0808_speech_codec_from_chan_type Recent commit 884ba0f2bcaf385cabee0b4228a2598d61fa406b adds function gsm0808_chan_type_to_speech_codec() but adds a mismatching name in libosmogsm.map. openbsc.git's aoip branch can't build with this. This must have been an on-the-fly rename that wasn't properly tested. Always test your patches! Change-Id: I68feb14f7bcb2f62b89f9b2d8c085d6824b493bc --- M src/gsm/libosmogsm.map 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/3017/1 diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 2da8649..e992a4f 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,7 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_chan_type_to_speech_codec; -gsm0808_extrapolate_speech_codec; +gsm0808_speech_codec_from_chan_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/3017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68feb14f7bcb2f62b89f9b2d8c085d6824b493bc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 00:59:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 00:59:56 +0000 Subject: [PATCH] libosmocore[master]: fix map entry and .h declaration for gsm0808_chan_type_to_sp... In-Reply-To: References: Message-ID: fix map entry and .h declaration for gsm0808_chan_type_to_speech_codec() Recent commit 3149b0d076477303a38df735fe579b1b06ee17b2 adds function gsm0808_chan_type_to_speech_codec() but adds a completely mismatching name in libosmogsm.map, as well as a definition with a typo in the name. Fix the entry in libosmogsm.map. Add the missing 'c' in gsm0808_utils.h Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/libosmogsm.map 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/3016/2 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 57ba171..17a03f5 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -50,6 +50,6 @@ const struct gsm0808_cell_id_list *cil); int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); -int gsm0808_chan_type_to_speech_code(uint8_t perm_spch); +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/libosmogsm.map b/src/gsm/libosmogsm.map index 36cba39..2da8649 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,7 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; -gsm0808_convert_to_speech_codec_type; +gsm0808_chan_type_to_speech_codec; gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/3016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 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 Fri Jun 23 01:02:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:02:35 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: aoip: move to libosmocore master Message-ID: Review at https://gerrit.osmocom.org/3018 jenkins: aoip: move to libosmocore master The patches needed for AoIP have now been merged to libosmocore master. Change-Id: I31f627f24e0e111c2c3461dbdc88f0e54ebf0c8c --- M contrib/jenkins-build-osmo-msc.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/18/3018/1 diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 5241966..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -4,7 +4,7 @@ name="osmo-msc" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore neels/aoip # TEMPORARY BRANCH +build_repo libosmocore build_repo libosmo-abis build_repo libosmo-netif build_repo openggsn -- To view, visit https://gerrit.osmocom.org/3018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31f627f24e0e111c2c3461dbdc88f0e54ebf0c8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:22:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:22:27 +0000 Subject: [PATCH] libosmo-sccp[master]: fix sanitize make check: xua_test: initialize gt_out. Message-ID: Review at https://gerrit.osmocom.org/3019 fix sanitize make check: xua_test: initialize gt_out. The sanitize build fails because gt_out is not initialized to zero, but is later mem-compared to a zero-initialized struct. Zero-initialize gt_out. Also print in the test output both byte dumps. It helped to figure out the test failure and might as well stay. Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070 --- M tests/xua/xua_test.c M tests/xua/xua_test.ok 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/19/3019/1 diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index da3ee95..4af0836 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -151,10 +151,11 @@ { struct msgb *msg = msgb_alloc(1024, "foo"); const struct osmo_sccp_gt *gt_in = &sccp_addr_testcases[0].expected.gt; - struct osmo_sccp_gt gt_out; + struct osmo_sccp_gt gt_out = {}; printf("Testing Decoded GT -> SUA encoding\n"); printf("IN: %s\n", osmo_sccp_gt_dump(gt_in)); + printf(" %s\n", osmo_hexdump_nospc(gt_in, sizeof(struct osmo_sccp_gt))); /* encode sccp_addr to SUA GT */ xua_part_add_gt(msg, gt_in); @@ -167,6 +168,7 @@ /* parse + compare */ sua_parse_gt(>_out, msgb_data(msg), msgb_length(msg)); printf("OUT:%s\n", osmo_sccp_gt_dump(>_out)); + printf(" %s\n", osmo_hexdump_nospc(>_out, sizeof(struct osmo_sccp_gt))); OSMO_ASSERT(!memcmp(gt_in, >_out, sizeof(gt_out))); msgb_free(msg); diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 2184902..ca8572a 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -11,7 +11,9 @@ parsed: RI=7,SSN=254,GTI=0 Testing Decoded GT -> SUA encoding IN: TT=0,NPL=1,NAI=4,DIG=919969679389 + 0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000 OUT:TT=0,NPL=1,NAI=4,DIG=919969679389 + 0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000 => BSSMAP-RESET SCCP Input: [L2]> 09 00 03 05 07 02 42 fe 02 42 fe 06 00 04 30 04 01 20 -- To view, visit https://gerrit.osmocom.org/3019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:24:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:24:56 +0000 Subject: libosmo-sccp[master]: fix sanitize make check: xua_test: initialize gt_out. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Fri Jun 23 01:25:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:25:04 +0000 Subject: [MERGED] libosmo-sccp[master]: fix sanitize make check: xua_test: initialize gt_out. In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix sanitize make check: xua_test: initialize gt_out. ...................................................................... fix sanitize make check: xua_test: initialize gt_out. The sanitize build fails because gt_out is not initialized to zero, but is later mem-compared to a zero-initialized struct. Zero-initialize gt_out. Also print in the test output both byte dumps. It helped to figure out the test failure and might as well stay. Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070 --- M tests/xua/xua_test.c M tests/xua/xua_test.ok 2 files changed, 5 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index da3ee95..4af0836 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -151,10 +151,11 @@ { struct msgb *msg = msgb_alloc(1024, "foo"); const struct osmo_sccp_gt *gt_in = &sccp_addr_testcases[0].expected.gt; - struct osmo_sccp_gt gt_out; + struct osmo_sccp_gt gt_out = {}; printf("Testing Decoded GT -> SUA encoding\n"); printf("IN: %s\n", osmo_sccp_gt_dump(gt_in)); + printf(" %s\n", osmo_hexdump_nospc(gt_in, sizeof(struct osmo_sccp_gt))); /* encode sccp_addr to SUA GT */ xua_part_add_gt(msg, gt_in); @@ -167,6 +168,7 @@ /* parse + compare */ sua_parse_gt(>_out, msgb_data(msg), msgb_length(msg)); printf("OUT:%s\n", osmo_sccp_gt_dump(>_out)); + printf(" %s\n", osmo_hexdump_nospc(>_out, sizeof(struct osmo_sccp_gt))); OSMO_ASSERT(!memcmp(gt_in, >_out, sizeof(gt_out))); msgb_free(msg); diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 2184902..ca8572a 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -11,7 +11,9 @@ parsed: RI=7,SSN=254,GTI=0 Testing Decoded GT -> SUA encoding IN: TT=0,NPL=1,NAI=4,DIG=919969679389 + 0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000 OUT:TT=0,NPL=1,NAI=4,DIG=919969679389 + 0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000 => BSSMAP-RESET SCCP Input: [L2]> 09 00 03 05 07 02 42 fe 02 42 fe 06 00 04 30 04 01 20 -- To view, visit https://gerrit.osmocom.org/3019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:35:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:35:11 +0000 Subject: libosmocore[master]: fix map entry and .h declaration for gsm0808_chan_type_to_sp... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 Gerrit-PatchSet: 2 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 Fri Jun 23 01:35:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:35:15 +0000 Subject: libosmocore[master]: fix map entry for gsm0808_speech_codec_from_chan_type In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68feb14f7bcb2f62b89f9b2d8c085d6824b493bc Gerrit-PatchSet: 2 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 Fri Jun 23 01:35:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:35:18 +0000 Subject: [MERGED] libosmocore[master]: fix map entry for gsm0808_speech_codec_from_chan_type In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix map entry for gsm0808_speech_codec_from_chan_type ...................................................................... fix map entry for gsm0808_speech_codec_from_chan_type Recent commit 884ba0f2bcaf385cabee0b4228a2598d61fa406b adds function gsm0808_chan_type_to_speech_codec() but adds a mismatching name in libosmogsm.map. openbsc.git's aoip branch can't build with this. This must have been an on-the-fly rename that wasn't properly tested. Always test your patches! Change-Id: I68feb14f7bcb2f62b89f9b2d8c085d6824b493bc --- M src/gsm/libosmogsm.map 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 2da8649..e992a4f 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -163,7 +163,7 @@ gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; gsm0808_chan_type_to_speech_codec; -gsm0808_extrapolate_speech_codec; +gsm0808_speech_codec_from_chan_type; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/3017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68feb14f7bcb2f62b89f9b2d8c085d6824b493bc Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:35:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:35:18 +0000 Subject: [MERGED] libosmocore[master]: fix map entry and .h declaration for gsm0808_chan_type_to_sp... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix map entry and .h declaration for gsm0808_chan_type_to_speech_codec() ...................................................................... fix map entry and .h declaration for gsm0808_chan_type_to_speech_codec() Recent commit 3149b0d076477303a38df735fe579b1b06ee17b2 adds function gsm0808_chan_type_to_speech_codec() but adds a completely mismatching name in libosmogsm.map, as well as a definition with a typo in the name. Fix the entry in libosmogsm.map. Add the missing 'c' in gsm0808_utils.h Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/libosmogsm.map 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 57ba171..17a03f5 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -50,6 +50,6 @@ const struct gsm0808_cell_id_list *cil); int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len); -int gsm0808_chan_type_to_speech_code(uint8_t perm_spch); +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/libosmogsm.map b/src/gsm/libosmogsm.map index 36cba39..2da8649 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -162,7 +162,7 @@ gsm0808_dec_encrypt_info; gsm0808_enc_cell_id_list; gsm0808_dec_cell_id_list; -gsm0808_convert_to_speech_codec_type; +gsm0808_chan_type_to_speech_codec; gsm0808_extrapolate_speech_codec; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/3016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a621fa5ef6b632eabbe224f3dd383eacaffb695 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:35:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:35:35 +0000 Subject: osmo-gsm-tester[master]: jenkins: aoip: move to libosmocore master In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31f627f24e0e111c2c3461dbdc88f0e54ebf0c8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 23 01:35:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:35:37 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: aoip: move to libosmocore master In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: aoip: move to libosmocore master ...................................................................... jenkins: aoip: move to libosmocore master The patches needed for AoIP have now been merged to libosmocore master. Change-Id: I31f627f24e0e111c2c3461dbdc88f0e54ebf0c8c --- M contrib/jenkins-build-osmo-msc.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 5241966..53a23fe 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -4,7 +4,7 @@ name="osmo-msc" . "$(dirname "$0")/jenkins-build-common.sh" -build_repo libosmocore neels/aoip # TEMPORARY BRANCH +build_repo libosmocore build_repo libosmo-abis build_repo libosmo-netif build_repo openggsn -- To view, visit https://gerrit.osmocom.org/3018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31f627f24e0e111c2c3461dbdc88f0e54ebf0c8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:57:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:57:53 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins-build-common.sh: fix being stuck on branch Message-ID: Review at https://gerrit.osmocom.org/3020 jenkins-build-common.sh: fix being stuck on branch It's hard to allow both branch names and git hashes. For a branch, we want to prepend 'origin' to use the upstream branch. For a git hash, we don't. We so far prepend 'origin/' if the current branch name doesn't resolve, but that's not enough. If a local 'master' branch exists, we would stay on that branch instead of origin/master. Rather, prepend 'origin/' if 'origin/$branch' exists. Git hashes should not exist as 'origin/123abc...' and used as-is, where branches from origin should be updated to upstream by prepending 'origin/'. Also create a local branch to build. Always force-remove the branch and re-create from the origin/name or git hash. Keep the reset --hard for paranoia. Change-Id: I2e610b357f8559c6b6ffb544eb0a952f04dd9f70 --- M contrib/jenkins-build-common.sh 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/20/3020/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 921434d..63e0ba8 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -81,10 +81,12 @@ git fetch origin # Figure out whether we need to prepend origin/ to find branches in upstream - if ! git rev-parse "$branch"; then + if git rev-parse "origin/$branch"; then branch="origin/$branch" fi + git branch -D build_branch || true + git checkout -b build_branch "$branch" git reset --hard "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/3020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e610b357f8559c6b6ffb544eb0a952f04dd9f70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 01:58:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:58:42 +0000 Subject: osmo-gsm-tester[master]: jenkins-build-common.sh: fix being stuck on branch In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2e610b357f8559c6b6ffb544eb0a952f04dd9f70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 23 01:59:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 01:59:51 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins-build-common.sh: fix being stuck on branch In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins-build-common.sh: fix being stuck on branch ...................................................................... jenkins-build-common.sh: fix being stuck on branch It's hard to allow both branch names and git hashes. For a branch, we want to prepend 'origin' to use the upstream branch. For a git hash, we don't. We so far prepend 'origin/' if the current branch name doesn't resolve, but that's not enough. If a local 'master' branch exists, we would stay on that branch instead of origin/master. Rather, prepend 'origin/' if 'origin/$branch' exists. Git hashes should not exist as 'origin/123abc...' and used as-is, where branches from origin should be updated to upstream by prepending 'origin/'. Also create a local branch to build. Always force-remove the branch and re-create from the origin/name or git hash. Keep the reset --hard for paranoia. Change-Id: I2e610b357f8559c6b6ffb544eb0a952f04dd9f70 --- M contrib/jenkins-build-common.sh 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 921434d..63e0ba8 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -81,10 +81,12 @@ git fetch origin # Figure out whether we need to prepend origin/ to find branches in upstream - if ! git rev-parse "$branch"; then + if git rev-parse "origin/$branch"; then branch="origin/$branch" fi + git branch -D build_branch || true + git checkout -b build_branch "$branch" git reset --hard "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/3020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e610b357f8559c6b6ffb544eb0a952f04dd9f70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 02:08:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 02:08:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins-build-common.sh: cosmetic: clear repos a bit later Message-ID: Review at https://gerrit.osmocom.org/3021 jenkins-build-common.sh: cosmetic: clear repos a bit later If we rm -rf * and then checkout a branch, the log prints the entire file tree as deleted. Instead, rm just before the git reset --hard, which avoids the extra output. Change-Id: Ib5b28a82f05d941eae8f3a2f468ef1e9d67e6180 --- M contrib/jenkins-build-common.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/21/3021/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 63e0ba8..779f965 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -77,7 +77,6 @@ git clone "$git_url/$repo" "$repo" fi cd "$repo" - rm -rf * git fetch origin # Figure out whether we need to prepend origin/ to find branches in upstream @@ -87,6 +86,7 @@ git branch -D build_branch || true git checkout -b build_branch "$branch" + rm -rf * git reset --hard "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/3021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5b28a82f05d941eae8f3a2f468ef1e9d67e6180 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 02:09:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 02:09:08 +0000 Subject: osmo-gsm-tester[master]: jenkins-build-common.sh: cosmetic: clear repos a bit later In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5b28a82f05d941eae8f3a2f468ef1e9d67e6180 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 23 02:09:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 02:09:10 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins-build-common.sh: cosmetic: clear repos a bit later In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins-build-common.sh: cosmetic: clear repos a bit later ...................................................................... jenkins-build-common.sh: cosmetic: clear repos a bit later If we rm -rf * and then checkout a branch, the log prints the entire file tree as deleted. Instead, rm just before the git reset --hard, which avoids the extra output. Change-Id: Ib5b28a82f05d941eae8f3a2f468ef1e9d67e6180 --- M contrib/jenkins-build-common.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 63e0ba8..779f965 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -77,7 +77,6 @@ git clone "$git_url/$repo" "$repo" fi cd "$repo" - rm -rf * git fetch origin # Figure out whether we need to prepend origin/ to find branches in upstream @@ -87,6 +86,7 @@ git branch -D build_branch || true git checkout -b build_branch "$branch" + rm -rf * git reset --hard "$branch" git rev-parse HEAD -- To view, visit https://gerrit.osmocom.org/3021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5b28a82f05d941eae8f3a2f468ef1e9d67e6180 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 02:17:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 02:17:41 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: fix: recent change broke jenkins build Message-ID: Review at https://gerrit.osmocom.org/3022 jenkins: fix: recent change broke jenkins build Recent commit 851802b927ccfcb061a2774fdc5de12141426b5c introduces a build branch, which works fine, but only on the first run. A second run in the same repos can't delete the branch git is currently on. I've had enough of git being impossibly difficult in UI to simply checkout a hash or a branch now. Completely wipe out the git repository and clone a fresh one every time. Unfortunately, 'git clone -b' doesn't allow passing a commit hash, so we still need to do a clone-then-checkout dance. At least now we know it will work the same on every run. Change-Id: I6aca4c53a796312248a189b815dfc1198a173ed9 --- M contrib/jenkins-build-common.sh 1 file changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3022/1 diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 779f965..895cd63 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -73,18 +73,17 @@ fi cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" "$repo" - fi - cd "$repo" - git fetch origin + rm -rf "$repo" + git clone "$git_url/$repo" "$repo" - # Figure out whether we need to prepend origin/ to find branches in upstream + cd "$repo" + + # Figure out whether we need to prepend origin/ to find branches in upstream. + # Doing this allows using git hashes instead of a branch name. if git rev-parse "origin/$branch"; then branch="origin/$branch" fi - git branch -D build_branch || true git checkout -b build_branch "$branch" rm -rf * git reset --hard "$branch" -- To view, visit https://gerrit.osmocom.org/3022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6aca4c53a796312248a189b815dfc1198a173ed9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 02:18:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 02:18:31 +0000 Subject: osmo-gsm-tester[master]: jenkins: fix: recent change broke jenkins build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6aca4c53a796312248a189b815dfc1198a173ed9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester 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 Fri Jun 23 02:18:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 02:18:36 +0000 Subject: [MERGED] osmo-gsm-tester[master]: jenkins: fix: recent change broke jenkins build In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: fix: recent change broke jenkins build ...................................................................... jenkins: fix: recent change broke jenkins build Recent commit 851802b927ccfcb061a2774fdc5de12141426b5c introduces a build branch, which works fine, but only on the first run. A second run in the same repos can't delete the branch git is currently on. I've had enough of git being impossibly difficult in UI to simply checkout a hash or a branch now. Completely wipe out the git repository and clone a fresh one every time. Unfortunately, 'git clone -b' doesn't allow passing a commit hash, so we still need to do a clone-then-checkout dance. At least now we know it will work the same on every run. Change-Id: I6aca4c53a796312248a189b815dfc1198a173ed9 --- M contrib/jenkins-build-common.sh 1 file changed, 6 insertions(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh index 779f965..895cd63 100644 --- a/contrib/jenkins-build-common.sh +++ b/contrib/jenkins-build-common.sh @@ -73,18 +73,17 @@ fi cd "$base" - if [ ! -d "$repo" ]; then - git clone "$git_url/$repo" "$repo" - fi - cd "$repo" - git fetch origin + rm -rf "$repo" + git clone "$git_url/$repo" "$repo" - # Figure out whether we need to prepend origin/ to find branches in upstream + cd "$repo" + + # Figure out whether we need to prepend origin/ to find branches in upstream. + # Doing this allows using git hashes instead of a branch name. if git rev-parse "origin/$branch"; then branch="origin/$branch" fi - git branch -D build_branch || true git checkout -b build_branch "$branch" rm -rf * git reset --hard "$branch" -- To view, visit https://gerrit.osmocom.org/3022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6aca4c53a796312248a189b815dfc1198a173ed9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 08:47:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 08:47:39 +0000 Subject: [PATCH] libosmocore[master]: contrib: Enable -Werror by default 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/2954 to look at the new patch set (#8). contrib: Enable -Werror by default Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c --- M contrib/jenkins-arm.sh M contrib/jenkins.sh 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/2954/8 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index d5fc31f..510b0e9 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -10,7 +10,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh @@ -27,7 +27,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0c11682..820ac45 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -5,7 +5,7 @@ ./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force -./configure --enable-static --enable-sanitize +./configure --enable-static --enable-sanitize CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ @@ -17,7 +17,7 @@ autoreconf --install --force mkdir builddir cd builddir -../configure --enable-static +../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 8 Gerrit-Project: libosmocore 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 Fri Jun 23 09:06:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:06:49 +0000 Subject: [PATCH] libosmocore[master]: serial.c: Use pragma message instead of warning Message-ID: Review at https://gerrit.osmocom.org/3023 serial.c: Use pragma message instead of warning Change-Id: I65b1ef6e4b9ba0bf0c3c2f03311250f31ddb308a --- M src/serial.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/3023/1 diff --git a/src/serial.c b/src/serial.c index dddad88..8ddd38e 100644 --- a/src/serial.c +++ b/src/serial.c @@ -202,7 +202,7 @@ } return 0; #else -#warning osmo_serial_set_custom_baudrate: unsupported platform +#pragma message ("osmo_serial_set_custom_baudrate: unsupported platform") return 0; #endif } -- To view, visit https://gerrit.osmocom.org/3023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I65b1ef6e4b9ba0bf0c3c2f03311250f31ddb308a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 23 09:08:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:08:52 +0000 Subject: [MERGED] libosmocore[master]: configure.ac: Enable -Wall by default In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: configure.ac: Enable -Wall by default ...................................................................... configure.ac: Enable -Wall by default Change-Id: I70f917e05ad46049487710d1752aad2505c96696 --- M configure.ac 1 file changed, 2 insertions(+), 2 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/configure.ac b/configure.ac index 1e258a4..64de4bf 100644 --- a/configure.ac +++ b/configure.ac @@ -235,8 +235,8 @@ CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" fi -CFLAGS+=" -DBUILDING_LIBOSMOCORE" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE" +CFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" +CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/2958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70f917e05ad46049487710d1752aad2505c96696 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore 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 Fri Jun 23 09:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:08:58 +0000 Subject: [MERGED] libosmocore[master]: gsm0411_utils.c: Fix compilation warnings In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: gsm0411_utils.c: Fix compilation warnings ...................................................................... gsm0411_utils.c: Fix compilation warnings gsm0411_utils.c:102:2: warning: #warning find a portable way to obtain timezone offset [-Wcpp] #warning find a portable way to obtain timezone offset gsm0411_utils.c: In function 'gsm338_get_sms_alphabet': gsm0411_utils.c:260:4: warning: large integer implicitly truncated to unsigned type [-Woverflow] return 0xffffffff; Change-Id: I1d6cb31f38721f79e2cf93f9b8e4776f3720aa07 --- M src/gsm/gsm0411_utils.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index 7c7164c..1d3ef49 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -100,7 +100,7 @@ #ifdef HAVE_TM_GMTOFF_IN_TM *scts++ = gsm411_bcdify(tm->tm_gmtoff/(60*15)); #else -#warning find a portable way to obtain timezone offset +#pragma message ("find a portable way to obtain timezone offset") *scts++ = 0; #endif } @@ -258,7 +258,7 @@ if (cgbits & 2) { LOGP(DLSMS, LOGL_NOTICE, "Compressed SMS not supported yet\n"); - return 0xffffffff; + return -1; } switch ((dcs >> 2)&0x03) { -- To view, visit https://gerrit.osmocom.org/2964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d6cb31f38721f79e2cf93f9b8e4776f3720aa07 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jun 23 09:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:08:58 +0000 Subject: [MERGED] libosmocore[master]: Fix warnings: tolower() and similar require uchar In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Fix warnings: tolower() and similar require uchar ...................................................................... Fix warnings: tolower() and similar require uchar utils.c: In function 'osmo_str2lower': utils.c:277:3: warning: array subscript has type 'char' [-Wchar-subscripts] out[i] = tolower(in[i]); And according to man: If c is neither an unsigned char value nor EOF, the behavior of these func? tions is undefined. Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f --- M src/gsm/gsm_utils.c M src/logging.c M src/utils.c 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: 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 5a4ceb3..61d3f83 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -596,7 +596,7 @@ /*! Parse string name of a GSM band */ enum gsm_band gsm_band_parse(const char* mhz) { - while (*mhz && !isdigit(*mhz)) + while (*mhz && !isdigit((unsigned char)*mhz)) mhz++; if (*mhz == '\0') diff --git a/src/logging.c b/src/logging.c index c8b86b1..2fb06ba 100644 --- a/src/logging.c +++ b/src/logging.c @@ -847,7 +847,7 @@ char name[name_len]; for (j = 0; j < name_len; j++) - name[j] = tolower(info->cat[i].name[j]); + name[j] = tolower((unsigned char)info->cat[i].name[j]); name[name_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", name+1); @@ -869,7 +869,7 @@ char loglevel_str[loglevel_str_len]; for (j = 0; j < loglevel_str_len; j++) - loglevel_str[j] = tolower(loglevel_strs[i].str[j]); + loglevel_str[j] = tolower((unsigned char)loglevel_strs[i].str[j]); loglevel_str[loglevel_str_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", loglevel_str); diff --git a/src/utils.c b/src/utils.c index a1881f0..1c176f8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -274,7 +274,7 @@ unsigned int i; for (i = 0; i < strlen(in); i++) - out[i] = tolower(in[i]); + out[i] = tolower((const unsigned char)in[i]); out[strlen(in)] = '\0'; } @@ -287,7 +287,7 @@ unsigned int i; for (i = 0; i < strlen(in); i++) - out[i] = toupper(in[i]); + out[i] = toupper((const unsigned char)in[i]); out[strlen(in)] = '\0'; } #endif /* HAVE_CTYPE_H */ -- To view, visit https://gerrit.osmocom.org/2963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jun 23 09:08:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:08:58 +0000 Subject: [MERGED] libosmocore[master]: Fix compilation warnings: use correct log type for uint32_t In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Fix compilation warnings: use correct log type for uint32_t ...................................................................... Fix compilation warnings: use correct log type for uint32_t Change-Id: Ic1e3255800999669ca9619bfceb4124c773eff2d --- M src/gsm/gsm48.c M src/utils.c 2 files changed, 4 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index f69eee2..10e2b80 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -637,7 +638,7 @@ /* Table 10.5.4.3, reverse generate_mid_from_tmsi */ if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) { tmsi = osmo_load32be(&mi[1]); - return snprintf(string, str_len, "%u", tmsi); + return snprintf(string, str_len, "%"PRIu32, tmsi); } break; case GSM_MI_TYPE_IMSI: diff --git a/src/utils.c b/src/utils.c index 9e3414b..a1881f0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -54,7 +55,7 @@ if (str) return str; - snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); + snprintf(namebuf, sizeof(namebuf), "unknown 0x%"PRIx32, val); namebuf[sizeof(namebuf) - 1] = '\0'; return namebuf; } -- To view, visit https://gerrit.osmocom.org/2962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1e3255800999669ca9619bfceb4124c773eff2d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jun 23 09:23:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:23:40 +0000 Subject: [PATCH] libosmocore[master]: configure.ac: Fix C(PP)FLAGS for BSD build Message-ID: Review at https://gerrit.osmocom.org/3024 configure.ac: Fix C(PP)FLAGS for BSD build If we pass CFLAGS params to configure, then the CFLAGS set inside configure.ac are not applied and the build fails if -Werror is enabled because then BUILDING_LIBOSMOCORE is not defined. Seeing the following output at configure time in FreeBSD build: ./configure: CFLAGS+= -fsanitize=address -fsanitize=undefined: not found ./configure: CPPFLAGS+= -fsanitize=address -fsanitize=undefined: not found ./configure: CFLAGS+= -DBUILDING_LIBOSMOCORE -Wall: not found ./configure: CPPFLAGS+= -DBUILDING_LIBOSMOCORE -Wall: not found Change-Id: I692bbc66e5343998eec360a02a3a1fe73478c5c6 --- M configure.ac 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/3024/1 diff --git a/configure.ac b/configure.ac index 64de4bf..92544b6 100644 --- a/configure.ac +++ b/configure.ac @@ -231,12 +231,12 @@ [sanitize=$enableval], [sanitize="no"]) if test x"$sanitize" = x"yes" then - CFLAGS+=" -fsanitize=address -fsanitize=undefined" - CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" + CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" + CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi -CFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" +CFLAGS="$CFLAGS -DBUILDING_LIBOSMOCORE -Wall" +CPPFLAGS="$CPPFLAGS -DBUILDING_LIBOSMOCORE -Wall" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/3024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I692bbc66e5343998eec360a02a3a1fe73478c5c6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 23 09:46:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 09:46:00 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add microsecond accuracy to log timestamps Message-ID: Review at https://gerrit.osmocom.org/3025 Add microsecond accuracy to log timestamps This is useful while debugging and trying to check events across other outputs such as pcap files, process logs, etc. Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8 --- M selftest/process_test.ok.ign M src/osmo_gsm_tester/log.py M src/osmo_gsm_tester/process.py 3 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/3025/1 diff --git a/selftest/process_test.ok.ign b/selftest/process_test.ok.ign index 0abd7d5..b817f5a 100644 --- a/selftest/process_test.ok.ign +++ b/selftest/process_test.ok.ign @@ -1,7 +1,7 @@ PATH='[^']*' PATH=[$PATH] /tmp/[^/ '"]* [TMP] pid=[0-9]* pid=[PID] -....-..-.._..:..:.. [DATETIME] +....-..-.._..:..:..\....... [DATETIME] '[^']*/selftest/process_test/foo.py' [$0] "[^"]*/selftest/process_test/foo.py" [$0] , line [0-9]* , line [LINE] diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py index c4a6629..a9f16c2 100644 --- a/src/osmo_gsm_tester/log.py +++ b/src/osmo_gsm_tester/log.py @@ -23,6 +23,7 @@ import traceback import contextlib import atexit +from datetime import datetime # we need this for strftime as the one from time doesn't carry microsecond info from inspect import getframeinfo, stack from .util import is_dict @@ -80,8 +81,8 @@ target.log(origin, category, level, src, messages, named_items) -LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S' -DATEFMT = '%H:%M:%S' +LONG_DATEFMT = '%Y-%m-%d_%H:%M:%S.%f' +DATEFMT = '%H:%M:%S.%f' # may be overridden by regression tests get_process_id = lambda: '%d-%d' % (os.getpid(), time.time()) @@ -105,7 +106,7 @@ all_levels = None # redirected by logging test - get_time_str = lambda self: time.strftime(self.log_time_fmt) + get_time_str = lambda self: datetime.now().strftime(self.log_time_fmt) # sink that gets each complete logging line log_write_func = None diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index d24bf3d..4b68ef5 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -21,6 +21,7 @@ import time import subprocess import signal +from datetime import datetime from . import log, test, event_loop from .util import Dir @@ -55,7 +56,7 @@ path = self.run_dir.new_child(name) f = open(path, 'w') self.dbg(path) - f.write('(launched: %s)\n' % time.strftime(log.LONG_DATEFMT)) + f.write('(launched: %s)\n' % datetime.now().strftime(log.LONG_DATEFMT)) f.flush() self.outputs[name] = (path, f) return f -- To view, visit https://gerrit.osmocom.org/3025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8 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 Jun 23 10:46:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 10:46:38 +0000 Subject: [PATCH] libosmocore[master]: abis_nm.c: Fix implicit enumeration type conversion Message-ID: Review at https://gerrit.osmocom.org/3026 abis_nm.c: Fix implicit enumeration type conversion Fixes following warning message: abis_nm.c:101:2: warning: implicit conversion from enumeration type 'enum abis_nm_msgtype_bs11' to different enumeration type 'enum abis_nm_msgtype' [-Wenum-conversion] Change-Id: Icb0ed423febf1ceb6626e256d32011b4118fc527 --- M src/gsm/abis_nm.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/3026/1 diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index c59ebb7..2ad1945 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -98,10 +98,10 @@ NM_MT_CHG_HW_CONF_NACK, NM_MT_GET_ATTR_NACK, NM_MT_SET_ALARM_THRES_NACK, - NM_MT_BS11_BEGIN_DB_TX_NACK, - NM_MT_BS11_END_DB_TX_NACK, - NM_MT_BS11_CREATE_OBJ_NACK, - NM_MT_BS11_DELETE_OBJ_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_BEGIN_DB_TX_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_END_DB_TX_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_CREATE_OBJ_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_DELETE_OBJ_NACK, }; static const struct value_string nack_names[] = { -- To view, visit https://gerrit.osmocom.org/3026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb0ed423febf1ceb6626e256d32011b4118fc527 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 23 10:46:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 10:46:39 +0000 Subject: [PATCH] libosmocore[master]: control_cmd.c: Fix unsiged comparison against < 0 Message-ID: Review at https://gerrit.osmocom.org/3027 control_cmd.c: Fix unsiged comparison against < 0 Fixes following warning: control_cmd.c:294:16: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c --- M src/ctrl/control_cmd.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/3027/1 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 836bb71..24b388b 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -291,7 +291,7 @@ } cmd->type = get_string_value(ctrl_type_vals, tmp); - if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { + if ((int)cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Request type unknown"; -- To view, visit https://gerrit.osmocom.org/3027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 23 10:57:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 10:57:28 +0000 Subject: [PATCH] libosmocore[master]: contrib: Enable -Werror by default 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/2954 to look at the new patch set (#12). contrib: Enable -Werror by default Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c --- M contrib/jenkins-arm.sh M contrib/jenkins.sh 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/2954/12 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index d5fc31f..510b0e9 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -10,7 +10,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh @@ -27,7 +27,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0c11682..820ac45 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -5,7 +5,7 @@ ./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force -./configure --enable-static --enable-sanitize +./configure --enable-static --enable-sanitize CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ @@ -17,7 +17,7 @@ autoreconf --install --force mkdir builddir cd builddir -../configure --enable-static +../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 12 Gerrit-Project: libosmocore 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 Fri Jun 23 11:10:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 11:10:57 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ofono_client: Power off modem during cleanup() Message-ID: Review at https://gerrit.osmocom.org/3028 ofono_client: Power off modem during cleanup() Change-Id: Ic0c509e77ababf385beb8b1d26659ca4d18f9331 --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/3028/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 70fee25..60f98df 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -167,6 +167,7 @@ self.connected_signals = util.listdict() def cleanup(self): + self.set_powered(False) self.unwatch_interfaces() for interface_name in list(self.connected_signals.keys()): self.remove_signals(interface_name) -- To view, visit https://gerrit.osmocom.org/3028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0c509e77ababf385beb8b1d26659ca4d18f9331 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 Jun 23 11:13:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 11:13:22 +0000 Subject: osmo-gsm-tester[master]: ofono_client: Power off modem when resource is freed In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) I abandon this commit, I just pushed one calling set_powered(False) during cleanup as you suggested. https://gerrit.osmocom.org/#/c/2697/2/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 122: 'origin' a log.Origin() instance which can be sued to log information. > To sue someone means to take them to court. Ah! It's a typo! "used" lol I'm not answering anymore until my lawyer is here! -- To view, visit https://gerrit.osmocom.org/2697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibde7573267f1c63d075cf0147ed614a4b1ff46c8 Gerrit-PatchSet: 2 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: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 23 11:13:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 11:13:26 +0000 Subject: [ABANDON] osmo-gsm-tester[master]: ofono_client: Power off modem when resource is freed In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: ofono_client: Power off modem when resource is freed ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ibde7573267f1c63d075cf0147ed614a4b1ff46c8 Gerrit-PatchSet: 2 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 Fri Jun 23 13:42:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 13:42:49 +0000 Subject: [PATCH] libosmocore[master]: control_cmd.c: Fix unsigned comparison against < 0 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3027 to look at the new patch set (#3). control_cmd.c: Fix unsigned comparison against < 0 Fixes following warning: control_cmd.c:294:16: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c --- M src/ctrl/control_cmd.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/3027/3 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 836bb71..24b388b 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -291,7 +291,7 @@ } cmd->type = get_string_value(ctrl_type_vals, tmp); - if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { + if ((int)cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Request type unknown"; -- To view, visit https://gerrit.osmocom.org/3027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 23 13:42:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 13:42:49 +0000 Subject: [PATCH] libosmocore[master]: contrib: Enable -Werror by default 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/2954 to look at the new patch set (#13). contrib: Enable -Werror by default Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c --- M contrib/jenkins-arm.sh M contrib/jenkins.sh 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/2954/13 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index d5fc31f..510b0e9 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -10,7 +10,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh @@ -27,7 +27,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index bb6c3cb..6a72840 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -11,7 +11,7 @@ fi autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE +./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ @@ -23,7 +23,7 @@ autoreconf --install --force mkdir builddir cd builddir -../configure --enable-static +../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 13 Gerrit-Project: libosmocore 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 Fri Jun 23 13:42:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 13:42:50 +0000 Subject: [PATCH] libosmocore[master]: jenkins.sh: Disable sanitize for FreeBSD Message-ID: Review at https://gerrit.osmocom.org/3029 jenkins.sh: Disable sanitize for FreeBSD Our current build server uses clang-3.4.1 and FreeBSD10.3, and AddressSanitizer support is not good yet on those versions, triggering some link issues when it is enabled. I tested using newer clang 3.7.1 in the same FreeBSD version but another compiler error related to __builtin_cpu_supports is triggered. Conclusion: Explicitly disable AddressSanitizer until we move to FreeBSD11 with clang 3.8. Before this commit, AddressSanitizer was implicitly disabled due to a shell compatibility issue which is fixed in next commit in the series, thus we need to explicitly disable it here. Change-Id: I0db497045a2ebf7877232b28ae1fcf1fd89fb3f3 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/3029/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 0c11682..bb6c3cb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,8 +4,14 @@ ./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +if [ "x$label" = "xFreeBSD_amd64" ]; then + ENABLE_SANITIZE="" +else + ENABLE_SANITIZE="--enable-sanitize" +fi + autoreconf --install --force -./configure --enable-static --enable-sanitize +./configure --enable-static $ENABLE_SANITIZE $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ -- To view, visit https://gerrit.osmocom.org/3029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0db497045a2ebf7877232b28ae1fcf1fd89fb3f3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 23 14:10:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:10:01 +0000 Subject: libosmocore[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Patch Set 13: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 13 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jun 23 14:10:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:10:17 +0000 Subject: libosmocore[master]: configure.ac: Fix C(PP)FLAGS for BSD build In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I692bbc66e5343998eec360a02a3a1fe73478c5c6 Gerrit-PatchSet: 3 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 Jun 23 14:10:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:10:26 +0000 Subject: libosmocore[master]: jenkins.sh: Disable sanitize for FreeBSD In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0db497045a2ebf7877232b28ae1fcf1fd89fb3f3 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 Jun 23 14:10:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:10:35 +0000 Subject: libosmocore[master]: control_cmd.c: Fix unsigned comparison against < 0 In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c Gerrit-PatchSet: 3 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 Jun 23 14:10:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:10:46 +0000 Subject: libosmocore[master]: abis_nm.c: Fix implicit enumeration type conversion In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb0ed423febf1ceb6626e256d32011b4118fc527 Gerrit-PatchSet: 2 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 Jun 23 14:10:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:10:56 +0000 Subject: libosmocore[master]: serial.c: Use pragma message instead of warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I65b1ef6e4b9ba0bf0c3c2f03311250f31ddb308a 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 Jun 23 14:11:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:11:32 +0000 Subject: osmo-gsm-tester[master]: Add microsecond accuracy to log timestamps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43bb5c6e9977189251802bc2b078c52eb046bab8 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 Fri Jun 23 14:11:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:11:47 +0000 Subject: libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 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 Fri Jun 23 14:12:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:12:17 +0000 Subject: libosmo-sccp[master]: sccp_user.c: add missing error logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c 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 Fri Jun 23 14:12:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:12:35 +0000 Subject: libosmo-sccp[master]: gen_mtp_transfer_req_xua(): add addr to error log for missin... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icfd45bcbecc440b94893db2aca537a162f210abd 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 Fri Jun 23 14:20:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:20:51 +0000 Subject: libosmo-sccp[master]: add various debug logging to help figure out complex SCCP ro... In-Reply-To: References: Message-ID: Patch Set 1: (10 comments) https://gerrit.osmocom.org/#/c/3012/1//COMMIT_MSG Commit Message: Line 7: add various debug logging to help figure out complex SCCP routing actually, I think we only implement MTP-level routing so far. https://gerrit.osmocom.org/#/c/3012/1/src/m3ua.c File src/m3ua.c: Line 562: "m3ua data hdr opc=%u dpc=%u\n", I think the function name or some other indication should be given to indicate *where* we are logging this from. just printing some header details could happen pretty much any place in the stack. https://gerrit.osmocom.org/#/c/3012/1/src/osmo_ss7.c File src/osmo_ss7.c: Line 745: DEBUGP(DLSS7, "Created route pc=%u mask=%u name=%s linkset %s\n", pc, mask, linkset_name, route creation/removal is rather rare, and it could actually be propagated to LOGL_INFO. your call. https://gerrit.osmocom.org/#/c/3012/1/src/osmo_ss7_hmrt.c File src/osmo_ss7_hmrt.c: Line 135: DEBUGP(DLSS7, "found route for dpc %u: %s pc=%u mask=%u %s:%s\n", dpc, point-codes can be printing in a more meaningful representation than as unsigned int. osmo_ss7_* has already some functions for parsing and stringification. Line 152: DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc %u\n", dpc); if you want to print this, I think it should go one level up and print for any as->cfg.proto, and not just in the M3UA case. Line 184: DEBUGP(DLSS7, "dpc %u is local\n", dpc); again I think here it's useful to see the context, i.e. that we just received a message from L2 and now have determined that an incoming message is local (or routing for remote below) https://gerrit.osmocom.org/#/c/3012/1/src/sccp_scoc.c File src/sccp_scoc.c: PS1, Line 1547: c could move into sccp_scoc_rx_inval_src_ref() and could be propagated from debug to notice. Line 1556: DEBUGP(DLSCCP, "xua->mtp.opc(%u) != conn->remote_pc(%u)\n", could be moved into sccp_scoc_rx_inval_opc() and could be propagated to notice. https://gerrit.osmocom.org/#/c/3012/1/src/sccp_scrc.c File src/sccp_scrc.c: Line 241: LOGP(DLSS7, LOGL_DEBUG, "scrc_node_4\n"); I'm not sure if we want to trace every node here, that's a bit excessive from my POV. Also, as there are many packets traversing the code (although only sequentially), the log statement should probably include some information about what particular packet is processed here? Finally, if LOGL_DEBUG, DEBUGP() could be used to shorten it. Line 461: LOGP(DLSS7, LOGL_DEBUG, "hop-counter violation\n"); I think this is a) reported by arelated SCCP return cause message, i.e. visible in the protocol trace b) is not a DEBUG level event, but at least INFO, if not NOTICE. Probably the latter. -- To view, visit https://gerrit.osmocom.org/3012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Jun 23 14:21:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:21:13 +0000 Subject: libosmo-sccp[master]: cosmetic: drop second ';;' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I861b87e485d94f17e4b4a800c8da865f98633c92 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 Fri Jun 23 14:21:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:21:14 +0000 Subject: [MERGED] libosmo-sccp[master]: cosmetic: drop second ';;' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: drop second ';;' ...................................................................... cosmetic: drop second ';;' Change-Id: I861b87e485d94f17e4b4a800c8da865f98633c92 --- M include/osmocom/sigtran/osmo_ss7.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/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 741a7e3..4e04352 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -294,7 +294,7 @@ uint8_t qos_class; struct { uint32_t dpc; - } pc_override;; + } pc_override; struct osmo_ss7_asp *asps[16]; } cfg; -- To view, visit https://gerrit.osmocom.org/3011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I861b87e485d94f17e4b4a800c8da865f98633c92 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 Fri Jun 23 14:21:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:21:33 +0000 Subject: osmo-bts[master]: lc15: fix jenkins build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 23 14:21:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 14:21:46 +0000 Subject: [MERGED] osmo-bts[master]: lc15: fix jenkins build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: fix jenkins build ...................................................................... lc15: fix jenkins build * use proper fw headers include path * do not quote $PARALLEL_MAKE variable Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9 Related: SYS#3682 --- M contrib/jenkins_lc15.sh 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index c9173bf..af335d5 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -23,7 +23,7 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/" --enable-litecell15 -$MAKE "$PARALLEL_MAKE" +./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 +$MAKE $PARALLEL_MAKE $MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jun 23 15:42:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 15:42:43 +0000 Subject: [MERGED] libosmocore[master]: serial.c: Use pragma message instead of warning In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: serial.c: Use pragma message instead of warning ...................................................................... serial.c: Use pragma message instead of warning Change-Id: I65b1ef6e4b9ba0bf0c3c2f03311250f31ddb308a --- M src/serial.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/serial.c b/src/serial.c index dddad88..8ddd38e 100644 --- a/src/serial.c +++ b/src/serial.c @@ -202,7 +202,7 @@ } return 0; #else -#warning osmo_serial_set_custom_baudrate: unsupported platform +#pragma message ("osmo_serial_set_custom_baudrate: unsupported platform") return 0; #endif } -- To view, visit https://gerrit.osmocom.org/3023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I65b1ef6e4b9ba0bf0c3c2f03311250f31ddb308a Gerrit-PatchSet: 1 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 Fri Jun 23 15:42:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 15:42:44 +0000 Subject: [MERGED] libosmocore[master]: abis_nm.c: Fix implicit enumeration type conversion In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: abis_nm.c: Fix implicit enumeration type conversion ...................................................................... abis_nm.c: Fix implicit enumeration type conversion Fixes following warning message: abis_nm.c:101:2: warning: implicit conversion from enumeration type 'enum abis_nm_msgtype_bs11' to different enumeration type 'enum abis_nm_msgtype' [-Wenum-conversion] Change-Id: Icb0ed423febf1ceb6626e256d32011b4118fc527 --- M src/gsm/abis_nm.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index c59ebb7..2ad1945 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -98,10 +98,10 @@ NM_MT_CHG_HW_CONF_NACK, NM_MT_GET_ATTR_NACK, NM_MT_SET_ALARM_THRES_NACK, - NM_MT_BS11_BEGIN_DB_TX_NACK, - NM_MT_BS11_END_DB_TX_NACK, - NM_MT_BS11_CREATE_OBJ_NACK, - NM_MT_BS11_DELETE_OBJ_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_BEGIN_DB_TX_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_END_DB_TX_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_CREATE_OBJ_NACK, + (enum abis_nm_msgtype) NM_MT_BS11_DELETE_OBJ_NACK, }; static const struct value_string nack_names[] = { -- To view, visit https://gerrit.osmocom.org/3026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb0ed423febf1ceb6626e256d32011b4118fc527 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 Fri Jun 23 15:42:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 15:42:45 +0000 Subject: [MERGED] libosmocore[master]: control_cmd.c: Fix unsigned comparison against < 0 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: control_cmd.c: Fix unsigned comparison against < 0 ...................................................................... control_cmd.c: Fix unsigned comparison against < 0 Fixes following warning: control_cmd.c:294:16: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c --- M src/ctrl/control_cmd.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 836bb71..24b388b 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -291,7 +291,7 @@ } cmd->type = get_string_value(ctrl_type_vals, tmp); - if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { + if ((int)cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Request type unknown"; -- To view, visit https://gerrit.osmocom.org/3027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c Gerrit-PatchSet: 3 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 Fri Jun 23 15:42:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 15:42:45 +0000 Subject: [MERGED] libosmocore[master]: jenkins.sh: Disable sanitize for FreeBSD In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: jenkins.sh: Disable sanitize for FreeBSD ...................................................................... jenkins.sh: Disable sanitize for FreeBSD Our current build server uses clang-3.4.1 and FreeBSD10.3, and AddressSanitizer support is not good yet on those versions, triggering some link issues when it is enabled. I tested using newer clang 3.7.1 in the same FreeBSD version but another compiler error related to __builtin_cpu_supports is triggered. Conclusion: Explicitly disable AddressSanitizer until we move to FreeBSD11 with clang 3.8. Before this commit, AddressSanitizer was implicitly disabled due to a shell compatibility issue which is fixed in next commit in the series, thus we need to explicitly disable it here. Change-Id: I0db497045a2ebf7877232b28ae1fcf1fd89fb3f3 --- M contrib/jenkins.sh 1 file changed, 7 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 0c11682..bb6c3cb 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,8 +4,14 @@ ./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +if [ "x$label" = "xFreeBSD_amd64" ]; then + ENABLE_SANITIZE="" +else + ENABLE_SANITIZE="--enable-sanitize" +fi + autoreconf --install --force -./configure --enable-static --enable-sanitize +./configure --enable-static $ENABLE_SANITIZE $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ -- To view, visit https://gerrit.osmocom.org/3029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0db497045a2ebf7877232b28ae1fcf1fd89fb3f3 Gerrit-PatchSet: 1 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 Fri Jun 23 15:42:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 15:42:46 +0000 Subject: [MERGED] libosmocore[master]: configure.ac: Fix C(PP)FLAGS for BSD build In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: configure.ac: Fix C(PP)FLAGS for BSD build ...................................................................... configure.ac: Fix C(PP)FLAGS for BSD build If we pass CFLAGS params to configure, then the CFLAGS set inside configure.ac are not applied and the build fails if -Werror is enabled because then BUILDING_LIBOSMOCORE is not defined. Seeing the following output at configure time in FreeBSD build: ./configure: CFLAGS+= -fsanitize=address -fsanitize=undefined: not found ./configure: CPPFLAGS+= -fsanitize=address -fsanitize=undefined: not found ./configure: CFLAGS+= -DBUILDING_LIBOSMOCORE -Wall: not found ./configure: CPPFLAGS+= -DBUILDING_LIBOSMOCORE -Wall: not found Change-Id: I692bbc66e5343998eec360a02a3a1fe73478c5c6 --- 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 64de4bf..92544b6 100644 --- a/configure.ac +++ b/configure.ac @@ -231,12 +231,12 @@ [sanitize=$enableval], [sanitize="no"]) if test x"$sanitize" = x"yes" then - CFLAGS+=" -fsanitize=address -fsanitize=undefined" - CPPFLAGS+=" -fsanitize=address -fsanitize=undefined" + CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" + CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi -CFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" -CPPFLAGS+=" -DBUILDING_LIBOSMOCORE -Wall" +CFLAGS="$CFLAGS -DBUILDING_LIBOSMOCORE -Wall" +CPPFLAGS="$CPPFLAGS -DBUILDING_LIBOSMOCORE -Wall" AC_ARG_ENABLE(simd, [AS_HELP_STRING( -- To view, visit https://gerrit.osmocom.org/3024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I692bbc66e5343998eec360a02a3a1fe73478c5c6 Gerrit-PatchSet: 3 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 Fri Jun 23 15:42:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 15:42:46 +0000 Subject: [MERGED] libosmocore[master]: contrib: Enable -Werror by default In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib: Enable -Werror by default ...................................................................... contrib: Enable -Werror by default Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c --- M contrib/jenkins-arm.sh M contrib/jenkins.sh 2 files changed, 4 insertions(+), 4 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 d5fc31f..510b0e9 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -10,7 +10,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh @@ -27,7 +27,7 @@ --host=arm-none-eabi \ --enable-embedded \ --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs" + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" $MAKE $PARALLEL_MAKE \ || cat-testlogs.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index bb6c3cb..6a72840 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -11,7 +11,7 @@ fi autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE +./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ @@ -23,7 +23,7 @@ autoreconf --install --force mkdir builddir cd builddir -../configure --enable-static +../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE check \ || cat-testlogs.sh $MAKE distcheck \ -- To view, visit https://gerrit.osmocom.org/2954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1752cad1e34cb6e5f36edf3f538d803eff29d18c Gerrit-PatchSet: 13 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jun 23 16:17:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 23 Jun 2017 16:17:39 +0000 Subject: [PATCH] libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type Message-ID: Review at https://gerrit.osmocom.org/3030 fix compiler warning: xua_test: hexdump pointer type Was recently introduced by a70b4599f63b50c4d654eb9e1b1a099a7c8cdc36. Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 --- M tests/xua/xua_test.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/30/3030/1 diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index 4af0836..3e6d468 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -155,7 +155,7 @@ printf("Testing Decoded GT -> SUA encoding\n"); printf("IN: %s\n", osmo_sccp_gt_dump(gt_in)); - printf(" %s\n", osmo_hexdump_nospc(gt_in, sizeof(struct osmo_sccp_gt))); + printf(" %s\n", osmo_hexdump_nospc((void*)gt_in, sizeof(struct osmo_sccp_gt))); /* encode sccp_addr to SUA GT */ xua_part_add_gt(msg, gt_in); @@ -168,7 +168,7 @@ /* parse + compare */ sua_parse_gt(>_out, msgb_data(msg), msgb_length(msg)); printf("OUT:%s\n", osmo_sccp_gt_dump(>_out)); - printf(" %s\n", osmo_hexdump_nospc(>_out, sizeof(struct osmo_sccp_gt))); + printf(" %s\n", osmo_hexdump_nospc((void*)>_out, sizeof(struct osmo_sccp_gt))); OSMO_ASSERT(!memcmp(gt_in, >_out, sizeof(gt_out))); msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 23 16:47:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 16:47:30 +0000 Subject: [PATCH] osmo-bts[master]: measurement: Remove dead code Message-ID: Review at https://gerrit.osmocom.org/3031 measurement: Remove dead code We used to have trx_meas_check_compute() and call that from the bts-specific code in order to iterate over all timeslots and all lchans in the timeslots if we have to send measurement reports. This was executed once per frame, and created unequal CPU load over time, which in turn might increase different per-ts jitter. Since 2f028c4e2c29f63df9926435466aa35377947767 in April 2017 we have lchan_meas_check_compute(), which performs this on a per-lchan basis, and hence CPU load is distributed over all active timeslots. Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08 --- M include/osmo-bts/measurement.h M src/common/measurement.c 2 files changed, 0 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/31/3031/1 diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h index 87c8109..47b31a2 100644 --- a/include/osmo-bts/measurement.h +++ b/include/osmo-bts/measurement.h @@ -6,8 +6,6 @@ int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm); -int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn); - int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn); #endif diff --git a/src/common/measurement.c b/src/common/measurement.c index 6ddc05a..6050001 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -320,40 +320,3 @@ return 1; } - -static int ts_meas_check_compute(struct gsm_bts_trx_ts *ts, uint32_t fn) -{ - int i; - const int num_subslots = ts_subslots(ts); - - for (i = 0; i < num_subslots; ++i) { - struct gsm_lchan *lchan = &ts->lchan[i]; - - if (lchan->state != LCHAN_S_ACTIVE) - continue; - - switch (lchan->type) { - case GSM_LCHAN_SDCCH: - case GSM_LCHAN_TCH_F: - case GSM_LCHAN_TCH_H: - case GSM_LCHAN_PDTCH: - lchan_meas_check_compute(lchan, fn); - break; - default: - break; - } - } - return 0; -} - -/* needs to be called once every TDMA frame ! */ -int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - ts_meas_check_compute(ts, fn); - } - return 0; -} -- To view, visit https://gerrit.osmocom.org/3031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jun 23 16:47:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 16:47:30 +0000 Subject: [PATCH] osmo-bts[master]: Add loopback support for PDTCH Message-ID: Review at https://gerrit.osmocom.org/3032 Add loopback support for PDTCH This add support for BTS-side lookback of PDTCH channels. If lchan-loopback is enabled, We take the uplink frames as received in PH-DATA.ind and put them into the dl_tch_queue for that lchan. When we receive PH-RTS.ind, we dequeue frames from that queue and transmit them in downlink. If no frame is found in queue, we transmit an empty (all-zero) frame of 23 bytes (CS-1). Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 --- M src/common/l1sap.c 1 file changed, 88 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/3032/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b9104b7..15e2509 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -50,6 +50,16 @@ #include #include +static char *dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", + tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) { @@ -580,6 +590,39 @@ return rc; } +/*! handling for PDTCH loopback mode, used for BER testing + * \param[in] lchan logical channel on which we operate + * \param[in] rts_ind PH-RTS.ind from PHY which we process + * \param[out] msg Message buffer to which we write data + * + * The function will fill \a msg, from which the caller can then + * subsequently build a PH-DATA.req */ +static int lchan_pdtch_ph_rts_ind_loop(struct gsm_lchan *lchan, + const struct ph_data_param *rts_ind, + struct msgb *msg, const struct gsm_time *tm) +{ + struct msgb *loop_msg; + uint8_t *p; + + /* de-queue response message (loopback) */ + loop_msg = msgb_dequeue(&lchan->dl_tch_queue); + if (!loop_msg) { + LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n", + gsm_lchan_name(lchan), dump_gsmtime(tm)); + /* empty downlink message */ + p = msgb_put(msg, GSM_MACBLOCK_LEN); + memset(p, 0, GSM_MACBLOCK_LEN); + } else { + LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n", + gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg)); + /* copy over data from queued response message */ + p = msgb_put(msg, msgb_l2len(loop_msg)); + memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg)); + msgb_free(loop_msg); + } + return 0; +} + /* PH-RTS-IND prim received from bts model */ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap, struct ph_data_param *rts_ind) @@ -603,21 +646,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-RTS.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); - - if (ts_is_pdch(&trx->ts[tn])) { - if (L1SAP_IS_PTCCH(rts_ind->fn)) { - pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */, - L1SAP_FN2PTCCHBLOCK(fn)); - - return 0; - } - pcu_tx_rts_req(&trx->ts[tn], 0, fn, 0 /* ARFCN */, - L1SAP_FN2MACBLOCK(fn)); - - return 0; - } + DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", + dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ if (!msg) { @@ -630,7 +660,25 @@ msg); msg->l2h = msg->l1h + sizeof(*l1sap); - if (L1SAP_IS_CHAN_BCCH(chan_nr)) { + if (ts_is_pdch(&trx->ts[tn])) { + lchan = get_active_lchan_by_chan_nr(trx, chan_nr); + if (lchan && lchan->loopback) { + if (!L1SAP_IS_PTCCH(rts_ind->fn)) + lchan_pdtch_ph_rts_ind_loop(lchan, rts_ind, msg, &g_time); + /* continue below like for SACCH/FACCH/... */ + } else { + /* forward RTS.ind to PCU */ + if (L1SAP_IS_PTCCH(rts_ind->fn)) { + pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */, + L1SAP_FN2PTCCHBLOCK(fn)); + } else { + pcu_tx_rts_req(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + L1SAP_FN2MACBLOCK(fn)); + } + /* return early, PCU takes care of rest */ + return 0; + } + } else if (L1SAP_IS_CHAN_BCCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); /* get them from bts->si_buf[] */ si = bts_sysinfo_get(trx->bts, &g_time); @@ -901,25 +949,38 @@ g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); if (ts_is_pdch(&trx->ts[tn])) { + lchan = get_lchan_by_chan_nr(trx, chan_nr); + if (!lchan) + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); + if (lchan && lchan->loopback) { + /* we are in loopback mode (for BER testing) + * mode and need to enqeue the frame to be + * returned in downlink */ + msgb_enqueue(&lchan->dl_tch_queue, msg); + + /* Return 1 to signal that we're still using msg + * and it should not be freed */ + return 1; + } + + /* don't send bad frames to PCU */ if (len == 0) return -EINVAL; if (L1SAP_IS_PTCCH(fn)) { pcu_tx_data_ind(&trx->ts[tn], 1, fn, - 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), + 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); - - return 0; + } else { + /* drop incomplete UL block */ + if (pr_info != PRES_INFO_BOTH) + return 0; + /* PDTCH / PACCH frame handling */ + pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, + data_ind->ta_offs_qbits, data_ind->lqual_cb); } - /* drop incomplete UL block */ - if (pr_info != PRES_INFO_BOTH) - return 0; - /* PDTCH / PACCH frame handling */ - pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, - L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); - return 0; } -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jun 23 19:13:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 19:13:17 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) Thanks for pushing, it seems as of current master this prevents libosmo-sccp to build https://gerrit.osmocom.org/#/c/3030/1/tests/xua/xua_test.c File tests/xua/xua_test.c: Line 158: printf(" %s\n", osmo_hexdump_nospc((void*)gt_in, sizeof(struct osmo_sccp_gt))); It should be casted to const unsigned char *: char *osmo_hexdump_nospc(const unsigned char *buf, int len) Line 171: printf(" %s\n", osmo_hexdump_nospc((void*)>_out, sizeof(struct osmo_sccp_gt))); Same with this one -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 23 19:18:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 19:18:13 +0000 Subject: [PATCH] osmo-bts[master]: Add loopback support for PDTCH In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3032 to look at the new patch set (#2). Add loopback support for PDTCH This add support for BTS-side lookback of PDTCH channels. If lchan-loopback is enabled, We take the uplink frames as received in PH-DATA.ind and put them into the dl_tch_queue for that lchan. When we receive PH-RTS.ind, we dequeue frames from that queue and transmit them in downlink. If no frame is found in queue, we transmit an empty (all-zero) frame of 23 bytes (CS-1). Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 --- M src/common/l1sap.c 1 file changed, 89 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/3032/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index d7e3fb3..97018f8 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -50,6 +50,16 @@ #include #include +static char *dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", + tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) { @@ -594,6 +604,39 @@ return rc; } +/*! handling for PDTCH loopback mode, used for BER testing + * \param[in] lchan logical channel on which we operate + * \param[in] rts_ind PH-RTS.ind from PHY which we process + * \param[out] msg Message buffer to which we write data + * + * The function will fill \a msg, from which the caller can then + * subsequently build a PH-DATA.req */ +static int lchan_pdtch_ph_rts_ind_loop(struct gsm_lchan *lchan, + const struct ph_data_param *rts_ind, + struct msgb *msg, const struct gsm_time *tm) +{ + struct msgb *loop_msg; + uint8_t *p; + + /* de-queue response message (loopback) */ + loop_msg = msgb_dequeue(&lchan->dl_tch_queue); + if (!loop_msg) { + LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n", + gsm_lchan_name(lchan), dump_gsmtime(tm)); + /* empty downlink message */ + p = msgb_put(msg, GSM_MACBLOCK_LEN); + memset(p, 0, GSM_MACBLOCK_LEN); + } else { + LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n", + gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg)); + /* copy over data from queued response message */ + p = msgb_put(msg, msgb_l2len(loop_msg)); + memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg)); + msgb_free(loop_msg); + } + return 0; +} + /* PH-RTS-IND prim received from bts model */ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap, struct ph_data_param *rts_ind) @@ -617,21 +660,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-RTS.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); - - if (ts_is_pdch(&trx->ts[tn])) { - if (L1SAP_IS_PTCCH(rts_ind->fn)) { - pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */, - L1SAP_FN2PTCCHBLOCK(fn)); - - return 0; - } - pcu_tx_rts_req(&trx->ts[tn], 0, fn, 0 /* ARFCN */, - L1SAP_FN2MACBLOCK(fn)); - - return 0; - } + DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", + dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ if (!msg) { @@ -644,7 +674,25 @@ msg); msg->l2h = msg->l1h + sizeof(*l1sap); - if (L1SAP_IS_CHAN_BCCH(chan_nr)) { + if (ts_is_pdch(&trx->ts[tn])) { + lchan = get_active_lchan_by_chan_nr(trx, chan_nr); + if (lchan && lchan->loopback) { + if (!L1SAP_IS_PTCCH(rts_ind->fn)) + lchan_pdtch_ph_rts_ind_loop(lchan, rts_ind, msg, &g_time); + /* continue below like for SACCH/FACCH/... */ + } else { + /* forward RTS.ind to PCU */ + if (L1SAP_IS_PTCCH(rts_ind->fn)) { + pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */, + L1SAP_FN2PTCCHBLOCK(fn)); + } else { + pcu_tx_rts_req(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + L1SAP_FN2MACBLOCK(fn)); + } + /* return early, PCU takes care of rest */ + return 0; + } + } else if (L1SAP_IS_CHAN_BCCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); /* get them from bts->si_buf[] */ si = bts_sysinfo_get(trx->bts, &g_time); @@ -915,25 +963,39 @@ g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); if (ts_is_pdch(&trx->ts[tn])) { + lchan = get_lchan_by_chan_nr(trx, chan_nr); + if (!lchan) + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); + if (lchan && lchan->loopback) { + /* we are in loopback mode (for BER testing) + * mode and need to enqeue the frame to be + * returned in downlink */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + msgb_enqueue(&lchan->dl_tch_queue, msg); + + /* Return 1 to signal that we're still using msg + * and it should not be freed */ + return 1; + } + + /* don't send bad frames to PCU */ if (len == 0) return -EINVAL; if (L1SAP_IS_PTCCH(fn)) { pcu_tx_data_ind(&trx->ts[tn], 1, fn, - 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), + 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); - - return 0; + } else { + /* drop incomplete UL block */ + if (pr_info != PRES_INFO_BOTH) + return 0; + /* PDTCH / PACCH frame handling */ + pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, + data_ind->ta_offs_qbits, data_ind->lqual_cb); } - /* drop incomplete UL block */ - if (pr_info != PRES_INFO_BOTH) - return 0; - /* PDTCH / PACCH frame handling */ - pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, - L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); - return 0; } -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 23 19:18:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 23 Jun 2017 19:18:15 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: Factor out function to limit message queue Message-ID: Review at https://gerrit.osmocom.org/3033 l1sap.c: Factor out function to limit message queue Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687 --- M src/common/l1sap.c 1 file changed, 18 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/3033/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b9104b7..d7e3fb3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -94,6 +94,20 @@ return GSM_RTP_DURATION; } +/*! limit number of queue entries to %u; drops any surplus messages */ +static void queue_limit_to(const char *prefix, struct llist_head *queue, unsigned int limit) +{ + int count = llist_count(queue); + + if (count > limit) + LOGP(DL1P, LOGL_NOTICE, "%s: freeing %d queued frames\n", prefix, count-limit); + while (count > limit) { + struct msgb *tmp = msgb_dequeue(queue); + msgb_free(tmp); + count--; + } +} + /* allocate a msgb containing a osmo_phsap_prim + optional l2 data * in order to wrap femtobts header arround l2 data, there must be enough space * in front and behind data pointer */ @@ -1003,20 +1017,10 @@ /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { - struct msgb *tmp; - int count = 0; - /* make sure the queue doesn't get too long */ - llist_for_each_entry(tmp, &lchan->dl_tch_queue, list) - count++; - while (count >= 1) { - tmp = msgb_dequeue(&lchan->dl_tch_queue); - msgb_free(tmp); - count--; - } - + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ return 1; } @@ -1161,9 +1165,8 @@ uint32_t timestamp, bool marker) { struct gsm_lchan *lchan = rs->priv; - struct msgb *msg, *tmp; + struct msgb *msg; struct osmo_phsap_prim *l1sap; - int count = 0; msg = l1sap_msgb_alloc(rtp_pl_len); if (!msg) @@ -1179,13 +1182,7 @@ rtpmsg_ts(msg) = timestamp; /* make sure the queue doesn't get too long */ - llist_for_each_entry(tmp, &lchan->dl_tch_queue, list) - count++; - while (count >= 2) { - tmp = msgb_dequeue(&lchan->dl_tch_queue); - msgb_free(tmp); - count--; - } + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); msgb_enqueue(&lchan->dl_tch_queue, msg); } -- To view, visit https://gerrit.osmocom.org/3033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jun 23 19:18:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 23 Jun 2017 19:18:33 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 1: My last statemnt is not true. It actually fails only for me because I build with -Werror locally. -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 24 09:26:06 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 24 Jun 2017 09:26:06 +0000 Subject: [PATCH] libosmocore[master]: gitignore all tests using mask In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2976 to look at the new patch set (#2). gitignore all tests using mask Use the 'tests/*/*_test' mask to ignore all test binaries instead of specifying each of them. Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 --- M .gitignore 1 file changed, 1 insertion(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/2976/2 diff --git a/.gitignore b/.gitignore index f26b699..657120d 100644 --- a/.gitignore +++ b/.gitignore @@ -62,48 +62,7 @@ tests/testsuite tests/testsuite.dir/ tests/testsuite.log -tests/abis/abis_test -tests/ctrl/ctrl_test -tests/utils/utils_test -tests/stats/stats_test -tests/kasumi/kasumi_test -tests/gea/gea_test -tests/sms/sms_test -tests/timer/timer_test -tests/msgfile/msgfile_test -tests/ussd/ussd_test -tests/smscb/smscb_test -tests/bits/bitrev_test -tests/a5/a5_test -tests/comp128/comp128_test -tests/auth/milenage_test -tests/coding/coding_test -tests/conv/conv_test -tests/lapd/lapd_test -tests/gsm0808/gsm0808_test -tests/gb/bssgp_fc_test -tests/gb/gprs_ns_test -tests/gsm0408/gsm0408_test -tests/logging/logging_test -tests/fr/fr_test -tests/loggingrb/loggingrb_test -tests/ringbuf/ringbuf_test -tests/strrb/strrb_test -tests/vty/vty_test -tests/codec/codec_test -tests/gb/gprs_bssgp_test -tests/smscb/gsm0341_test -tests/bitvec/bitvec_test -tests/bits/bitcomp_test -tests/gprs/gprs_test -tests/msgb/msgb_test -tests/sim/sim_test -tests/gsup/gsup_test -tests/tlv/tlv_test -tests/fsm/fsm_test -tests/write_queue/wqueue_test -tests/oap/oap_test -tests/socket/socket_test +tests/*/*_test utils/osmo-arfcn utils/osmo-auc-gen -- To view, visit https://gerrit.osmocom.org/2976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Jun 24 10:57:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 10:57:11 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C Message-ID: Review at https://gerrit.osmocom.org/3034 osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C L1C is control, while L1P is data primitive. Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/34/3034/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index a83816e..f564836 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -957,7 +957,7 @@ return 0; } - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", + DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, -- To view, visit https://gerrit.osmocom.org/3034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 10:57:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 10:57:15 +0000 Subject: [PATCH] osmo-bts[master]: l1sap: if lchan is in loopback, don't accept incoming RTP Message-ID: Review at https://gerrit.osmocom.org/3035 l1sap: if lchan is in loopback, don't accept incoming RTP When the lchan is in loopback mode, we loop back all uplink blocks into downlink blocks. We do not processs any RTP frames for that lchan anymore. Rather, we discard those RTP frames to avoid mixing looped-back samples with those received from remote. Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b --- M src/common/l1sap.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/3035/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index d7e3fb3..0ab84e5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1168,6 +1168,11 @@ struct msgb *msg; struct osmo_phsap_prim *l1sap; + /* if we're in loopback mode, we don't accept frames from the + * RTP socket anymore */ + if (lchan->loopback) + return; + msg = l1sap_msgb_alloc(rtp_pl_len); if (!msg) return; -- To view, visit https://gerrit.osmocom.org/3035 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 10:57:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 10:57:15 +0000 Subject: [PATCH] osmo-bts[master]: LC15: properly handle BS-AG-BLKS-RES as received from BSC Message-ID: Review at https://gerrit.osmocom.org/3036 LC15: properly handle BS-AG-BLKS-RES as received from BSC Closes: OS#2014 Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/3036/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 5977aa9..71bb833 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -389,7 +389,7 @@ /* The sapi depends on DSP configuration, not * on the actual SYSTEM INFORMATION 3. */ u8BlockNbr = L1SAP_FN2CCCHBLOCK(u32Fn); - if (u8BlockNbr >= 1) + if (u8BlockNbr >= num_agch(trx, "PH-DATA-REQ")) sapi = GsmL1_Sapi_Pch; else sapi = GsmL1_Sapi_Agch; -- To view, visit https://gerrit.osmocom.org/3036 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Sat Jun 24 10:57:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 10:57:15 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer Message-ID: Review at https://gerrit.osmocom.org/3037 TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer using gettimeofday() is not suitable for the GSM frame timer, as it relies on the normal 'wall clock' system time, which may be adjusted by ntp, gps or other means at runtime. Switching to a different clock source means we cannot use osmo_timer_list anymore, but timerfd integrates just fine with our libosmocore select() loop handling. Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Closes: #2325 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 243 insertions(+), 83 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/3037/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index cbcde8c..9c87643 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -2,7 +2,7 @@ /* (C) 2013 by Andreas Eversberg * (C) 2015 by Alexander Chemeris - * (C) 2015 by Harald Welte + * (C) 2015-2017 by Harald Welte * * All Rights Reserved * @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -46,12 +48,6 @@ #include "loops.h" extern void *tall_bts_ctx; - -/* clock states */ -static uint32_t transceiver_lost; -uint32_t transceiver_last_fn; -static struct timeval transceiver_clock_tv; -static struct osmo_timer_list transceiver_clock_timer; /* Enable this to multiply TOA of RACH by 10. * This is useful to check tenth of timing advances with RSSI test tool. @@ -1409,82 +1405,232 @@ return 0; } - /* - * frame clock + * TRX frame clock handling + * + * In a "normal" synchronous PHY layer, we would be polled every time + * the PHY needs data for a given frame number. However, the + * OpenBTS-inherited TRX protocol works differently: We (L1) must + * autonomously send burst data based on our own clock, and every so + * often (currently every ~ 216 frames), we get a clock indication from + * the TRX. + * + * We're using a MONOTONIC timerfd interval timer for the 4.615ms frame + * intervals, and then compute + send the 8 bursts for that frame. + * + * Upon receiving a clock indication from the TRX, we compensate + * accordingly: If we were transmitting too fast, we're delaying the + * next interval timer accordingly. If we were too slow, we immediately + * send burst data for the missing frame numbers. */ -#define FRAME_DURATION_uS 4615 +/*! clock state of a given TRX */ +struct osmo_trx_clock_state { + /*! number of FN periods without TRX clock indication */ + uint32_t fn_without_clock_ind; + struct { + /*! last FN we processed based on FN period timer */ + uint32_t fn; + /*! time at which we last processed FN */ + struct timespec tv; + } last_fn_timer; + struct { + /*! last FN we received a clock indication for */ + uint32_t fn; + /*! time at which we received the last clock indication */ + struct timespec tv; + } last_clk_ind; + /*! Osmocom FD wrapper for timerfd */ + struct osmo_fd fn_timer_ofd; +}; + +/* TODO: This must go and become part of the phy_link */ +static struct osmo_trx_clock_state g_clk_s = { .fn_timer_ofd.fd = -1 }; + +/*! duration of a GSM frame in nano-seconds. (120ms/26) */ +#define FRAME_DURATION_nS 4615384 +/*! duration of a GSM frame in micro-seconds (120s/26) */ +#define FRAME_DURATION_uS (FRAME_DURATION_nS/1000) +/*! maximum number of 'missed' frame periods we can tolerate of OS doesn't schedule us*/ #define MAX_FN_SKEW 50 +/*! maximum number of frame periods we can tolerate without TRX Clock Indication*/ #define TRX_LOSS_FRAMES 400 -extern int quit; -/* this timer fires for every FN to be processed */ -static void trx_ctrl_timer_cb(void *data) +/*! compute the number of micro-seconds difference elapsed between \a last and \a now */ +static inline int compute_elapsed_us(const struct timespec *last, const struct timespec *now) { - struct gsm_bts *bts = data; - struct timeval tv_now, *tv_clock = &transceiver_clock_tv; - int32_t elapsed; + int elapsed; + + elapsed = (now->tv_sec - last->tv_sec) * 1000000 + + (now->tv_nsec - last->tv_nsec) / 1000; + return elapsed; +} + +/*! compute the number of frame number intervals elapsed between \a last and \a now */ +static inline int compute_elapsed_fn(const uint32_t last, const uint32_t now) +{ + int elapsed_fn = (now + GSM_HYPERFRAME - last) % GSM_HYPERFRAME; + if (elapsed_fn >= 135774) + elapsed_fn -= GSM_HYPERFRAME; + return elapsed_fn; +} + +/*! normalise given 'struct timespec', i.e. carry nanoseconds into seconds */ +static inline void normalize_timespec(struct timespec *ts) +{ + ts->tv_sec += ts->tv_nsec / 1000000000; + ts->tv_nsec = ts->tv_nsec % 1000000000; +} + +/*! disable the osmocom-wrapped timerfd */ +static int timer_ofd_disable(struct osmo_fd *ofd) +{ + const struct itimerspec its_null = { + .it_value = { 0, 0 }, + .it_interval = { 0, 0 }, + }; + return timerfd_settime(ofd->fd, 0, &its_null, NULL); +} + +/*! schedule the osmcoom-wrapped timerfd to occur first at \a first, then periodically at \a interval + * \param[in] ofd Osmocom wrapped timerfd + * \param[in] first Relative time at which the timer should first execute (NULL = \a interval) + * \param[in] interval Time interval at which subsequent timer shall fire + * \returns 0 on success; negative on error */ +static int timer_ofd_schedule(struct osmo_fd *ofd, const struct timespec *first, + const struct timespec *interval) +{ + struct itimerspec its; + + if (ofd->fd < 0) + return -EINVAL; + + /* first expiration */ + if (first) + its.it_value = *first; + else + its.it_value = *interval; + /* repeating interval */ + its.it_interval = *interval; + + return timerfd_settime(ofd->fd, 0, &its, NULL); +} + +/*! setup osmocom-wrapped timerfd + * \param[inout] ofd Osmocom-wrapped timerfd on which to operate + * \param[in] cb Call-back function called when timerfd becomes readable + * \param[in] data Opaque data to be passed on to call-back + * \returns 0 on success; negative on error + * + * We simply initialize the data structures here, but do not yet + * schedule the timer. + */ +static int timer_ofd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, unsigned int), void *data) +{ + ofd->cb = cb; + ofd->data = data; + ofd->when = BSC_FD_READ; + + if (ofd->fd < 0) { + ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); + if (ofd->fd < 0) + return ofd->fd; + + osmo_fd_register(ofd); + } + return 0; +} + +/*! Increment a GSM frame number modulo GSM_HYPERFRAME */ +#define INCREMENT_FN(fn) (fn) = (((fn) + 1) % GSM_HYPERFRAME) + +extern int quit; + +/*! this is the timerfd-callback firing for every FN to be processed */ +static int trx_fn_timer_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct gsm_bts *bts = ofd->data; + struct osmo_trx_clock_state *tcs = &g_clk_s; + struct timespec tv_now; + uint64_t expire_count; + int elapsed_us; + int error_us; + int rc, i; + + if (!(what & BSC_FD_READ)) + return 0; + + /* read from timerfd: number of expirations of periodic timer */ + rc = read(ofd->fd, (void *) &expire_count, sizeof(expire_count)); + if (rc < 0 && errno == EAGAIN) + return 0; + OSMO_ASSERT(rc == sizeof(expire_count)); + + if (expire_count > 1) { + LOGP(DL1C, LOGL_NOTICE, "FN timer expire_count=%"PRIu64": We missed %"PRIu64" timers\n", + expire_count, expire_count-1); + } /* check if transceiver is still alive */ - if (transceiver_lost++ == TRX_LOSS_FRAMES) { + if (tcs->fn_without_clock_ind++ == TRX_LOSS_FRAMES) { LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); no_clock: + timer_ofd_disable(&tcs->fn_timer_ofd); transceiver_available = 0; bts_shutdown(bts, "No clock from osmo-trx"); - return; + return -1; } - gettimeofday(&tv_now, NULL); - - elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 - + (tv_now.tv_usec - tv_clock->tv_usec); + /* compute actual elapsed time and resulting OS scheduling error */ + clock_gettime(CLOCK_MONOTONIC, &tv_now); + elapsed_us = compute_elapsed_us(&tcs->last_fn_timer.tv, &tv_now); + error_us = elapsed_us - FRAME_DURATION_uS; +#ifdef DEBUG_CLOCK + printf("%s(): %09ld, elapsed_us=%05d, error_us=%-d: fn=%d\n", __func__, + tv_now.tv_nsec, elapsed_us, error_us, tcs->last_fn_timer.fn+1); +#endif + tcs->last_fn_timer.tv = tv_now; /* if someone played with clock, or if the process stalled */ - if (elapsed > FRAME_DURATION_uS * MAX_FN_SKEW || elapsed < 0) { - LOGP(DL1C, LOGL_NOTICE, "PC clock skew: elapsed uS %d\n", - elapsed); + if (elapsed_us > FRAME_DURATION_uS * MAX_FN_SKEW || elapsed_us < 0) { + LOGP(DL1C, LOGL_ERROR, "PC clock skew: elapsed_us=%d, error_us=%d\n", + elapsed_us, error_us); goto no_clock; } - /* schedule next FN clock */ - while (elapsed > FRAME_DURATION_uS / 2) { - tv_clock->tv_usec += FRAME_DURATION_uS; - if (tv_clock->tv_usec >= 1000000) { - tv_clock->tv_sec++; - tv_clock->tv_usec -= 1000000; - } - transceiver_last_fn = (transceiver_last_fn + 1) % GSM_HYPERFRAME; - trx_sched_fn(bts, transceiver_last_fn); - elapsed -= FRAME_DURATION_uS; + /* call trx_sched_fn() for all expired FN */ + for (i = 0; i < expire_count; i++) { + INCREMENT_FN(tcs->last_fn_timer.fn); + trx_sched_fn(bts, tcs->last_fn_timer.fn); } - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS - elapsed); + + return 0; } - -/* receive clock from transceiver */ +/*! called every time we receive a clock indication from TRX */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn) { - struct timeval tv_now, *tv_clock = &transceiver_clock_tv; - int32_t elapsed; - int32_t elapsed_fn; + struct osmo_trx_clock_state *tcs = &g_clk_s; + struct timespec tv_now; + int elapsed_us, elapsed_fn; + int elapsed_us_since_clk, elapsed_fn_since_clk, error_us_since_clk; + unsigned int fn_caught_up = 0; + const struct timespec interval = { .tv_sec = 0, .tv_nsec = FRAME_DURATION_nS }; if (quit) return 0; /* reset lost counter */ - transceiver_lost = 0; + tcs->fn_without_clock_ind = 0; - gettimeofday(&tv_now, NULL); + clock_gettime(CLOCK_MONOTONIC, &tv_now); /* clock becomes valid */ if (!transceiver_available) { - LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", - fn); + LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", fn); transceiver_available = 1; @@ -1495,69 +1641,83 @@ check_transceiver_availability(bts, 1); new_clock: - transceiver_last_fn = fn; - trx_sched_fn(bts, transceiver_last_fn); + tcs->last_fn_timer.fn = fn; + /* call trx cheduler function for new 'last' FN */ + trx_sched_fn(bts, tcs->last_fn_timer.fn); - /* schedule first FN clock */ - memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - memset(&transceiver_clock_timer, 0, - sizeof(transceiver_clock_timer)); - transceiver_clock_timer.cb = trx_ctrl_timer_cb; - transceiver_clock_timer.data = bts; - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS); + /* schedule first FN clock timer */ + timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); + timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, &interval); + + tcs->last_fn_timer.tv = tv_now; + tcs->last_clk_ind.tv = tv_now; + tcs->last_clk_ind.fn = fn; return 0; } - osmo_timer_del(&transceiver_clock_timer); + /* calculate elapsed time +fn since last timer */ + elapsed_us = compute_elapsed_us(&tcs->last_fn_timer.tv, &tv_now); + elapsed_fn = compute_elapsed_fn(tcs->last_fn_timer.fn, fn); +#ifdef DEBUG_CLOCK + printf("%s(): LAST_TIMER %9ld, elapsed_us=%7d, elapsed_fn=%+3d\n", __func__, + tv_now.tv_nsec, elapsed_us, elapsed_fn); +#endif + /* negative elapsed_fn values mean that we've already processed + * more FN based on the local interval timer than what the TRX + * now reports in the clock indication. Positive elapsed_fn + * values mean we still have a backlog to process */ - /* calculate elapsed time since last_fn */ - elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 - + (tv_now.tv_usec - tv_clock->tv_usec); + /* calculate elapsed time +fn since last clk ind */ + elapsed_us_since_clk = compute_elapsed_us(&tcs->last_clk_ind.tv, &tv_now); + elapsed_fn_since_clk = compute_elapsed_fn(tcs->last_clk_ind.fn, fn); + /* error (delta) between local clock since last CLK and CLK based on FN clock at TRX */ + error_us_since_clk = elapsed_us_since_clk - (FRAME_DURATION_uS * elapsed_fn_since_clk); + LOGP(DL1C, LOGL_INFO, "TRX Clock Ind: elapsed_us=%7d, elapsed_fn=%3d, error_us=%+5d\n", + elapsed_us_since_clk, elapsed_fn_since_clk, error_us_since_clk); - /* how much frames have been elapsed since last fn processed */ - elapsed_fn = (fn + GSM_HYPERFRAME - transceiver_last_fn) % GSM_HYPERFRAME; - if (elapsed_fn >= 135774) - elapsed_fn -= GSM_HYPERFRAME; + /* TODO: put this computed error_us_since_clk into some filter + * function and use that to adjust our regular timer interval to + * compensate for clock drift between the PC clock and the + * TRX/SDR clock */ + + tcs->last_clk_ind.tv = tv_now; + tcs->last_clk_ind.fn = fn; /* check for max clock skew */ if (elapsed_fn > MAX_FN_SKEW || elapsed_fn < -MAX_FN_SKEW) { LOGP(DL1C, LOGL_NOTICE, "GSM clock skew: old fn=%u, " - "new fn=%u\n", transceiver_last_fn, fn); + "new fn=%u\n", tcs->last_fn_timer.fn, fn); goto new_clock; } - LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d\n", - elapsed_fn * FRAME_DURATION_uS - elapsed); + LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d us (elapsed_fn=%d)\n", + elapsed_fn * FRAME_DURATION_uS - elapsed_us, elapsed_fn); /* too many frames have been processed already */ if (elapsed_fn < 0) { + struct timespec first = interval; /* set clock to the time or last FN should have been * transmitted. */ - tv_clock->tv_sec = tv_now.tv_sec; - tv_clock->tv_usec = tv_now.tv_usec + - (0 - elapsed_fn) * FRAME_DURATION_uS; - if (tv_clock->tv_usec >= 1000000) { - tv_clock->tv_sec++; - tv_clock->tv_usec -= 1000000; - } + first.tv_nsec += (0 - elapsed_fn) * FRAME_DURATION_nS; + normalize_timespec(&first); + LOGP(DL1C, LOGL_NOTICE, "We were %d FN faster than TRX, compensating\n", -elapsed_fn); /* set time to the time our next FN has to be transmitted */ - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS * (1 - elapsed_fn)); - + timer_ofd_schedule(&tcs->fn_timer_ofd, &first, &interval); return 0; } /* transmit what we still need to transmit */ - while (fn != transceiver_last_fn) { - transceiver_last_fn = (transceiver_last_fn + 1) % GSM_HYPERFRAME; - trx_sched_fn(bts, transceiver_last_fn); + while (fn != tcs->last_fn_timer.fn) { + INCREMENT_FN(tcs->last_fn_timer.fn); + trx_sched_fn(bts, tcs->last_fn_timer.fn); + fn_caught_up++; } - /* schedule next FN to be transmitted */ - memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - osmo_timer_schedule(&transceiver_clock_timer, 0, FRAME_DURATION_uS); + if (fn_caught_up) { + LOGP(DL1C, LOGL_NOTICE, "We were %d FN slower than TRX, compensated\n", elapsed_fn); + tcs->last_fn_timer.tv = tv_now; + } return 0; } -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 11:16:42 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 11:16:42 +0000 Subject: osmo-bts[master]: measurement: Remove dead code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08 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 Jun 24 11:16:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 11:16:46 +0000 Subject: osmo-bts[master]: l1sap.c: Factor out function to limit message queue In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687 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 Jun 24 11:16:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 11:16:58 +0000 Subject: osmo-bts[master]: osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29 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 Jun 24 11:17:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 11:17:02 +0000 Subject: osmo-bts[master]: l1sap: if lchan is in loopback, don't accept incoming RTP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3035 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b 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 Jun 24 11:17:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 11:17:05 +0000 Subject: osmo-bts[master]: LC15: properly handle BS-AG-BLKS-RES as received from BSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3036 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 24 11:17:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 11:17:43 +0000 Subject: osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 let's wait for feedback from osmo-gsm-tester folks -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e 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 Jun 24 14:46:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:46:36 +0000 Subject: libosmocore[master]: gitignore all tests using mask In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 24 14:46:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:46:38 +0000 Subject: [MERGED] libosmocore[master]: gitignore all tests using mask In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gitignore all tests using mask ...................................................................... gitignore all tests using mask Use the 'tests/*/*_test' mask to ignore all test binaries instead of specifying each of them. Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 --- M .gitignore 1 file changed, 1 insertion(+), 42 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index f26b699..657120d 100644 --- a/.gitignore +++ b/.gitignore @@ -62,48 +62,7 @@ tests/testsuite tests/testsuite.dir/ tests/testsuite.log -tests/abis/abis_test -tests/ctrl/ctrl_test -tests/utils/utils_test -tests/stats/stats_test -tests/kasumi/kasumi_test -tests/gea/gea_test -tests/sms/sms_test -tests/timer/timer_test -tests/msgfile/msgfile_test -tests/ussd/ussd_test -tests/smscb/smscb_test -tests/bits/bitrev_test -tests/a5/a5_test -tests/comp128/comp128_test -tests/auth/milenage_test -tests/coding/coding_test -tests/conv/conv_test -tests/lapd/lapd_test -tests/gsm0808/gsm0808_test -tests/gb/bssgp_fc_test -tests/gb/gprs_ns_test -tests/gsm0408/gsm0408_test -tests/logging/logging_test -tests/fr/fr_test -tests/loggingrb/loggingrb_test -tests/ringbuf/ringbuf_test -tests/strrb/strrb_test -tests/vty/vty_test -tests/codec/codec_test -tests/gb/gprs_bssgp_test -tests/smscb/gsm0341_test -tests/bitvec/bitvec_test -tests/bits/bitcomp_test -tests/gprs/gprs_test -tests/msgb/msgb_test -tests/sim/sim_test -tests/gsup/gsup_test -tests/tlv/tlv_test -tests/fsm/fsm_test -tests/write_queue/wqueue_test -tests/oap/oap_test -tests/socket/socket_test +tests/*/*_test utils/osmo-arfcn utils/osmo-auc-gen -- To view, visit https://gerrit.osmocom.org/2976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If85e665d1c2a0b55d23937db5725768cdbf14f58 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Jun 24 14:46:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:46:52 +0000 Subject: [MERGED] osmo-bts[master]: measurement: Remove dead code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: measurement: Remove dead code ...................................................................... measurement: Remove dead code We used to have trx_meas_check_compute() and call that from the bts-specific code in order to iterate over all timeslots and all lchans in the timeslots if we have to send measurement reports. This was executed once per frame, and created unequal CPU load over time, which in turn might increase different per-ts jitter. Since 2f028c4e2c29f63df9926435466aa35377947767 in April 2017 we have lchan_meas_check_compute(), which performs this on a per-lchan basis, and hence CPU load is distributed over all active timeslots. Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08 --- M include/osmo-bts/measurement.h M src/common/measurement.c 2 files changed, 0 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h index 87c8109..47b31a2 100644 --- a/include/osmo-bts/measurement.h +++ b/include/osmo-bts/measurement.h @@ -6,8 +6,6 @@ int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm); -int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn); - int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn); #endif diff --git a/src/common/measurement.c b/src/common/measurement.c index 6ddc05a..6050001 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -320,40 +320,3 @@ return 1; } - -static int ts_meas_check_compute(struct gsm_bts_trx_ts *ts, uint32_t fn) -{ - int i; - const int num_subslots = ts_subslots(ts); - - for (i = 0; i < num_subslots; ++i) { - struct gsm_lchan *lchan = &ts->lchan[i]; - - if (lchan->state != LCHAN_S_ACTIVE) - continue; - - switch (lchan->type) { - case GSM_LCHAN_SDCCH: - case GSM_LCHAN_TCH_F: - case GSM_LCHAN_TCH_H: - case GSM_LCHAN_PDTCH: - lchan_meas_check_compute(lchan, fn); - break; - default: - break; - } - } - return 0; -} - -/* needs to be called once every TDMA frame ! */ -int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - ts_meas_check_compute(ts, fn); - } - return 0; -} -- To view, visit https://gerrit.osmocom.org/3031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08 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 Jun 24 14:47:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:47:05 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C ...................................................................... osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C L1C is control, while L1P is data primitive. Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 1 insertion(+), 1 deletion(-) 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 a83816e..f564836 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -957,7 +957,7 @@ return 0; } - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", + DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, -- To view, visit https://gerrit.osmocom.org/3034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29 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 Jun 24 14:47:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:47:06 +0000 Subject: [MERGED] osmo-bts[master]: LC15: properly handle BS-AG-BLKS-RES as received from BSC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: properly handle BS-AG-BLKS-RES as received from BSC ...................................................................... LC15: properly handle BS-AG-BLKS-RES as received from BSC Closes: OS#2014 Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 5977aa9..71bb833 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -389,7 +389,7 @@ /* The sapi depends on DSP configuration, not * on the actual SYSTEM INFORMATION 3. */ u8BlockNbr = L1SAP_FN2CCCHBLOCK(u32Fn); - if (u8BlockNbr >= 1) + if (u8BlockNbr >= num_agch(trx, "PH-DATA-REQ")) sapi = GsmL1_Sapi_Pch; else sapi = GsmL1_Sapi_Agch; -- To view, visit https://gerrit.osmocom.org/3036 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Sat Jun 24 14:47:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:47:07 +0000 Subject: [MERGED] osmo-bts[master]: l1sap: if lchan is in loopback, don't accept incoming RTP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap: if lchan is in loopback, don't accept incoming RTP ...................................................................... l1sap: if lchan is in loopback, don't accept incoming RTP When the lchan is in loopback mode, we loop back all uplink blocks into downlink blocks. We do not processs any RTP frames for that lchan anymore. Rather, we discard those RTP frames to avoid mixing looped-back samples with those received from remote. Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b --- M src/common/l1sap.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index d7e3fb3..0ab84e5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1168,6 +1168,11 @@ struct msgb *msg; struct osmo_phsap_prim *l1sap; + /* if we're in loopback mode, we don't accept frames from the + * RTP socket anymore */ + if (lchan->loopback) + return; + msg = l1sap_msgb_alloc(rtp_pl_len); if (!msg) return; -- To view, visit https://gerrit.osmocom.org/3035 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b 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 Jun 24 14:47:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:47:07 +0000 Subject: [MERGED] osmo-bts[master]: l1sap.c: Factor out function to limit message queue In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap.c: Factor out function to limit message queue ...................................................................... l1sap.c: Factor out function to limit message queue Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687 --- M src/common/l1sap.c 1 file changed, 18 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index b9104b7..d7e3fb3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -94,6 +94,20 @@ return GSM_RTP_DURATION; } +/*! limit number of queue entries to %u; drops any surplus messages */ +static void queue_limit_to(const char *prefix, struct llist_head *queue, unsigned int limit) +{ + int count = llist_count(queue); + + if (count > limit) + LOGP(DL1P, LOGL_NOTICE, "%s: freeing %d queued frames\n", prefix, count-limit); + while (count > limit) { + struct msgb *tmp = msgb_dequeue(queue); + msgb_free(tmp); + count--; + } +} + /* allocate a msgb containing a osmo_phsap_prim + optional l2 data * in order to wrap femtobts header arround l2 data, there must be enough space * in front and behind data pointer */ @@ -1003,20 +1017,10 @@ /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { - struct msgb *tmp; - int count = 0; - /* make sure the queue doesn't get too long */ - llist_for_each_entry(tmp, &lchan->dl_tch_queue, list) - count++; - while (count >= 1) { - tmp = msgb_dequeue(&lchan->dl_tch_queue); - msgb_free(tmp); - count--; - } - + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ return 1; } @@ -1161,9 +1165,8 @@ uint32_t timestamp, bool marker) { struct gsm_lchan *lchan = rs->priv; - struct msgb *msg, *tmp; + struct msgb *msg; struct osmo_phsap_prim *l1sap; - int count = 0; msg = l1sap_msgb_alloc(rtp_pl_len); if (!msg) @@ -1179,13 +1182,7 @@ rtpmsg_ts(msg) = timestamp; /* make sure the queue doesn't get too long */ - llist_for_each_entry(tmp, &lchan->dl_tch_queue, list) - count++; - while (count >= 2) { - tmp = msgb_dequeue(&lchan->dl_tch_queue); - msgb_free(tmp); - count--; - } + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); msgb_enqueue(&lchan->dl_tch_queue, msg); } -- To view, visit https://gerrit.osmocom.org/3033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687 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 Jun 24 14:48:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 14:48:59 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3037 to look at the new patch set (#2). TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer using gettimeofday() is not suitable for the GSM frame timer, as it relies on the normal 'wall clock' system time, which may be adjusted by ntp, gps or other means at runtime. Switching to a different clock source means we cannot use osmo_timer_list anymore, but timerfd integrates just fine with our libosmocore select() loop handling. Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Closes: #2325 --- M src/osmo-bts-trx/scheduler_trx.c M src/osmo-bts-trx/trx_vty.c 2 files changed, 244 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/3037/2 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index cbcde8c..9c87643 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -2,7 +2,7 @@ /* (C) 2013 by Andreas Eversberg * (C) 2015 by Alexander Chemeris - * (C) 2015 by Harald Welte + * (C) 2015-2017 by Harald Welte * * All Rights Reserved * @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -46,12 +48,6 @@ #include "loops.h" extern void *tall_bts_ctx; - -/* clock states */ -static uint32_t transceiver_lost; -uint32_t transceiver_last_fn; -static struct timeval transceiver_clock_tv; -static struct osmo_timer_list transceiver_clock_timer; /* Enable this to multiply TOA of RACH by 10. * This is useful to check tenth of timing advances with RSSI test tool. @@ -1409,82 +1405,232 @@ return 0; } - /* - * frame clock + * TRX frame clock handling + * + * In a "normal" synchronous PHY layer, we would be polled every time + * the PHY needs data for a given frame number. However, the + * OpenBTS-inherited TRX protocol works differently: We (L1) must + * autonomously send burst data based on our own clock, and every so + * often (currently every ~ 216 frames), we get a clock indication from + * the TRX. + * + * We're using a MONOTONIC timerfd interval timer for the 4.615ms frame + * intervals, and then compute + send the 8 bursts for that frame. + * + * Upon receiving a clock indication from the TRX, we compensate + * accordingly: If we were transmitting too fast, we're delaying the + * next interval timer accordingly. If we were too slow, we immediately + * send burst data for the missing frame numbers. */ -#define FRAME_DURATION_uS 4615 +/*! clock state of a given TRX */ +struct osmo_trx_clock_state { + /*! number of FN periods without TRX clock indication */ + uint32_t fn_without_clock_ind; + struct { + /*! last FN we processed based on FN period timer */ + uint32_t fn; + /*! time at which we last processed FN */ + struct timespec tv; + } last_fn_timer; + struct { + /*! last FN we received a clock indication for */ + uint32_t fn; + /*! time at which we received the last clock indication */ + struct timespec tv; + } last_clk_ind; + /*! Osmocom FD wrapper for timerfd */ + struct osmo_fd fn_timer_ofd; +}; + +/* TODO: This must go and become part of the phy_link */ +static struct osmo_trx_clock_state g_clk_s = { .fn_timer_ofd.fd = -1 }; + +/*! duration of a GSM frame in nano-seconds. (120ms/26) */ +#define FRAME_DURATION_nS 4615384 +/*! duration of a GSM frame in micro-seconds (120s/26) */ +#define FRAME_DURATION_uS (FRAME_DURATION_nS/1000) +/*! maximum number of 'missed' frame periods we can tolerate of OS doesn't schedule us*/ #define MAX_FN_SKEW 50 +/*! maximum number of frame periods we can tolerate without TRX Clock Indication*/ #define TRX_LOSS_FRAMES 400 -extern int quit; -/* this timer fires for every FN to be processed */ -static void trx_ctrl_timer_cb(void *data) +/*! compute the number of micro-seconds difference elapsed between \a last and \a now */ +static inline int compute_elapsed_us(const struct timespec *last, const struct timespec *now) { - struct gsm_bts *bts = data; - struct timeval tv_now, *tv_clock = &transceiver_clock_tv; - int32_t elapsed; + int elapsed; + + elapsed = (now->tv_sec - last->tv_sec) * 1000000 + + (now->tv_nsec - last->tv_nsec) / 1000; + return elapsed; +} + +/*! compute the number of frame number intervals elapsed between \a last and \a now */ +static inline int compute_elapsed_fn(const uint32_t last, const uint32_t now) +{ + int elapsed_fn = (now + GSM_HYPERFRAME - last) % GSM_HYPERFRAME; + if (elapsed_fn >= 135774) + elapsed_fn -= GSM_HYPERFRAME; + return elapsed_fn; +} + +/*! normalise given 'struct timespec', i.e. carry nanoseconds into seconds */ +static inline void normalize_timespec(struct timespec *ts) +{ + ts->tv_sec += ts->tv_nsec / 1000000000; + ts->tv_nsec = ts->tv_nsec % 1000000000; +} + +/*! disable the osmocom-wrapped timerfd */ +static int timer_ofd_disable(struct osmo_fd *ofd) +{ + const struct itimerspec its_null = { + .it_value = { 0, 0 }, + .it_interval = { 0, 0 }, + }; + return timerfd_settime(ofd->fd, 0, &its_null, NULL); +} + +/*! schedule the osmcoom-wrapped timerfd to occur first at \a first, then periodically at \a interval + * \param[in] ofd Osmocom wrapped timerfd + * \param[in] first Relative time at which the timer should first execute (NULL = \a interval) + * \param[in] interval Time interval at which subsequent timer shall fire + * \returns 0 on success; negative on error */ +static int timer_ofd_schedule(struct osmo_fd *ofd, const struct timespec *first, + const struct timespec *interval) +{ + struct itimerspec its; + + if (ofd->fd < 0) + return -EINVAL; + + /* first expiration */ + if (first) + its.it_value = *first; + else + its.it_value = *interval; + /* repeating interval */ + its.it_interval = *interval; + + return timerfd_settime(ofd->fd, 0, &its, NULL); +} + +/*! setup osmocom-wrapped timerfd + * \param[inout] ofd Osmocom-wrapped timerfd on which to operate + * \param[in] cb Call-back function called when timerfd becomes readable + * \param[in] data Opaque data to be passed on to call-back + * \returns 0 on success; negative on error + * + * We simply initialize the data structures here, but do not yet + * schedule the timer. + */ +static int timer_ofd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, unsigned int), void *data) +{ + ofd->cb = cb; + ofd->data = data; + ofd->when = BSC_FD_READ; + + if (ofd->fd < 0) { + ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); + if (ofd->fd < 0) + return ofd->fd; + + osmo_fd_register(ofd); + } + return 0; +} + +/*! Increment a GSM frame number modulo GSM_HYPERFRAME */ +#define INCREMENT_FN(fn) (fn) = (((fn) + 1) % GSM_HYPERFRAME) + +extern int quit; + +/*! this is the timerfd-callback firing for every FN to be processed */ +static int trx_fn_timer_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct gsm_bts *bts = ofd->data; + struct osmo_trx_clock_state *tcs = &g_clk_s; + struct timespec tv_now; + uint64_t expire_count; + int elapsed_us; + int error_us; + int rc, i; + + if (!(what & BSC_FD_READ)) + return 0; + + /* read from timerfd: number of expirations of periodic timer */ + rc = read(ofd->fd, (void *) &expire_count, sizeof(expire_count)); + if (rc < 0 && errno == EAGAIN) + return 0; + OSMO_ASSERT(rc == sizeof(expire_count)); + + if (expire_count > 1) { + LOGP(DL1C, LOGL_NOTICE, "FN timer expire_count=%"PRIu64": We missed %"PRIu64" timers\n", + expire_count, expire_count-1); + } /* check if transceiver is still alive */ - if (transceiver_lost++ == TRX_LOSS_FRAMES) { + if (tcs->fn_without_clock_ind++ == TRX_LOSS_FRAMES) { LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); no_clock: + timer_ofd_disable(&tcs->fn_timer_ofd); transceiver_available = 0; bts_shutdown(bts, "No clock from osmo-trx"); - return; + return -1; } - gettimeofday(&tv_now, NULL); - - elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 - + (tv_now.tv_usec - tv_clock->tv_usec); + /* compute actual elapsed time and resulting OS scheduling error */ + clock_gettime(CLOCK_MONOTONIC, &tv_now); + elapsed_us = compute_elapsed_us(&tcs->last_fn_timer.tv, &tv_now); + error_us = elapsed_us - FRAME_DURATION_uS; +#ifdef DEBUG_CLOCK + printf("%s(): %09ld, elapsed_us=%05d, error_us=%-d: fn=%d\n", __func__, + tv_now.tv_nsec, elapsed_us, error_us, tcs->last_fn_timer.fn+1); +#endif + tcs->last_fn_timer.tv = tv_now; /* if someone played with clock, or if the process stalled */ - if (elapsed > FRAME_DURATION_uS * MAX_FN_SKEW || elapsed < 0) { - LOGP(DL1C, LOGL_NOTICE, "PC clock skew: elapsed uS %d\n", - elapsed); + if (elapsed_us > FRAME_DURATION_uS * MAX_FN_SKEW || elapsed_us < 0) { + LOGP(DL1C, LOGL_ERROR, "PC clock skew: elapsed_us=%d, error_us=%d\n", + elapsed_us, error_us); goto no_clock; } - /* schedule next FN clock */ - while (elapsed > FRAME_DURATION_uS / 2) { - tv_clock->tv_usec += FRAME_DURATION_uS; - if (tv_clock->tv_usec >= 1000000) { - tv_clock->tv_sec++; - tv_clock->tv_usec -= 1000000; - } - transceiver_last_fn = (transceiver_last_fn + 1) % GSM_HYPERFRAME; - trx_sched_fn(bts, transceiver_last_fn); - elapsed -= FRAME_DURATION_uS; + /* call trx_sched_fn() for all expired FN */ + for (i = 0; i < expire_count; i++) { + INCREMENT_FN(tcs->last_fn_timer.fn); + trx_sched_fn(bts, tcs->last_fn_timer.fn); } - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS - elapsed); + + return 0; } - -/* receive clock from transceiver */ +/*! called every time we receive a clock indication from TRX */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn) { - struct timeval tv_now, *tv_clock = &transceiver_clock_tv; - int32_t elapsed; - int32_t elapsed_fn; + struct osmo_trx_clock_state *tcs = &g_clk_s; + struct timespec tv_now; + int elapsed_us, elapsed_fn; + int elapsed_us_since_clk, elapsed_fn_since_clk, error_us_since_clk; + unsigned int fn_caught_up = 0; + const struct timespec interval = { .tv_sec = 0, .tv_nsec = FRAME_DURATION_nS }; if (quit) return 0; /* reset lost counter */ - transceiver_lost = 0; + tcs->fn_without_clock_ind = 0; - gettimeofday(&tv_now, NULL); + clock_gettime(CLOCK_MONOTONIC, &tv_now); /* clock becomes valid */ if (!transceiver_available) { - LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", - fn); + LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", fn); transceiver_available = 1; @@ -1495,69 +1641,83 @@ check_transceiver_availability(bts, 1); new_clock: - transceiver_last_fn = fn; - trx_sched_fn(bts, transceiver_last_fn); + tcs->last_fn_timer.fn = fn; + /* call trx cheduler function for new 'last' FN */ + trx_sched_fn(bts, tcs->last_fn_timer.fn); - /* schedule first FN clock */ - memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - memset(&transceiver_clock_timer, 0, - sizeof(transceiver_clock_timer)); - transceiver_clock_timer.cb = trx_ctrl_timer_cb; - transceiver_clock_timer.data = bts; - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS); + /* schedule first FN clock timer */ + timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); + timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, &interval); + + tcs->last_fn_timer.tv = tv_now; + tcs->last_clk_ind.tv = tv_now; + tcs->last_clk_ind.fn = fn; return 0; } - osmo_timer_del(&transceiver_clock_timer); + /* calculate elapsed time +fn since last timer */ + elapsed_us = compute_elapsed_us(&tcs->last_fn_timer.tv, &tv_now); + elapsed_fn = compute_elapsed_fn(tcs->last_fn_timer.fn, fn); +#ifdef DEBUG_CLOCK + printf("%s(): LAST_TIMER %9ld, elapsed_us=%7d, elapsed_fn=%+3d\n", __func__, + tv_now.tv_nsec, elapsed_us, elapsed_fn); +#endif + /* negative elapsed_fn values mean that we've already processed + * more FN based on the local interval timer than what the TRX + * now reports in the clock indication. Positive elapsed_fn + * values mean we still have a backlog to process */ - /* calculate elapsed time since last_fn */ - elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 - + (tv_now.tv_usec - tv_clock->tv_usec); + /* calculate elapsed time +fn since last clk ind */ + elapsed_us_since_clk = compute_elapsed_us(&tcs->last_clk_ind.tv, &tv_now); + elapsed_fn_since_clk = compute_elapsed_fn(tcs->last_clk_ind.fn, fn); + /* error (delta) between local clock since last CLK and CLK based on FN clock at TRX */ + error_us_since_clk = elapsed_us_since_clk - (FRAME_DURATION_uS * elapsed_fn_since_clk); + LOGP(DL1C, LOGL_INFO, "TRX Clock Ind: elapsed_us=%7d, elapsed_fn=%3d, error_us=%+5d\n", + elapsed_us_since_clk, elapsed_fn_since_clk, error_us_since_clk); - /* how much frames have been elapsed since last fn processed */ - elapsed_fn = (fn + GSM_HYPERFRAME - transceiver_last_fn) % GSM_HYPERFRAME; - if (elapsed_fn >= 135774) - elapsed_fn -= GSM_HYPERFRAME; + /* TODO: put this computed error_us_since_clk into some filter + * function and use that to adjust our regular timer interval to + * compensate for clock drift between the PC clock and the + * TRX/SDR clock */ + + tcs->last_clk_ind.tv = tv_now; + tcs->last_clk_ind.fn = fn; /* check for max clock skew */ if (elapsed_fn > MAX_FN_SKEW || elapsed_fn < -MAX_FN_SKEW) { LOGP(DL1C, LOGL_NOTICE, "GSM clock skew: old fn=%u, " - "new fn=%u\n", transceiver_last_fn, fn); + "new fn=%u\n", tcs->last_fn_timer.fn, fn); goto new_clock; } - LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d\n", - elapsed_fn * FRAME_DURATION_uS - elapsed); + LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d us (elapsed_fn=%d)\n", + elapsed_fn * FRAME_DURATION_uS - elapsed_us, elapsed_fn); /* too many frames have been processed already */ if (elapsed_fn < 0) { + struct timespec first = interval; /* set clock to the time or last FN should have been * transmitted. */ - tv_clock->tv_sec = tv_now.tv_sec; - tv_clock->tv_usec = tv_now.tv_usec + - (0 - elapsed_fn) * FRAME_DURATION_uS; - if (tv_clock->tv_usec >= 1000000) { - tv_clock->tv_sec++; - tv_clock->tv_usec -= 1000000; - } + first.tv_nsec += (0 - elapsed_fn) * FRAME_DURATION_nS; + normalize_timespec(&first); + LOGP(DL1C, LOGL_NOTICE, "We were %d FN faster than TRX, compensating\n", -elapsed_fn); /* set time to the time our next FN has to be transmitted */ - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS * (1 - elapsed_fn)); - + timer_ofd_schedule(&tcs->fn_timer_ofd, &first, &interval); return 0; } /* transmit what we still need to transmit */ - while (fn != transceiver_last_fn) { - transceiver_last_fn = (transceiver_last_fn + 1) % GSM_HYPERFRAME; - trx_sched_fn(bts, transceiver_last_fn); + while (fn != tcs->last_fn_timer.fn) { + INCREMENT_FN(tcs->last_fn_timer.fn); + trx_sched_fn(bts, tcs->last_fn_timer.fn); + fn_caught_up++; } - /* schedule next FN to be transmitted */ - memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - osmo_timer_schedule(&transceiver_clock_timer, 0, FRAME_DURATION_uS); + if (fn_caught_up) { + LOGP(DL1C, LOGL_NOTICE, "We were %d FN slower than TRX, compensated\n", elapsed_fn); + tcs->last_fn_timer.tv = tv_now; + } return 0; } diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 4f74c44..6d6cded 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -60,8 +60,7 @@ if (!transceiver_available) { vty_out(vty, "transceiver is not connected%s", VTY_NEWLINE); } else { - vty_out(vty, "transceiver is connected, current fn=%u%s", - transceiver_last_fn, VTY_NEWLINE); + vty_out(vty, "transceiver is connected%s", VTY_NEWLINE); } llist_for_each_entry(trx, &bts->trx_list, list) { -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e 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 Jun 24 15:23:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 15:23:09 +0000 Subject: osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 let's say if osmo-gsm-tester at least doesn't get worse with this. -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e 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 Jun 24 15:23:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 15:23:45 +0000 Subject: osmo-bts[master]: Add loopback support for PDTCH In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 just for review/sharing at this point -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 4 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 Jun 24 16:48:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:35 +0000 Subject: [PATCH] osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging Message-ID: Review at https://gerrit.osmocom.org/3038 l1sap/osmo-bts-sysmo: Improve logging Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af --- M src/common/l1sap.c 1 file changed, 28 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/3038/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index cb14a9f..82a636a 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -475,12 +475,16 @@ struct bts_ul_meas ulm; struct gsm_lchan *lchan; - DEBUGP(DL1P, "MPH_INFO meas ind chan_nr=0x%02x\n", - info_meas_ind->chan_nr); - lchan = get_active_lchan_by_chan_nr(trx, info_meas_ind->chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for MPH INFO MEAS IND (chan_nr=%u)\n", + info_meas_ind->chan_nr); return 0; + } + + DEBUGP(DL1P, "%s MPH_INFO meas ind, ta_offs_qbits=%d, ber10k=%d, inv_rssi=%u\n", + gsm_lchan_name(lchan), info_meas_ind->ta_offs_qbits, + info_meas_ind->ber10k, info_meas_ind->inv_rssi); /* in the GPRS case we are not interested in measurement * processing. The PCU will take care of it */ @@ -702,8 +706,10 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } else if (!(chan_nr & 0x80)) { /* only TCH/F, TCH/H, SDCCH/4 and SDCCH/8 have C5 bit cleared */ lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind (chan_nr=%u)\n", chan_nr); return 0; + } if (L1SAP_IS_LINK_SACCH(link_id)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); /* L1-header, if not set/modified by layer 1 */ @@ -754,8 +760,8 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } - DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Tx PH-DATA.req %s chan_nr=%d link_id=%d\n", + dump_gsmtime(&g_time), chan_nr, link_id); l1sap_down(trx, l1sap); @@ -802,12 +808,14 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH-RTS.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n", + dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind (chan_nr=%u)\n", chan_nr); return 0; + } if (!lchan->loopback && lchan->abis_ip.rtp_socket) { osmo_rtp_socket_poll(lchan->abis_ip.rtp_socket); @@ -856,8 +864,8 @@ resp_l1sap->u.tch.fn = fn; resp_l1sap->u.tch.marker = marker; - DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Tx TCH.req %s chan_nr=%d\n", + dump_gsmtime(&g_time), chan_nr); l1sap_down(trx, resp_l1sap); @@ -959,8 +967,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + LOGP(DL1P, LOGL_INFO, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d len=%d\n", + dump_gsmtime(&g_time), chan_nr, link_id, len); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); @@ -1000,8 +1008,10 @@ } lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); return 0; + } /* bad frame */ if (len == 0) { @@ -1067,8 +1077,10 @@ g_time.t1, g_time.t2, g_time.t3, chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for TCH.ind (chan_nr=%u)\n", chan_nr); return 0; + } msgb_pull(msg, sizeof(*l1sap)); -- To view, visit https://gerrit.osmocom.org/3038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:35 +0000 Subject: [PATCH] osmo-bts[master]: TRX: trx_if: Improve code description / comments Message-ID: Review at https://gerrit.osmocom.org/3039 TRX: trx_if: Improve code description / comments Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c --- M src/osmo-bts-trx/trx_if.c 1 file changed, 54 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/39/3039/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index c676d11..b15d24d 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -1,5 +1,9 @@ /* - * OpenBTS TRX interface handling + * OpenBTS-style TRX interface/protocol handling + * + * This file contains the BTS-side implementation of the OpenBTS-style + * UDP TRX protocol. It manages the clock, control + burst-data UDP + * sockets and their respective protocol encoding/parsing. * * Copyright (C) 2013 Andreas Eversberg * Copyright (C) 2016 Harald Welte @@ -53,10 +57,10 @@ #define TRX_MAX_BURST_LEN 512 /* - * socket + * socket helper functions */ -/* open socket */ +/*! convenience wrapper to open socket + fill in osmo_fd */ static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host_local, uint16_t port_local, const char *host_remote, uint16_t port_remote, int (*cb)(struct osmo_fd *fd, unsigned int what)) @@ -77,7 +81,7 @@ return 0; } -/* close socket */ +/* close socket + unregister osmo_fd */ static void trx_udp_close(struct osmo_fd *ofd) { if (ofd->fd > 0) { @@ -89,7 +93,7 @@ /* - * clock + * TRX clock socket */ /* get clock from clock socket */ @@ -121,6 +125,7 @@ "correctly, correcting to fn=%u\n", fn); } + /* inform core TRX clock handling code that a FN has been received */ trx_sched_clock(pinst->trx->bts, fn); return 0; @@ -128,7 +133,7 @@ /* - * ctrl + * TRX ctrl socket */ static void trx_ctrl_timer_cb(void *data); @@ -165,7 +170,16 @@ trx_ctrl_send(l1h); } -/* add a new ctrl command */ +/*! Send a new TRX control command. + * \param[inout] l1h TRX Layer1 handle to which to send command + * \param[in] criticial + * \param[in] cmd zero-terminated string containing command + * \param[in] fmt Format string (+ variable list of arguments) + * \returns 0 on success; negative on error + * + * The new ocommand will be added to the end of the control command + * queue. + */ static int trx_ctrl_cmd(struct trx_l1h *l1h, int critical, const char *cmd, const char *fmt, ...) { @@ -197,15 +211,16 @@ tcm->cmd_len = strlen(cmd); tcm->critical = critical; llist_add_tail(&tcm->list, &l1h->trx_ctrl_list); - LOGP(DTRX, LOGL_INFO, "Adding new control '%s'\n", tcm->cmd); + LOGP(DTRX, LOGL_INFO, "Enqueuing TRX control command '%s'\n", tcm->cmd); - /* send message, if no pending message */ + /* send message, if we didn't already have pending messages */ if (!pending) trx_ctrl_send(l1h); return 0; } +/*! Send "POWEROFF" command to TRX */ int trx_if_cmd_poweroff(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -215,6 +230,7 @@ return 0; } +/*! Send "POWERON" command to TRX */ int trx_if_cmd_poweron(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -224,6 +240,7 @@ return 0; } +/*! Send "SETTSC" command to TRX */ int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc) { if (!settsc_enabled) @@ -233,6 +250,7 @@ tsc); } +/*! Send "SETBSIC" command to TRX */ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic) { if (!setbsic_enabled) @@ -242,31 +260,37 @@ bsic); } +/*! Send "SETRXGAIN" command to TRX */ int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db) { return trx_ctrl_cmd(l1h, 0, "SETRXGAIN", "%d", db); } +/*! Send "SETPOWER" command to TRX */ int trx_if_cmd_setpower(struct trx_l1h *l1h, int db) { return trx_ctrl_cmd(l1h, 0, "SETPOWER", "%d", db); } +/*! Send "SETMAXDLY" command to TRX, i.e. maximum delay for RACH bursts */ int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly) { return trx_ctrl_cmd(l1h, 0, "SETMAXDLY", "%d", dly); } +/*! Send "SETMAXDLYNB" command to TRX, i.e. maximum delay for normal bursts */ int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly) { return trx_ctrl_cmd(l1h, 0, "SETMAXDLYNB", "%d", dly); } +/*! Send "SETSLOT" command to TRX: Configure Channel Combination for TS */ int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type) { return trx_ctrl_cmd(l1h, 1, "SETSLOT", "%d %d", tn, type); } +/*! Send "RXTUNE" command to TRX: Tune Receiver to given ARFCN */ int trx_if_cmd_rxtune(struct trx_l1h *l1h, uint16_t arfcn) { struct phy_instance *pinst = l1h->phy_inst; @@ -285,6 +309,7 @@ return trx_ctrl_cmd(l1h, 1, "RXTUNE", "%d", freq10 * 100); } +/*! Send "TXTUNE" command to TRX: Tune Transmitter to given ARFCN */ int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn) { struct phy_instance *pinst = l1h->phy_inst; @@ -303,17 +328,19 @@ return trx_ctrl_cmd(l1h, 1, "TXTUNE", "%d", freq10 * 100); } +/*! Send "HANDOVER" command to TRX: Enable handover RACH Detection on timeslot/sub-slot */ int trx_if_cmd_handover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss) { return trx_ctrl_cmd(l1h, 1, "HANDOVER", "%d %d", tn, ss); } +/*! Send "NOHANDOVER" command to TRX: Disable handover RACH Detection on timeslot/sub-slot */ int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss) { return trx_ctrl_cmd(l1h, 1, "NOHANDOVER", "%d %d", tn, ss); } -/* get response from ctrl socket */ +/*! Get + parse response from TRX ctrl socket */ static int trx_ctrl_read_cb(struct osmo_fd *ofd, unsigned int what) { struct trx_l1h *l1h = ofd->data; @@ -353,7 +380,7 @@ tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - /* check if respose matches command */ + /* check if response matches command */ if (rsp_len != tcm->cmd_len) { notmatch: LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, @@ -393,7 +420,7 @@ /* - * data + * TRX burst data socket */ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) @@ -452,11 +479,20 @@ fprintf(stderr, "%s\n", deb); #endif + /* feed received burst into scheduler code */ trx_sched_ul_burst(&l1h->l1s, tn, fn, bits, burst_len, rssi, toa); return 0; } +/*! Send burst data for given FN/timeslot to TRX + * \param[inout] l1h TRX Layer1 handle referring to TX + * \param[in] tn Timeslot Number (0..7) + * \param[in] fn GSM Frame Number + * \param[in] pwr Transmit Power to use + * \param[in] bits Unpacked bits to be transmitted + * \param[in] nbits Number of \a bits + * \returns 0 on success; negative on error */ int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits) { @@ -495,6 +531,7 @@ * open/close */ +/*! open the PHY link using TRX protocol */ int bts_model_phy_link_open(struct phy_link *plink) { struct phy_instance *pinst; @@ -537,6 +574,7 @@ return -1; } +/*! compute UDP port number used for TRX protocol */ static uint16_t compute_port(struct phy_instance *pinst, int remote, int is_data) { struct phy_link *plink = pinst->phy_link; @@ -551,6 +589,7 @@ return plink->u.osmotrx.base_port_local + (pinst->num << 1) + inc; } +/*! open a TRX interface. creates contro + data sockets */ int trx_if_open(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -593,7 +632,7 @@ return rc; } -/* flush pending control messages */ +/*! flush (delete) all pending control messages */ void trx_if_flush(struct trx_l1h *l1h) { struct trx_ctrl_msg *tcm; @@ -607,6 +646,7 @@ } } +/*! close the TRX for given handle (data + control socket) */ void trx_if_close(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; @@ -620,6 +660,7 @@ trx_udp_close(&l1h->trx_ofd_data); } +/*! determine if the TRX for given handle is powered up */ int trx_if_powered(struct trx_l1h *l1h) { return l1h->config.poweron; -- To view, visit https://gerrit.osmocom.org/3039 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:35 +0000 Subject: [PATCH] osmo-bts[master]: trx_if: Improve error handling Message-ID: Review at https://gerrit.osmocom.org/3040 trx_if: Improve error handling There ware some error conditions that the previous code didn't catch and/or report, such as unparseable TRX control strings, non-terminated buffers, ... Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da --- M src/osmo-bts-trx/trx_if.c 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/3040/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index b15d24d..2486894 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -6,7 +6,7 @@ * sockets and their respective protocol encoding/parsing. * * Copyright (C) 2013 Andreas Eversberg - * Copyright (C) 2016 Harald Welte + * Copyright (C) 2016-2017 Harald Welte * * All Rights Reserved * @@ -84,7 +84,7 @@ /* close socket + unregister osmo_fd */ static void trx_udp_close(struct osmo_fd *ofd) { - if (ofd->fd > 0) { + if (ofd->fd >= 0) { osmo_fd_unregister(ofd); close(ofd->fd); ofd->fd = -1; @@ -116,7 +116,11 @@ return 0; } - sscanf(buf, "IND CLOCK %u", &fn); + if (sscanf(buf, "IND CLOCK %u", &fn) != 1) { + LOGP(DTRX, LOGL_ERROR, "Unable to parse '%s'\n", buf); + return 0; + } + LOGP(DTRX, LOGL_INFO, "Clock indication: fn=%u\n", fn); if (fn >= GSM_HYPERFRAME) { @@ -208,6 +212,7 @@ va_end(ap); } else snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "CMD %s", cmd); + tcm->cmd[sizeof(tcm->cmd)-1] = '\0'; tcm->cmd_len = strlen(cmd); tcm->critical = critical; llist_add_tail(&tcm->list, &l1h->trx_ctrl_list); -- To view, visit https://gerrit.osmocom.org/3040 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:35 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Rename trx_if_data() -> trx_if_send_burst() Message-ID: Review at https://gerrit.osmocom.org/3041 TRX: Rename trx_if_data() -> trx_if_send_burst() The new name makes it clear what the function actually does: Send burst data via the trx interface. Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa --- M src/osmo-bts-trx/scheduler_trx.c M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/3041/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 9c87643..a9bcbda 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1398,7 +1398,7 @@ } else gain = 0; if (nbits) - trx_if_data(l1h, tn, fn, gain, bits, nbits); + trx_if_send_burst(l1h, tn, fn, gain, bits, nbits); } } diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 2486894..ba2908a 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -498,7 +498,7 @@ * \param[in] bits Unpacked bits to be transmitted * \param[in] nbits Number of \a bits * \returns 0 on success; negative on error */ -int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, +int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits) { uint8_t buf[TRX_MAX_BURST_LEN]; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 05e8bff..93ea180 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -29,7 +29,7 @@ int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn); int trx_if_cmd_handover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss); int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss); -int trx_if_data(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, +int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits); int trx_if_open(struct trx_l1h *l1h); void trx_if_flush(struct trx_l1h *l1h); -- To view, visit https://gerrit.osmocom.org/3041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:36 +0000 Subject: [PATCH] osmo-bts[master]: TRX: merge/simplify l1_if and trx_if code Message-ID: Review at https://gerrit.osmocom.org/3042 TRX: merge/simplify l1_if and trx_if code Related code / function structure still dates back to the pre-phy_link days. Let's clean this up to make things less convoluted and reduce the number of non-static symbols needed between code split over two files. Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h 4 files changed, 93 insertions(+), 104 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/3042/1 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index a7bcd2c..59a6b6c 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -57,48 +57,6 @@ }; -/* - * create/destroy trx l1 instance - */ - -struct trx_l1h *l1if_open(struct phy_instance *pinst) -{ - struct trx_l1h *l1h; - int rc; - - l1h = pinst->u.osmotrx.hdl; - if (!l1h) - return NULL; - - rc = trx_sched_init(&l1h->l1s, pinst->trx); - if (rc < 0) { - LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler for phy " - "instance %d\n", pinst->num); - return NULL; - } - - rc = trx_if_open(l1h); - if (rc < 0) { - LOGP(DL1C, LOGL_FATAL, "Cannot open TRX interface for phy " - "instance %d\n", pinst->num); - l1if_close(l1h); - return NULL; - } - - return l1h; -} - -void l1if_close(struct trx_l1h *l1h) -{ - trx_if_close(l1h); - trx_sched_exit(&l1h->l1s); - talloc_free(l1h); -} - -void l1if_reset(struct trx_l1h *l1h) -{ -} - static void check_transceiver_availability_trx(struct trx_l1h *l1h, int avail) { struct phy_instance *pinst = l1h->phy_inst; diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 1864857..40f55ab 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -61,9 +61,6 @@ struct l1sched_trx l1s; }; -struct trx_l1h *l1if_open(struct phy_instance *pinst); -void l1if_close(struct trx_l1h *l1h); -void l1if_reset(struct trx_l1h *l1h); int check_transceiver_availability(struct gsm_bts *bts, int avail); int l1if_provision_transceiver_trx(struct trx_l1h *l1h); int l1if_provision_transceiver(struct gsm_bts *bts); diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index ba2908a..c56efbf 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -536,47 +536,32 @@ * open/close */ -/*! open the PHY link using TRX protocol */ -int bts_model_phy_link_open(struct phy_link *plink) +/*! flush (delete) all pending control messages */ +void trx_if_flush(struct trx_l1h *l1h) { - struct phy_instance *pinst; - int rc; + struct trx_ctrl_msg *tcm; - phy_link_state_set(plink, PHY_LINK_CONNECTING); - - /* open the shared/common clock socket */ - rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, - plink->u.osmotrx.local_ip, - plink->u.osmotrx.base_port_local, - plink->u.osmotrx.remote_ip, - plink->u.osmotrx.base_port_remote, - trx_clk_read_cb); - if (rc < 0) { - phy_link_state_set(plink, PHY_LINK_SHUTDOWN); - return -1; + /* free ctrl message list */ + while (!llist_empty(&l1h->trx_ctrl_list)) { + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, + list); + llist_del(&tcm->list); + talloc_free(tcm); } +} - /* open the individual instances with their ctrl+data sockets */ - llist_for_each_entry(pinst, &plink->instances, list) { - pinst->u.osmotrx.hdl = l1if_open(pinst); - if (!pinst->u.osmotrx.hdl) - goto cleanup; - } - /* FIXME: is there better way to check/report TRX availability? */ - transceiver_available = 1; - phy_link_state_set(plink, PHY_LINK_CONNECTED); - return 0; +/*! close the TRX for given handle (data + control socket) */ +void trx_if_close(struct trx_l1h *l1h) +{ + struct phy_instance *pinst = l1h->phy_inst; + LOGP(DTRX, LOGL_NOTICE, "Close transceiver for %s\n", + phy_instance_name(pinst)); -cleanup: - phy_link_state_set(plink, PHY_LINK_SHUTDOWN); - llist_for_each_entry(pinst, &plink->instances, list) { - if (pinst->u.osmotrx.hdl) { - trx_if_close(pinst->u.osmotrx.hdl); - pinst->u.osmotrx.hdl = NULL; - } - } - trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); - return -1; + trx_if_flush(l1h); + + /* close sockets */ + trx_udp_close(&l1h->trx_ofd_ctrl); + trx_udp_close(&l1h->trx_ofd_data); } /*! compute UDP port number used for TRX protocol */ @@ -595,7 +580,7 @@ } /*! open a TRX interface. creates contro + data sockets */ -int trx_if_open(struct trx_l1h *l1h) +static int trx_if_open(struct trx_l1h *l1h) { struct phy_instance *pinst = l1h->phy_inst; struct phy_link *plink = pinst->phy_link; @@ -637,32 +622,84 @@ return rc; } -/*! flush (delete) all pending control messages */ -void trx_if_flush(struct trx_l1h *l1h) +/*! close the control + burst data sockets for one phy_instance */ +static void trx_phy_inst_close(struct phy_instance *pinst) { - struct trx_ctrl_msg *tcm; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; - /* free ctrl message list */ - while (!llist_empty(&l1h->trx_ctrl_list)) { - tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, - list); - llist_del(&tcm->list); - talloc_free(tcm); - } + trx_if_close(l1h); + trx_sched_exit(&l1h->l1s); + talloc_free(l1h); } -/*! close the TRX for given handle (data + control socket) */ -void trx_if_close(struct trx_l1h *l1h) +/*! open the control + burst data sockets for one phy_instance */ +static int trx_phy_inst_open(struct phy_instance *pinst) { - struct phy_instance *pinst = l1h->phy_inst; - LOGP(DTRX, LOGL_NOTICE, "Close transceiver for %s\n", - phy_instance_name(pinst)); + struct trx_l1h *l1h; + int rc; - trx_if_flush(l1h); + l1h = pinst->u.osmotrx.hdl; + if (!l1h) + return -EINVAL; - /* close sockets */ - trx_udp_close(&l1h->trx_ofd_ctrl); - trx_udp_close(&l1h->trx_ofd_data); + rc = trx_sched_init(&l1h->l1s, pinst->trx); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler for phy " + "instance %d\n", pinst->num); + return -EIO; + } + + rc = trx_if_open(l1h); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Cannot open TRX interface for phy " + "instance %d\n", pinst->num); + trx_phy_inst_close(pinst); + return -EIO; + } + + return 0; +} + +/*! open the PHY link using TRX protocol */ +int bts_model_phy_link_open(struct phy_link *plink) +{ + struct phy_instance *pinst; + int rc; + + phy_link_state_set(plink, PHY_LINK_CONNECTING); + + /* open the shared/common clock socket */ + rc = trx_udp_open(plink, &plink->u.osmotrx.trx_ofd_clk, + plink->u.osmotrx.local_ip, + plink->u.osmotrx.base_port_local, + plink->u.osmotrx.remote_ip, + plink->u.osmotrx.base_port_remote, + trx_clk_read_cb); + if (rc < 0) { + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + return -1; + } + + /* open the individual instances with their ctrl+data sockets */ + llist_for_each_entry(pinst, &plink->instances, list) { + if (trx_phy_inst_open(pinst) < 0) + goto cleanup; + } + /* FIXME: is there better way to check/report TRX availability? */ + transceiver_available = 1; + phy_link_state_set(plink, PHY_LINK_CONNECTED); + return 0; + +cleanup: + phy_link_state_set(plink, PHY_LINK_SHUTDOWN); + llist_for_each_entry(pinst, &plink->instances, list) { + if (pinst->u.osmotrx.hdl) { + trx_if_close(pinst->u.osmotrx.hdl); + pinst->u.osmotrx.hdl = NULL; + } + } + trx_udp_close(&plink->u.osmotrx.trx_ofd_clk); + return -1; } /*! determine if the TRX for given handle is powered up */ diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 93ea180..1fc454d 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -31,9 +31,6 @@ int trx_if_cmd_nohandover(struct trx_l1h *l1h, uint8_t tn, uint8_t ss); int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr, const ubit_t *bits, uint16_t nbits); -int trx_if_open(struct trx_l1h *l1h); -void trx_if_flush(struct trx_l1h *l1h); -void trx_if_close(struct trx_l1h *l1h); int trx_if_powered(struct trx_l1h *l1h); #endif /* TRX_IF_H */ -- To view, visit https://gerrit.osmocom.org/3042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:36 +0000 Subject: [PATCH] osmo-bts[master]: TRX: don't free l1h in trx_phy_inst_close() Message-ID: Review at https://gerrit.osmocom.org/3043 TRX: don't free l1h in trx_phy_inst_close() l1h is allocated in bts_model_phy_instance_set_defaults() and not in trx_phy_inst_open(). Hence, trx_phy_inst_close() should not free() it! Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/3043/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index c56efbf..8ce2893 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -629,7 +629,6 @@ trx_if_close(l1h); trx_sched_exit(&l1h->l1s); - talloc_free(l1h); } /*! open the control + burst data sockets for one phy_instance */ -- To view, visit https://gerrit.osmocom.org/3043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:36 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... Message-ID: Review at https://gerrit.osmocom.org/3044 TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 4 files changed, 38 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/3044/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 4c7ff34..89bb336 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -45,6 +45,7 @@ uint32_t clock_advance; uint32_t rts_advance; + bool use_legacy_setbsic; } osmotrx; struct { /* MAC address of the PHY */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8ce2893..86a3b9b 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -51,8 +51,6 @@ //#define TOA_RSSI_DEBUG int transceiver_available = 0; -int settsc_enabled = 0; -int setbsic_enabled = 0; #define TRX_MAX_BURST_LEN 512 @@ -248,21 +246,21 @@ /*! Send "SETTSC" command to TRX */ int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc) { - if (!settsc_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if TSC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (setbsic_enabled) ? 0 : 1, "SETTSC", "%d", - tsc); + + return trx_ctrl_cmd(l1h, 1, "SETTSC", "%d", tsc); } /*! Send "SETBSIC" command to TRX */ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic) { - if (!setbsic_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (!pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if BSIC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (settsc_enabled) ? 0 : 1, "SETBSIC", "%d", - bsic); + + return trx_ctrl_cmd(l1h, 1, "SETBSIC", "%d", bsic); } /*! Send "SETRXGAIN" command to TRX */ diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 1fc454d..ee24f71 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -4,8 +4,6 @@ extern int transceiver_available; extern const char *local_ip; extern const char *remote_ip; -extern int settsc_enabled; -extern int setbsic_enabled; struct trx_l1h; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 6d6cded..482248c 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -197,51 +197,6 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_settsc, cfg_bts_settsc_cmd, - "settsc", - "Use SETTSC to configure transceiver\n") -{ - settsc_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_setbsic, cfg_bts_setbsic_cmd, - "setbsic", - "Use SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_settsc, cfg_bts_no_settsc_cmd, - "no settsc", - NO_STR "Disable SETTSC to configure transceiver\n") -{ - settsc_enabled = 0; - if (!setbsic_enabled) { - vty_out(vty, "%% Auto enabling SETBSIC.%s", VTY_NEWLINE); - setbsic_enabled = 1; - } - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_setbsic, cfg_bts_no_setbsic_cmd, - "no setbsic", - NO_STR "Disable SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 0; - if (!settsc_enabled) { - vty_out(vty, "%% Auto enabling SETTSC.%s", VTY_NEWLINE); - settsc_enabled = 1; - } - - return CMD_SUCCESS; -} - - DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." @@ -322,7 +277,6 @@ vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); else { vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); - settsc_enabled = 1; } return CMD_SUCCESS; @@ -503,6 +457,30 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd, + "osmotrx legacy-setbsic", + "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = true; + + vty_out(vty, "%% You have enabled SETBSIC, which is not supported by OsmoTRX " + "but only useful if you want to interface with legacy OpenBTS Transceivers%s", + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd, + "no osmotrx legacy-setbsic", + NO_STR "Disable Legacy SETBSIC to configure transceiver\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = false; + + return CMD_SUCCESS; +} + void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { if (plink->u.osmotrx.local_ip) @@ -523,6 +501,9 @@ plink->u.osmotrx.clock_advance, VTY_NEWLINE); vty_out(vty, " osmotrx rts-advance %d%s", plink->u.osmotrx.rts_advance, VTY_NEWLINE); + + if (plink->u.osmotrx.use_legacy_setbsic) + vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) @@ -565,10 +546,6 @@ vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE); vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ", VTY_NEWLINE); - if (settsc_enabled) - vty_out(vty, " settsc%s", VTY_NEWLINE); - if (setbsic_enabled) - vty_out(vty, " setbsic%s", VTY_NEWLINE); } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -586,16 +563,14 @@ install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd); install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd); install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd); - install_element(BTS_NODE, &cfg_bts_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_setbsic_cmd); - install_element(BTS_NODE, &cfg_bts_no_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_no_setbsic_cmd); install_element(PHY_NODE, &cfg_phy_base_port_cmd); install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); + install_element(PHY_NODE, &cfg_phy_setbsic_cmd); + install_element(PHY_NODE, &cfg_phy_no_setbsic_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jun 24 16:48:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 24 Jun 2017 16:48:36 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove bogus extern global variable declarations Message-ID: Review at https://gerrit.osmocom.org/3045 TRX: Remove bogus extern global variable declarations Those global variable declarations for non-existing variables were introduced in 8a8d73a691c709403be4adbe8f2a7150b4d5998a, let's remove them again. The source / destination IP address is a parameter of the phy_link, and not a global variable. Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 --- M src/osmo-bts-trx/trx_if.h 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/3045/1 diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index ee24f71..076e35e 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *local_ip; -extern const char *remote_ip; struct trx_l1h; -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jun 25 10:28:48 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 25 Jun 2017 10:28:48 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: Clean/good AM_CFLAGS is a nice goal. @blobb: Does this interfere with how we will save artifacts with your scripts? -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 12:28:57 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 25 Jun 2017 12:28:57 +0000 Subject: osmo-bts[master]: TRX: Rename trx_if_data() -> trx_if_send_burst() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 12:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 25 Jun 2017 12:48:15 +0000 Subject: osmo-bts[master]: TRX: don't free l1h in trx_phy_inst_close() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 12:52:33 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 25 Jun 2017 12:52:33 +0000 Subject: osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 12:56:15 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 25 Jun 2017 12:56:15 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 13:42:56 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 25 Jun 2017 13:42:56 +0000 Subject: osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Patch Set 2: > let's say if osmo-gsm-tester at least doesn't get worse with this. Did you measured avarage clock jitter before and after this change? Does this change solve the problem with osmo-gsm-tester? -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 14:02:28 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 25 Jun 2017 14:02:28 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/2817/1//COMMIT_MSG Commit Message: Line 7: adding dmo support Not so critical, but it would be great to have a bit more information about the change and DMO in general here. https://gerrit.osmocom.org/#/c/2817/1/src/conv_enc_test.c File src/conv_enc_test.c: PS1, Line 53: void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv) : { : } Why this is empty? Could you please explain, writing a few words comment inside the body, if this function makes sense. Otherwise, it shouldn't be here. https://gerrit.osmocom.org/#/c/2817/1/src/lower_mac/tetra_scramb.c File src/lower_mac/tetra_scramb.c: PS1, Line 34: #define SCRAMB_INIT 3 : #define SCRAMB_ZERO 0 Both already defined in lower_mac/tetra_scramb.h, so we can clean them out. -- To view, visit https://gerrit.osmocom.org/2817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 25 18:36:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:36:30 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3030/1/tests/xua/xua_test.c File tests/xua/xua_test.c: Line 158: printf(" %s\n", osmo_hexdump_nospc((void*)gt_in, sizeof(struct osmo_sccp_gt))); > It should be casted to const unsigned char *: "void*" works just as well, it is accepted without a warning. It is, right? Have you seen a compiler complain? It's not like the content of gt_in is *really* an unsigned char, we just choose to interpret it so. All we pass to hexdump is a memory location and a length, so it kinda makes sense to use void* and its implicit cast. If you still disagree I'll change it. -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 25 18:47:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:47:12 +0000 Subject: libosmo-sccp[master]: add various debug logging to help figure out complex SCCP ro... In-Reply-To: References: Message-ID: Patch Set 1: (7 comments) This patch came to be as I was hacking around to quickly see which code paths are being taken, hence I didn't put much thought in the individual log statements. All the more thanks for the detailed review! Update coming up... https://gerrit.osmocom.org/#/c/3012/1//COMMIT_MSG Commit Message: Line 7: add various debug logging to help figure out complex SCCP routing > actually, I think we only implement MTP-level routing so far. I'll believe you right away, I don't know the landscape of acronyms in libosmo-sccp... https://gerrit.osmocom.org/#/c/3012/1/src/m3ua.c File src/m3ua.c: Line 562: "m3ua data hdr opc=%u dpc=%u\n", > I think the function name or some other indication should be given to indic technically that's above in line 539; but true https://gerrit.osmocom.org/#/c/3012/1/src/osmo_ss7.c File src/osmo_ss7.c: Line 745: DEBUGP(DLSS7, "Created route pc=%u mask=%u name=%s linkset %s\n", pc, mask, linkset_name, > route creation/removal is rather rare, and it could actually be propagated I like that, yes https://gerrit.osmocom.org/#/c/3012/1/src/osmo_ss7_hmrt.c File src/osmo_ss7_hmrt.c: Line 135: DEBUGP(DLSS7, "found route for dpc %u: %s pc=%u mask=%u %s:%s\n", dpc, > point-codes can be printing in a more meaningful representation than as uns interesting, so far I thought a PC *is* just an unsigned int. I'll take a look... Line 152: DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc %u\n", dpc); > if you want to print this, I think it should go one level up and print for ack Line 184: DEBUGP(DLSS7, "dpc %u is local\n", dpc); > again I think here it's useful to see the context, i.e. that we just receiv ack https://gerrit.osmocom.org/#/c/3012/1/src/sccp_scoc.c File src/sccp_scoc.c: PS1, Line 1547: c > could move into sccp_scoc_rx_inval_src_ref() and could be propagated from d ah sure -- To view, visit https://gerrit.osmocom.org/3012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Jun 25 18:49:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:49:21 +0000 Subject: [PATCH] libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* 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/2979 to look at the new patch set (#5). doxygen: gsm: do not exclude include/gsm/protocol/* Clear out the EXCLUDE tag to not exclude anything. Tried to add API doc to gsm/protocol/gsm_08_08.h and after a long time found out why they are not appearing in the API doc. The original reason to exclude these files was that we were not going to copy-paste descriptions from the 3GPP specs. Nevertheless, for an API doc reader it is helpful if all data structures are listed and linked. Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 --- M Doxyfile.gsm.in 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/2979/5 diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index dbb5df6..896765e 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -654,7 +654,7 @@ # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* -EXCLUDE_PATTERNS = */include/osmocom/gsm/protocol/* +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 -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 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 Sun Jun 25 18:49:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:49:55 +0000 Subject: libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 tweaked commit log... -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 25 18:49:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:49:58 +0000 Subject: [MERGED] libosmocore[master]: doxygen: gsm: do not exclude include/gsm/protocol/* In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doxygen: gsm: do not exclude include/gsm/protocol/* ...................................................................... doxygen: gsm: do not exclude include/gsm/protocol/* Clear out the EXCLUDE tag to not exclude anything. Tried to add API doc to gsm/protocol/gsm_08_08.h and after a long time found out why they are not appearing in the API doc. The original reason to exclude these files was that we were not going to copy-paste descriptions from the 3GPP specs. Nevertheless, for an API doc reader it is helpful if all data structures are listed and linked. Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 --- M Doxyfile.gsm.in 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/Doxyfile.gsm.in b/Doxyfile.gsm.in index dbb5df6..896765e 100644 --- a/Doxyfile.gsm.in +++ b/Doxyfile.gsm.in @@ -654,7 +654,7 @@ # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* -EXCLUDE_PATTERNS = */include/osmocom/gsm/protocol/* +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 -- To view, visit https://gerrit.osmocom.org/2979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib569a46f00866bdaa4017f803d85f625ae011316 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 Sun Jun 25 18:51:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:51:19 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 1: > It actually fails only for me because > I build with -Werror locally. Ah missed this comment. I'll cast precisely then. -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Sun Jun 25 18:54:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 18:54:04 +0000 Subject: [PATCH] libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type 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/3030 to look at the new patch set (#2). fix compiler warning: xua_test: hexdump pointer type Was recently introduced by a70b4599f63b50c4d654eb9e1b1a099a7c8cdc36. Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 --- M tests/xua/xua_test.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/30/3030/2 diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index 4af0836..c496cc4 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -155,7 +155,7 @@ printf("Testing Decoded GT -> SUA encoding\n"); printf("IN: %s\n", osmo_sccp_gt_dump(gt_in)); - printf(" %s\n", osmo_hexdump_nospc(gt_in, sizeof(struct osmo_sccp_gt))); + printf(" %s\n", osmo_hexdump_nospc((const unsigned char*)gt_in, sizeof(struct osmo_sccp_gt))); /* encode sccp_addr to SUA GT */ xua_part_add_gt(msg, gt_in); @@ -168,7 +168,7 @@ /* parse + compare */ sua_parse_gt(>_out, msgb_data(msg), msgb_length(msg)); printf("OUT:%s\n", osmo_sccp_gt_dump(>_out)); - printf(" %s\n", osmo_hexdump_nospc(>_out, sizeof(struct osmo_sccp_gt))); + printf(" %s\n", osmo_hexdump_nospc((const unsigned char*)>_out, sizeof(struct osmo_sccp_gt))); OSMO_ASSERT(!memcmp(gt_in, >_out, sizeof(gt_out))); msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Sun Jun 25 20:08:05 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 25 Jun 2017 20:08:05 +0000 Subject: osmo-bts[master]: Add loopback support for PDTCH In-Reply-To: References: Message-ID: Patch Set 4: > we transmit an empty (all-zero) frame of 23 bytes Why not dummy frame? Is this per some spec? -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Sun Jun 25 20:35:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 20:35:59 +0000 Subject: [PATCH] libosmo-sccp[master]: add/tweak various logging to help figure out complex routing In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3012 to look at the new patch set (#2). add/tweak various logging to help figure out complex routing Add function osmo_ss7_point_code_print2() to be able to print two point codes in the same log message. Change signatures of two static functions to aid logging: add invalid ref arg to sccp_scoc_rx_inval_src_ref(), pass conn instead of inst to sccp_scoc_rx_inval_opc(). Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd --- M include/osmocom/sigtran/osmo_ss7.h M src/m3ua.c M src/osmo_ss7.c M src/osmo_ss7_hmrt.c M src/sccp_scoc.c 5 files changed, 85 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/12/3012/2 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 4e04352..caf12f5 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -24,6 +24,7 @@ int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str); int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in); const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc); +const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc); /*********************************************************************** * SS7 Routing Tables diff --git a/src/m3ua.c b/src/m3ua.c index d96bd18..c43dfa4 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -536,18 +536,34 @@ struct m3ua_data_hdr *dh; struct osmo_ss7_as *as; - if (xua->hdr.msg_type != M3UA_XFER_DATA) + LOGPASP(asp, DLM3UA, LOGL_DEBUG, "m3ua_rx_xfer\n"); + + if (xua->hdr.msg_type != M3UA_XFER_DATA) { + LOGPASP(asp, DLM3UA, LOGL_ERROR, + "%s(): unsupported message type: %s\n", + __func__, + get_value_string(m3ua_xfer_msgt_names, xua->hdr.msg_type)); return M3UA_ERR_UNSUPP_MSG_TYPE; + } /* Use routing context IE to look up the AS for which the * message was received. */ as = osmo_ss7_as_find_by_rctx(asp->inst, rctx); - if (!as) + if (!as) { + LOGPASP(asp, DLM3UA, LOGL_ERROR, + "%s(): invalid routing context: %u\n", + __func__, rctx); return M3UA_ERR_INVAL_ROUT_CTX; + } - /* Verify that this ASP ix part of the AS. */ - if (!osmo_ss7_as_has_asp(as, asp)) + /* Verify that this ASP is part of the AS. */ + if (!osmo_ss7_as_has_asp(as, asp)) { + LOGPASP(asp, DLM3UA, LOGL_ERROR, + "%s(): This Application Server Process is not part of the AS resolved by" + " routing context %u\n", + __func__, rctx); return M3UA_ERR_NO_CONFGD_AS_FOR_ASP; + } /* FIXME: check for AS state == ACTIVE */ @@ -556,6 +572,10 @@ dh = data_hdr_from_m3ua(xua); OSMO_ASSERT(dh); m3ua_dh_to_xfer_param(&xua->mtp, dh); + LOGPASP(asp, DLM3UA, LOGL_DEBUG, + "%s(): M3UA data header: opc=%u=%s dpc=%u=%s\n", + __func__, xua->mtp.opc, osmo_ss7_pointcode_print(asp->inst, xua->mtp.opc), + xua->mtp.dpc, osmo_ss7_pointcode_print2(asp->inst, xua->mtp.dpc)); /* remove ROUTE_CTX as in the routing case we want to add a new * routing context on the outbound side */ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 9477543..c13c588 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -245,22 +245,36 @@ return -EINVAL; } -/* print a pointcode according to the structure configured for this - * ss7_instance */ -const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc) +const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc) { - static char buf[MAX_PC_STR_LEN]; const struct osmo_ss7_pc_fmt *pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; unsigned int num_comp_exp = num_pc_comp_exp(pc_fmt); const char *fmtstr = gen_pc_fmtstr(pc_fmt, &num_comp_exp); OSMO_ASSERT(fmtstr); - snprintf(buf, sizeof(buf), fmtstr, + snprintf(buf, len, fmtstr, pc_comp_shift_and_mask(pc_fmt, 0, pc), pc_comp_shift_and_mask(pc_fmt, 1, pc), pc_comp_shift_and_mask(pc_fmt, 2, pc)); return buf; +} + + +/* print a pointcode according to the structure configured for this + * ss7_instance */ +const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc) +{ + static char buf[MAX_PC_STR_LEN]; + return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); +} + +/* same as osmo_ss7_pointcode_print() but using a separate buffer, useful for multiple point codes in the + * same LOGP/printf. */ +const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc) +{ + static char buf[MAX_PC_STR_LEN]; + return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); } int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in) @@ -740,10 +754,15 @@ rt->cfg.pc = pc; rt->cfg.mask = mask; rt->cfg.linkset_name = talloc_strdup(rt, linkset_name); - if (lset) + if (lset) { rt->dest.linkset = lset; - else + LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via linkset '%s'\n", + pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, lset->cfg.name); + } else { rt->dest.as = as; + LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via AS '%s'\n", + pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, as->cfg.name); + } rt->rtable = rtbl; route_insert_sorted(rtbl, rt); diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c index e66762d..8165a36 100644 --- a/src/osmo_ss7_hmrt.c +++ b/src/osmo_ss7_hmrt.c @@ -138,20 +138,33 @@ /* FIXME: Transmit over respective Link */ if (rt->dest.as) { struct osmo_ss7_as *as = rt->dest.as; + DEBUGP(DLSS7, + "Found route for dpc=%u=%s: pc=%u=%s mask=0x%x" + " via AS %s proto=%s\n", + dpc, osmo_ss7_pointcode_print(inst, dpc), + rt->cfg.pc, osmo_ss7_pointcode_print2(inst, rt->cfg.pc), rt->cfg.mask, + as->cfg.name, osmo_ss7_asp_protocol_name(as->cfg.proto)); + switch (as->cfg.proto) { case OSMO_SS7_ASP_PROT_M3UA: + DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc=%u=%s\n", + dpc, osmo_ss7_pointcode_print(inst, dpc)); return m3ua_tx_xua_as(as,xua); case OSMO_SS7_ASP_PROT_IPA: return ipa_tx_xua_as(as, xua); default: LOGP(DLSS7, LOGL_ERROR, "MTP message " - "for ASP of unknown protocol%u\n", + "for ASP of unknown protocol %u\n", as->cfg.proto); break; } } else if (rt->dest.linkset) { - LOGP(DLSS7, LOGL_ERROR, "MTP-TRANSFER.req for linkset" - "%s unsupported\n",rt->dest.linkset->cfg.name); + LOGP(DLSS7, LOGL_ERROR, + "Found route for dpc=%u=%s: pc=%u=%s mask=0x%x" + " via linkset %s, but MTP-TRANSFER.req unsupported for linkset.\n", + dpc, osmo_ss7_pointcode_print(inst, dpc), + rt->cfg.pc, osmo_ss7_pointcode_print2(inst, rt->cfg.pc), rt->cfg.mask, + rt->dest.linkset->cfg.name); } else OSMO_ASSERT(0); } else { @@ -171,8 +184,12 @@ { uint32_t dpc = xua->mtp.dpc; if (osmo_ss7_pc_is_local(inst, dpc)) { + DEBUGP(DLSS7, "%s(): found dpc=%u=%s as local\n", __func__, + dpc, osmo_ss7_pointcode_print(inst, dpc)); return hmdt_message_for_distribution(inst, xua); } else { + DEBUGP(DLSS7, "%s(): dpc=%u=%s not local, message is for routing\n", __func__, + dpc, osmo_ss7_pointcode_print(inst, dpc)); return hmrt_message_for_routing(inst, xua); } } diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index fbb6ef8..9502953 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1436,8 +1436,13 @@ /* process received message for invalid source local reference */ static void sccp_scoc_rx_inval_src_ref(struct sccp_connection *conn, - struct xua_msg *xua) + struct xua_msg *xua, + uint32_t inval_src_ref) { + LOGP(DLSCCP, LOGL_NOTICE, + "Received message for source ref %u on conn with mismatching remote ref %u\n", + inval_src_ref, conn->remote_ref); + /* we have received a message with invalid source local * reference and thus apply the action indicated in Table * B.2/Q.714 */ @@ -1463,9 +1468,13 @@ } /* process received message for invalid origin point code */ -static void sccp_scoc_rx_inval_opc(struct osmo_sccp_instance *inst, +static void sccp_scoc_rx_inval_opc(struct sccp_connection *conn, struct xua_msg *xua) { + LOGP(DLSCCP, LOGL_NOTICE, + "Received message for opc=%u=%s on conn with mismatching remote pc=%u=%s\n", + xua->mtp.opc, osmo_ss7_pointcode_print(conn->inst->ss7, xua->mtp.opc), + conn->remote_pc, osmo_ss7_pointcode_print2(conn->inst->ss7, conn->remote_pc)); /* we have received a message with invalid origin PC and thus * apply the action indiacted in Table B.2/Q.714 */ switch (xua->hdr.msg_type) { @@ -1473,7 +1482,7 @@ case SUA_CO_RESRE: /* RSR */ case SUA_CO_RESCO: /* RSC */ /* Send ERR */ - tx_coerr_from_xua(inst, xua, SCCP_ERROR_POINT_CODE_MISMATCH); + tx_coerr_from_xua(conn->inst, xua, SCCP_ERROR_POINT_CODE_MISMATCH); break; case SUA_CO_RELCO: /* RLC */ case SUA_CO_CODT: /* DT1 */ @@ -1544,14 +1553,14 @@ * the one we saved in local state */ src_loc_ref = xua_msg_get_u32(xua, SUA_IEI_SRC_REF); if (src_loc_ref != conn->remote_ref) { - sccp_scoc_rx_inval_src_ref(conn, xua); + sccp_scoc_rx_inval_src_ref(conn, xua, src_loc_ref); return; } } /* Check if received OPC != the remote_pc we stored locally */ if (xua->mtp.opc != conn->remote_pc) { - sccp_scoc_rx_inval_opc(inst, xua); + sccp_scoc_rx_inval_opc(conn, xua); return; } } -- To view, visit https://gerrit.osmocom.org/3012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Sun Jun 25 20:35:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 25 Jun 2017 20:35:59 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_user.c: add missing error logging 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/3014 to look at the new patch set (#2). sccp_user.c: add missing error logging Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c --- M src/sccp_user.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/14/3014/2 diff --git a/src/sccp_user.c b/src/sccp_user.c index 5f89f71..93b03f6 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -74,11 +74,17 @@ if (!pc_valid) pc = 0; - if (sccp_user_find(inst, ssn, pc)) + scu = sccp_user_find(inst, ssn, pc); + if (scu) { + LOGP(DLSCCP, LOGL_ERROR, + "Cannot bind user '%s' to SSN=%u PC=%u=%s (pc_valid=%u), this SSN and PC" + " is already bound by '%s'\n", + name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid, scu->name); return NULL; + } - LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u (pc_valid=%u)\n", - name, ssn, pc, pc_valid); + LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u=%s (pc_valid=%u)\n", + name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid); scu = talloc_zero(inst, struct osmo_sccp_user); scu->name = talloc_strdup(scu, name); @@ -247,8 +253,10 @@ /* allocate + initialize SS7 instance */ ss7 = osmo_ss7_instance_find_or_create(ctx, 1); - if (!ss7) + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; + } ss7->cfg.primary_pc = pc; as_name = talloc_asprintf(ctx, "as-clnt-%s", name); -- To view, visit https://gerrit.osmocom.org/3014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c 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 Mon Jun 26 02:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 26 Jun 2017 02:54:40 +0000 Subject: [PATCH] libosmo-sccp[master]: Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == Callin... Message-ID: Review at https://gerrit.osmocom.org/3046 Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == CallingPartyAddress" This reverts commit 5527df78adc08b76df07c4b682263b5bdd6181d4. I tried some time to figure out what other changes are needed to make this commit work and fix a confusion, until I noticed: The commit's *log message* is correct that SRC == calling, but the *patch* modifies callED addr to be the SRC, which is wrong. So reverting this commit is indeed the correct way to fix our addresses. Change-Id: Ic76aacc81f87f8885fe04121aead5c79a761ef07 --- M src/sccp_scoc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/46/3046/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index fbb6ef8..5e91ea4 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -483,7 +483,7 @@ xua_msg_add_u32(xua, SUA_IEI_ROUTE_CTX, conn->inst->route_ctx); xua_msg_add_u32(xua, SUA_IEI_PROTO_CLASS, conn->sccp_class); xua_msg_add_u32(xua, SUA_IEI_SRC_REF, conn->conn_id); - xua_msg_add_sccp_addr(xua, SUA_IEI_SRC_ADDR, &conn->called_addr); + xua_msg_add_sccp_addr(xua, SUA_IEI_DEST_ADDR, &conn->called_addr); xua_msg_add_u32(xua, SUA_IEI_SEQ_CTRL, 0); /* TODO */ /* optional: sequence number (class 3 only) */ if (conn->calling_addr.presence) -- To view, visit https://gerrit.osmocom.org/3046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic76aacc81f87f8885fe04121aead5c79a761ef07 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 26 08:33:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 08:33:24 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 26 08:35:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 08:35:33 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 2: > > It actually fails only for me because > > I build with -Werror locally. > > Ah missed this comment. I'll cast precisely then. I didn't mean here that it fails if you use void* instead of char*, I wanted to precise that build was failing for me if you didn't cast to pointer (void* or char*) because I was using -Werror locally. Still, I think it's a good idea to use the same pointer type for the cast instead of using void* -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 26 09:28:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 09:28:04 +0000 Subject: [PATCH] osmo-bts[master]: RSL: receive and send multiple SI2q messages Message-ID: Review at https://gerrit.osmocom.org/3047 RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Related: OS#1660, OS#2338 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 41 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/3047/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index eab9379..fa49071 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -307,21 +307,34 @@ } if (SYSINFO_TYPE_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > SI2Q_MAX_NUM) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn impossible parameters: index %u, count %u" + "should be <= %u\n", bts->si2q_index, bts->si2q_count, SI2Q_MAX_NUM); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + 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 if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 26 09:29:49 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 09:29:49 +0000 Subject: [PATCH] libosmocore[master]: utils: add function gsm_print_fn2gsmtime() Message-ID: Review at https://gerrit.osmocom.org/3048 utils: add function gsm_print_fn2gsmtime() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3048/1 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..1c07b9b 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_print_fn2gsmtime(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..cbff71b 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -749,6 +749,21 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_print_fn2gsmtime(uint32_t fn) +{ + static char result[256]; + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + snprintf(result, sizeof(result), "%02u/%02u/%02u/%02u/", time.t1, time.t2, + time.t3, time.tc); + + return result; +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..9669067 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_print_fn2gsmtime; gsm_get_octet_len; gsm_gsmtime2fn; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 09:37:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 09:37:23 +0000 Subject: libosmocore[master]: utils: add function gsm_print_fn2gsmtime() In-Reply-To: References: Message-ID: Patch Set 1: The name is kinda confusing to me: smth like gsm_fn_as_gsmtime_str() would be better. Also, depending on the way you plan to use it might make sense to "print" FN as well. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 1 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 Mon Jun 26 09:43:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 09:43:02 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Shall I abandon this or +1 x 3 outweight Harald's -1? -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 09:44:23 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 09:44:23 +0000 Subject: [PATCH] libosmocore[master]: utils: add function gsm_print_fn2gsmtime() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3048 to look at the new patch set (#2). utils: add function gsm_print_fn2gsmtime() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3048/2 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..1c07b9b 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_print_fn2gsmtime(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..d6cc317 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -749,6 +749,21 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_print_fn2gsmtime(uint32_t fn) +{ + static char result[256]; + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + snprintf(result, sizeof(result), "%02u/%02u/%02u/%02u", time.t1, time.t2, + time.t3, time.tc); + + return result; +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..9669067 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_print_fn2gsmtime; gsm_get_octet_len; gsm_gsmtime2fn; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 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 Mon Jun 26 09:45:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 09:45:15 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 09:52:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 09:52:34 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3008 to look at the new patch set (#2). Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- 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, 28 insertions(+), 77 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/2 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..8bf629a 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -17,24 +17,9 @@ cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build "osmo-bts-trx" $configure_flags diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..d81817d 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -22,3 +22,21 @@ cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build() { + set +x + echo + echo "$2" + echo + echo " =============================== $1 ===============================" + echo + set -x + + autoreconf --install --force + ./configure "$2 --with-openbsc=$deps/openbsc/openbsc/include" + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS="$2 --with-openbsc=$deps/openbsc/openbsc/include" $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..420d8d2 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -14,16 +14,6 @@ osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build "osmo-bts-lc15" $configure_flags diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..0bb0406 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -14,19 +14,6 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build "osmo-bts-octphy" $configure_flags diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..44fbaf0 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -19,26 +19,11 @@ cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build "osmo-bts-octphy+trx" $configure_flags diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..7cd8572 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,22 +16,8 @@ ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x - -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +configure_flags="--enable-sysmocom-bts" +build "osmo-bts-sysmo" $configure_flags # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 26 09:57:48 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 09:57:48 +0000 Subject: [PATCH] libosmocore[master]: utils: add function gsm_print_fn2gsmtime() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3048 to look at the new patch set (#3). utils: add function gsm_print_fn2gsmtime() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3048/3 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..b218331 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..7da02f7 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -749,6 +749,21 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn) +{ + static char result[256]; + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + snprintf(result, sizeof(result), "%02u/%02u/%02u/%02u", time.t1, time.t2, + time.t3, time.tc); + + return result; +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..29e023c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_fn_as_gsmtime_str; gsm_get_octet_len; gsm_gsmtime2fn; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 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 Mon Jun 26 09:59:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 09:59:15 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3008 to look at the new patch set (#4). Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- 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, 28 insertions(+), 77 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/4 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..bf62532 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -17,24 +17,9 @@ cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build "osmo-bts-trx" $configure_flags "$deps" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..a033415 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -22,3 +22,21 @@ cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" "DEPENDENCIES_DIR_PATH" +build() { + set +x + echo + echo "$2" + echo + echo " =============================== $1 ===============================" + echo + set -x + + autoreconf --install --force + ./configure "$2 --with-openbsc=$3/openbsc/openbsc/include" + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS="$2 --with-openbsc=$deps/openbsc/openbsc/include" $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..2157f4a 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -14,16 +14,6 @@ osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build "osmo-bts-lc15" $configure_flags "$deps" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..ea589ba 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -14,19 +14,6 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build "osmo-bts-octphy" $configure_flags "$deps" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..601e850 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -19,26 +19,11 @@ cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build "osmo-bts-octphy+trx" $configure_flags "$deps" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..1fe3e8e 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,22 +16,8 @@ ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x - -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +configure_flags="--enable-sysmocom-bts" +build "osmo-bts-sysmo" $configure_flags "$deps" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:02:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 10:02:17 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 This patch was reverted due issues with osmo-bts-trx. Can you please state in the commit description what was changed since original submission? -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:07:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 10:07:31 +0000 Subject: [PATCH] osmo-bts[master]: RSL: receive and send multiple SI2q messages 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/3047 to look at the new patch set (#2). RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way That's resubmission of 340cff51f49f6e798cb5fb6d1b9febdd09902906 and 186c6bac0758b6f94aa101e151664b0dea5d8975 with memory initialization order change to fix the issue detected by osmo-gsm-tester - see OS#2338. Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Related: OS#1660, OS#2338 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 41 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/3047/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index eab9379..fa49071 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -307,21 +307,34 @@ } if (SYSINFO_TYPE_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > SI2Q_MAX_NUM) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn impossible parameters: index %u, count %u" + "should be <= %u\n", bts->si2q_index, bts->si2q_count, SI2Q_MAX_NUM); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + 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 if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:12:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 10:12:23 +0000 Subject: [PATCH] osmo-pcu[master]: Remove comment warning Message-ID: Review at https://gerrit.osmocom.org/3049 Remove comment warning It's unclear why the warning was placed next to commented log statement to begin with, so let's just follow that warning's advice and drop it. Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae --- M src/pcu_l1_if.cpp 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/49/3049/1 diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index c16ac0c..c2c6cc6 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -549,9 +549,8 @@ /* omit frame numbers not starting at a MAC block */ if (fn13 != 0 && fn13 != 4 && fn13 != 8) return 0; -#warning uncomment -// LOGP(DL1IF, LOGL_DEBUG, "Time indication received: %d\n", -// time_ind->fn % 52); + + LOGP(DL1IF, LOGL_DEBUG, "Time indication received: %d\n", time_ind->fn % 52); BTS::main_bts()->set_current_frame_number(time_ind->fn); return 0; -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:18:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 10:18:33 +0000 Subject: osmo-pcu[master]: Remove comment warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Test dummy for lc15 jenkins changes. -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jun 26 10:32:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 10:32:06 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: This seems to be the diff with the original commits which were reverted [end of comment]. If I understand correctly after looking at the diff, it seems the issue was there because bts->si_buf[osmo_si] was not memset in case SYSINFO_TYPE_2quater == osmo_si was true? I still think you should explain in the commit description the issue details and what does this new version exactly do to fix the issue, because it's difficult to see with a plain diff because it was reverted. diff --git a/src/common/rsl.c b/src/common/rsl.c index 187a2e7..fa49071 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -292,9 +292,21 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) 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; + } - switch (osmo_si) { - case SYSINFO_TYPE_2quater: + if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; bv.data_len = GSM_MACBLOCK_LEN; @@ -323,18 +335,6 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) 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); - break; - case SYSINFO_TYPE_3: - if (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; - } /* intentional fall-through to copy SI3 data */ - default: - 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); - LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n", - get_value_string(osmo_sitype_strs, osmo_si), len); } -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:34:00 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 26 Jun 2017 10:34:00 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:34:54 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 26 Jun 2017 10:34:54 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: > Shall I abandon this or +1 x 3 outweight Harald's -1? Let's wait for the final response from Harald. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:36:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 10:36:26 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 Yepp, he's the boss. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:41:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 10:41:34 +0000 Subject: osmo-bts[master]: Add loopback support for PDTCH In-Reply-To: References: Message-ID: Patch Set 4: > > we transmit an empty (all-zero) frame of 23 bytes > > Why not dummy frame? Is this per some spec? The BTS tester devices like CMU-300 specifically state that they expect an all-zero-bit block to detect CRC failures in the uplink decoding happened at the BTS. -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Jun 26 10:49:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 10:49:35 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: I can't explain it properly because I do not understand why memory initialization issue affects osmo-bts-trx but not the others. I think the issue in reverted commit was with the SI3 memory initialized when it shouldn't be but it's just a guess. -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:51:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 10:51:15 +0000 Subject: osmo-pcu[master]: Remove comment warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Jenkins changes tested successfully - feel free to merge if it's OK. -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jun 26 10:55:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 10:55:16 +0000 Subject: osmo-pcu[master]: Remove comment warning In-Reply-To: References: Message-ID: Patch Set 1: I guess the best here is to use git blame and add the author of those lines here as a reviewer, he may be able to explain a bit better his intentions when doing that. -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:56:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 10:56:51 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 10:57:21 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 10:57:21 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: Let's pay attention once we merge this to see how osmo-gsm-tester behaves. -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 11:18:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 11:18:17 +0000 Subject: [MERGED] osmo-bts[master]: Add missing include for abis.h header file In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add missing include for abis.h header file ...................................................................... Add missing include for abis.h header file This fixes compilation warning: implicit declaration of function ?abis_bts_rsl_sendmsg? Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 0ab84e5..1fb6134 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/3003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129 Gerrit-PatchSet: 4 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 Mon Jun 26 11:31:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 11:31:16 +0000 Subject: osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3037/2/src/osmo-bts-trx/scheduler_trx.c File src/osmo-bts-trx/scheduler_trx.c: Line 1473: if (elapsed_fn >= 135774) where does this number comes from? -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:28:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 12:28:21 +0000 Subject: [PATCH] osmo-bts[master]: Revert "sysmobts: normalize frame number in measurement indi... Message-ID: Review at https://gerrit.osmocom.org/3050 Revert "sysmobts: normalize frame number in measurement indication" This reverts commit 88b2cc30a6a7253c2c4c76178e5727fad48556ca. Change-Id: I30f37a9feef24a45e254377502615d717dba9765 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 2 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/3050/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f564836..837fc5c 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,14 +897,12 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_PhDataInd_t *data_ind) + uint32_t fn, GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_INDICATION, NULL); - GsmL1_MeasParam_t *m = &data_ind->measParam; - l1sap.u.info.type = PRIM_INFO_MEAS; l1sap.u.info.u.meas_ind.chan_nr = chan_nr; l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; @@ -915,12 +913,6 @@ * physical radio link, the uplink is delayed by 3 timeslots, we need * to compensate for that delay. */ l1sap.u.info.u.meas_ind.fn = fn + 3; - - /* Align frame number with measurement period ends */ - if (data_ind->sapi == GsmL1_Sapi_TchF) - l1sap.u.info.u.meas_ind.fn += 1; - else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == GsmL1_SubCh_0) - l1sap.u.info.u.meas_ind.fn += 1; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -949,7 +941,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, data_ind); + process_meas_res(trx, chan_nr, fn, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/3050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30f37a9feef24a45e254377502615d717dba9765 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:28:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 12:28:21 +0000 Subject: [PATCH] osmo-bts[master]: Revert "osmo-bts-sysmo: Include frame number in MEAS IND" Message-ID: Review at https://gerrit.osmocom.org/3051 Revert "osmo-bts-sysmo: Include frame number in MEAS IND" This reverts commit 3f97e4b1fcdc788345ab7740bd4fb8a3d73f5526. Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/3051/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 837fc5c..05805b8 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,7 +897,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_MeasParam_t *m) + GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -908,11 +908,6 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); - - /* The MEAS IND data structure expects a logical frame number. On the - * physical radio link, the uplink is delayed by 3 timeslots, we need - * to compensate for that delay. */ - l1sap.u.info.u.meas_ind.fn = fn + 3; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +936,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, &data_ind->measParam); + process_meas_res(trx, chan_nr, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/3051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:28:22 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 12:28:22 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-sysmo: Include frame number in MEAS IND Message-ID: Review at https://gerrit.osmocom.org/3052 osmo-bts-sysmo: Include frame number in MEAS IND l1_if.c does not generate struct osmo_phsap_prim l1sap properly. The frame number is not included in this struct. This renders the logic that processes the reported measurements non functional, since the logic (see measurement.c) is not able to detect the end of the measurement period. This commit fixes the problem by adding the missing frame number to the l1sap structure. Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/3052/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 05805b8..9ce9033 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,7 +897,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + uint32_t fn, GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -908,6 +908,7 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + l1sap.u.info.u.meas_ind.fn = fn; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -936,7 +937,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, fn, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/3052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:28:22 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 12:28:22 +0000 Subject: [PATCH] osmo-bts[master]: measurement: fix measurment report Message-ID: Review at https://gerrit.osmocom.org/3053 measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/meas_test.c A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 6 files changed, 2,893 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3053/1 diff --git a/configure.ac b/configure.ac index b848605..58c0e8b 100644 --- a/configure.ac +++ b/configure.ac @@ -188,4 +188,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index 6050001..edee549 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..9e37739 --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,219 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + fprintf(stderr, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, gsm_fn_as_gsmtime_str(s[i].fn), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:30:09 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 12:30:09 +0000 Subject: [PATCH] osmo-bts[master]: measurement: fix measurment report In-Reply-To: References: Message-ID: measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. This commit depends on libosmocore change: Change-Id I8015d2ded3940b01b35df7b72fc35c70c25e9926 Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/meas_test.c A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 6 files changed, 2,893 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3053/2 diff --git a/configure.ac b/configure.ac index b848605..58c0e8b 100644 --- a/configure.ac +++ b/configure.ac @@ -188,4 +188,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index 6050001..edee549 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..9e37739 --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,219 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + fprintf(stderr, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, gsm_fn_as_gsmtime_str(s[i].fn), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:40:28 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 12:40:28 +0000 Subject: [PATCH] osmo-bts[master]: measurement: fix measurment report In-Reply-To: References: Message-ID: measurement: fix measurment report The end of the measurement reporting period is not aligned with the SACCH block where the results are reported. The tables that are used to detect the end of the measurement period are therefore wrong. The frame number of the SACCH block must be used and not the TDMA frame number (modulo 104) of the measurement reporing interval. The tables are oriented to the frame number of the first SACCH block, at the beginning of an interval. However, when a SACCH block is received it will always contain the result of the recently passed measurement reporting period. To match the tables, introduce another lookup table to remap each SACCH block that ends to the matching beginning block number. This commit depends on libosmocore change: Change-Id I8015d2ded3940b01b35df7b72fc35c70c25e9926 Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 --- M configure.ac M src/common/measurement.c M tests/Makefile.am A tests/meas/meas_test.c A tests/meas/meas_test.ok A tests/meas/sysmobts_fr_samples.h M tests/testsuite.at 7 files changed, 3,435 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/3053/3 diff --git a/configure.ac b/configure.ac index b848605..58c0e8b 100644 --- a/configure.ac +++ b/configure.ac @@ -188,4 +188,5 @@ tests/misc/Makefile tests/handover/Makefile tests/tx_power/Makefile + tests/meas/Makefile Makefile) diff --git a/src/common/measurement.c b/src/common/measurement.c index 6050001..edee549 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -23,18 +23,27 @@ * 6 6 and 7 78 to 77 90, 12, 38, 64 * 7 6 and 7 91 to 90 103, 25, 51, 77 */ -/* measurement period ends at fn % 104 == ? */ static const uint8_t tchf_meas_rep_fn104[] = { - [0] = 103, - [1] = 12, - [2] = 25, - [3] = 38, - [4] = 51, - [5] = 64, - [6] = 77, - [7] = 90, + [0] = 90, + [1] = 103, + [2] = 12, + [3] = 25, + [4] = 38, + [5] = 51, + [6] = 64, + [7] = 77, }; static const uint8_t tchh0_meas_rep_fn104[] = { + [0] = 90, + [1] = 90, + [2] = 12, + [3] = 12, + [4] = 38, + [5] = 38, + [6] = 64, + [7] = 64, +}; +static const uint8_t tchh1_meas_rep_fn104[] = { [0] = 103, [1] = 103, [2] = 25, @@ -43,16 +52,6 @@ [5] = 51, [6] = 77, [7] = 77, -}; -static const uint8_t tchh1_meas_rep_fn104[] = { - [0] = 12, - [1] = 12, - [2] = 38, - [3] = 38, - [4] = 64, - [5] = 64, - [6] = 90, - [7] = 90, }; /* Measurment reporting period for SDCCH8 and SDCCH4 chan @@ -86,6 +85,46 @@ [3] = 36 + 18 }; +/* Note: The reporting of the measurement results is done via the SACCH channel. + * The measurement interval is not alligned with the interval in which the + * SACCH is tranmitted. When we receive the measurement indication with the + * SACCH block, the coresponding measurement interval will already have ended + * and we will get the results late, but on spot with the beginning of the + * next measurement interval. + * + * For example: We get a measurement indication on FN%104=38 in TS=2. Then we + * will have to look at 3GPP TS 45.008, secton 8.4.1 (or 3GPP TS 05.02 Clause 7 + * Table 1 of 9) what value we need to feed into the lookup tables in order to + * detect the measurement period ending. In this example the "real" ending + * was on FN%104=12. This is the value we have to look for in + * tchf_meas_rep_fn104 to know that a measurement period has just ended. */ + +/* See also 3GPP TS 05.02 Clause 7 Table 1 of 9: + * Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5) */ +static uint8_t translate_tch_meas_rep_fn104(uint8_t fn_mod) +{ + switch (fn_mod) { + case 25: + return 103; + case 38: + return 12; + case 51: + return 25; + case 64: + return 38; + case 77: + return 51; + case 90: + return 64; + case 103: + return 77; + case 12: + return 90; + } + + /* Invalid / not of interest */ + return 0; +} /* determine if a measurement period ends at the given frame number */ static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) @@ -102,12 +141,12 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: - fn_mod = fn % 104; + fn_mod = translate_tch_meas_rep_fn104(fn % 104); if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else @@ -132,9 +171,11 @@ break; } - DEBUGP(DMEAS, - "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", - gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + if (rc == 1) { + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + } return rc; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 5b6f65e..d2b4181 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = paging cipher agch misc handover tx_power +SUBDIRS = paging cipher agch misc handover tx_power meas if ENABLE_SYSMOBTS SUBDIRS += sysmobts diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c new file mode 100644 index 0000000..3cdb53b --- /dev/null +++ b/tests/meas/meas_test.c @@ -0,0 +1,219 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct gsm_bts *bts; +struct gsm_bts_trx *trx; + +struct fn_sample { + uint32_t fn; + uint8_t ts; + uint8_t ss; + int rc; +}; + +#include "sysmobts_fr_samples.h" + +void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap) +{ + int rc; + struct gsm_lchan *lchan; + unsigned int i; + unsigned int delta = 0; + uint8_t tsmap_result = 0; + uint32_t fn_prev = 0; + + printf("\n\n"); + printf("===========================================================\n"); + + for (i = 0; i < len; i++) { + + lchan = &trx->ts[s[i].ts].lchan[s[i].ss]; + trx->ts[s[i].ts].pchan = pchan; + lchan->meas.num_ul_meas = 1; + + rc = lchan_meas_check_compute(lchan, s[i].fn); + if (rc) { + fprintf(stdout, "Testing: ts[%i]->lchan[%i], fn=%u=>%s, fn%%104=%u, rc=%i, delta=%i\n", s[i].ts, + s[i].ss, s[i].fn, gsm_fn_as_gsmtime_str(s[i].fn), s[i].fn % 104, rc, s[i].fn - fn_prev); + fn_prev = s[i].fn; + tsmap_result |= (1 << s[i].ts); + } else + delta++; + + /* If the test data set provides a return + * code, we check that as well */ + if (s[i].rc != -1) + OSMO_ASSERT(s[i].rc == rc); + } + + /* Make sure that we exactly trigger on the right frames + * timeslots must match exactlty to what we expect */ + OSMO_ASSERT(tsmap_result == tsmap); +} + +int main(int argc, char **argv) +{ + void *tall_bts_ctx; + + tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); + msgb_talloc_ctx_init(tall_bts_ctx, 0); + + bts_log_init(NULL); + osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; + + bts = gsm_bts_alloc(tall_bts_ctx); + if (!bts) { + fprintf(stderr, "Failed to create BTS structure\n"); + exit(1); + } + trx = gsm_bts_trx_alloc(bts); + if (!trx) { + fprintf(stderr, "Failed to TRX structure\n"); + exit(1); + } + + if (bts_init(bts) < 0) { + fprintf(stderr, "unable to to open bts\n"); + exit(1); + } + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test full rate */ + test_fn_sample(test_fn_tch_f_ts_2_3, ARRAY_SIZE(test_fn_tch_f_ts_2_3), GSM_PCHAN_TCH_F, (1 << 2) | (1 << 3)); + test_fn_sample(test_fn_tch_f_ts_4_5, ARRAY_SIZE(test_fn_tch_f_ts_4_5), GSM_PCHAN_TCH_F, (1 << 4) | (1 << 5)); + test_fn_sample(test_fn_tch_f_ts_6_7, ARRAY_SIZE(test_fn_tch_f_ts_6_7), GSM_PCHAN_TCH_F, (1 << 6) | (1 << 7)); + + printf("\n"); + printf("***********************\n"); + printf("*** FULL RATE TESTS ***\n"); + printf("***********************\n"); + + /* Test half rate */ + test_fn_sample(test_fn_tch_h_ts_2_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_2_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 2)); + test_fn_sample(test_fn_tch_h_ts_3_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_3_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 3)); + test_fn_sample(test_fn_tch_h_ts_4_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_4_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 4)); + test_fn_sample(test_fn_tch_h_ts_5_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_5_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 5)); + test_fn_sample(test_fn_tch_h_ts_6_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_6_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 6)); + test_fn_sample(test_fn_tch_h_ts_7_ss0_ss1, ARRAY_SIZE(test_fn_tch_h_ts_7_ss0_ss1), GSM_PCHAN_TCH_H, (1 << 7)); + + printf("Success\n"); + + return 0; +} + +/* Stubs */ +void bts_model_abis_close(struct gsm_bts *bts) +{ +} + +int bts_model_oml_estab(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) +{ + return 0; +} + +int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type, struct tlv_parsed *old_attr, struct tlv_parsed *new_attr, + void *obj) +{ + return 0; +} + +int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int obj_kind, void *obj) +{ + return 0; +} + +int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) +{ + return 0; +} + +int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj, uint8_t adm_state) +{ + return 0; +} + +int bts_model_init(struct gsm_bts *bts) +{ + return 0; +} + +int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) +{ + return 0; +} + +int bts_model_trx_close(struct gsm_bts_trx *trx) +{ + return 0; +} + +void trx_get_hlayer1(void) +{ +} + +int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return 0; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) +{ + return 0; +} + +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + return 0; +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + return 0; +} diff --git a/tests/meas/meas_test.ok b/tests/meas/meas_test.ok new file mode 100644 index 0000000..3eba2b7 --- /dev/null +++ b/tests/meas/meas_test.ok @@ -0,0 +1,542 @@ + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=10958=>08/12/44/06, fn%104=38, rc=1, delta=10958 +Testing: ts[2]->lchan[0], fn=11062=>08/12/46/00, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11166=>08/12/48/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11270=>08/12/50/04, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11374=>08/12/01/07, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=11478=>08/12/03/01, fn%104=38, rc=1, delta=104 +Testing: ts[3]->lchan[0], fn=11491=>08/25/16/01, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>08/12/05/03, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11595=>08/25/18/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11686=>08/12/07/05, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11699=>08/25/20/05, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11790=>08/12/09/07, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11803=>08/25/22/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11894=>08/12/11/01, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=11907=>08/25/24/01, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11998=>09/12/13/03, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12011=>09/25/26/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12102=>09/12/15/05, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12115=>09/25/28/05, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12206=>09/12/17/07, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12219=>09/25/30/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12310=>09/12/19/01, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12323=>09/25/32/01, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12414=>09/12/21/03, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12427=>09/25/34/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12518=>09/12/23/05, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12531=>09/25/36/05, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=12622=>09/12/25/07, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[0], fn=12635=>09/25/38/07, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=5888=>04/12/23/03, fn%104=64, rc=1, delta=5888 +Testing: ts[4]->lchan[0], fn=5992=>04/12/25/05, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6096=>04/12/27/07, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=6200=>04/12/29/01, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=6213=>04/25/42/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6304=>04/12/31/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6317=>04/25/44/03, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6408=>04/12/33/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6421=>04/25/46/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6512=>04/12/35/07, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6525=>04/25/48/07, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6616=>04/12/37/01, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6629=>04/25/50/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6720=>05/12/39/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6733=>05/25/01/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6824=>05/12/41/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6837=>05/25/03/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=6928=>05/12/43/07, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=6941=>05/25/05/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7032=>05/12/45/01, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7045=>05/25/07/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7136=>05/12/47/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7149=>05/25/09/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7240=>05/12/49/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7253=>05/25/11/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7344=>05/12/00/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7357=>05/25/13/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7448=>05/12/02/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7461=>05/25/15/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7552=>05/12/04/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7565=>05/25/17/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7656=>05/12/06/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7669=>05/25/19/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7760=>05/12/08/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7773=>05/25/21/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7864=>05/12/10/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7877=>05/25/23/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=7968=>06/12/12/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=7981=>06/25/25/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8072=>06/12/14/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8085=>06/25/27/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8176=>06/12/16/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8189=>06/25/29/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>06/12/18/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8293=>06/25/31/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>06/12/20/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8397=>06/25/33/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>06/12/22/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8501=>06/25/35/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>06/12/24/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8605=>06/25/37/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>06/12/26/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8709=>06/25/39/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>06/12/28/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8813=>06/25/41/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>06/12/30/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=8917=>06/25/43/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>06/12/32/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9021=>06/25/45/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>06/12/34/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9125=>06/25/47/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>06/12/36/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9229=>06/25/49/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>07/12/38/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9333=>07/25/00/07, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9437=>07/25/02/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>07/12/42/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9541=>07/25/04/03, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[0], fn=9645=>07/25/06/05, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8618=>06/12/50/00, fn%104=90, rc=1, delta=8618 +Testing: ts[6]->lchan[0], fn=8722=>06/12/01/03, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8826=>06/12/03/05, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8930=>06/12/05/07, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=8943=>06/25/18/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>06/12/07/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9047=>06/25/20/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>06/12/09/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9151=>06/25/22/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>06/12/11/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9255=>06/25/24/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>07/12/13/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9359=>07/25/26/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>07/12/15/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9463=>07/25/28/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>07/12/17/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9567=>07/25/30/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>07/12/19/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9671=>07/25/32/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>07/12/21/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9775=>07/25/34/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>07/12/23/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9879=>07/25/36/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>07/12/25/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=9983=>07/25/38/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>07/12/27/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10087=>07/25/40/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>07/12/29/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10191=>07/25/42/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>07/12/31/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10295=>07/25/44/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>07/12/33/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10399=>07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>07/12/35/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10503=>07/25/48/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>07/12/37/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10607=>07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>08/12/39/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10711=>08/25/01/02, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>08/12/41/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10815=>08/25/03/04, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>08/12/43/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=10919=>08/25/05/06, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>08/12/45/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11023=>08/25/07/00, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>08/12/47/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11127=>08/25/09/02, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>08/12/49/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11231=>08/25/11/04, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11335=>08/25/13/06, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>08/12/02/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11439=>08/25/15/00, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>08/12/04/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11543=>08/25/17/02, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11634=>08/12/06/04, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11647=>08/25/19/04, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11738=>08/12/08/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11751=>08/25/21/06, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11842=>08/12/10/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11855=>08/25/23/00, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11946=>09/12/12/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=11959=>09/25/25/02, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12050=>09/12/14/04, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12063=>09/25/27/04, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=12154=>09/12/16/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[0], fn=12167=>09/25/29/06, fn%104=103, rc=1, delta=13 + +*********************** +*** FULL RATE TESTS *** +*********************** + + +=========================================================== +Testing: ts[2]->lchan[0], fn=8982=>06/12/06/00, fn%104=38, rc=1, delta=8982 +Testing: ts[2]->lchan[0], fn=9086=>06/12/08/02, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9190=>06/12/10/04, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9294=>07/12/12/06, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[0], fn=9398=>07/12/14/00, fn%104=38, rc=1, delta=104 +Testing: ts[2]->lchan[1], fn=9411=>07/25/27/00, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9502=>07/12/16/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9515=>07/25/29/02, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9606=>07/12/18/04, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9619=>07/25/31/04, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9710=>07/12/20/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9723=>07/25/33/06, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9814=>07/12/22/00, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9827=>07/25/35/00, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=9918=>07/12/24/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=9931=>07/25/37/02, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10022=>07/12/26/04, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10035=>07/25/39/04, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10126=>07/12/28/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10139=>07/25/41/06, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10230=>07/12/30/00, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10243=>07/25/43/00, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10334=>07/12/32/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10347=>07/25/45/02, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10438=>07/12/34/04, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10451=>07/25/47/04, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10542=>07/12/36/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10555=>07/25/49/06, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10646=>08/12/38/00, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10659=>08/25/00/01, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10750=>08/12/40/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10763=>08/25/02/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10854=>08/12/42/04, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10867=>08/25/04/05, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=10958=>08/12/44/06, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=10971=>08/25/06/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11062=>08/12/46/00, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11075=>08/25/08/01, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11166=>08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11179=>08/25/10/03, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11270=>08/12/50/04, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11283=>08/25/12/05, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11374=>08/12/01/07, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11387=>08/25/14/07, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11478=>08/12/03/01, fn%104=38, rc=1, delta=91 +Testing: ts[2]->lchan[1], fn=11491=>08/25/16/01, fn%104=51, rc=1, delta=13 +Testing: ts[2]->lchan[0], fn=11582=>08/12/05/03, fn%104=38, rc=1, delta=91 + + +=========================================================== +Testing: ts[3]->lchan[0], fn=10022=>07/12/26/04, fn%104=38, rc=1, delta=10022 +Testing: ts[3]->lchan[1], fn=10035=>07/25/39/04, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10126=>07/12/28/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10139=>07/25/41/06, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10230=>07/12/30/00, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10243=>07/25/43/00, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10334=>07/12/32/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10347=>07/25/45/02, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10438=>07/12/34/04, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10451=>07/25/47/04, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10542=>07/12/36/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10555=>07/25/49/06, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10646=>08/12/38/00, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10659=>08/25/00/01, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10750=>08/12/40/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10763=>08/25/02/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10854=>08/12/42/04, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10867=>08/25/04/05, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=10958=>08/12/44/06, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=10971=>08/25/06/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11062=>08/12/46/00, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11075=>08/25/08/01, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11166=>08/12/48/02, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11179=>08/25/10/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11270=>08/12/50/04, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11283=>08/25/12/05, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11374=>08/12/01/07, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11387=>08/25/14/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11478=>08/12/03/01, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11491=>08/25/16/01, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11582=>08/12/05/03, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11595=>08/25/18/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11686=>08/12/07/05, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11699=>08/25/20/05, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11790=>08/12/09/07, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11803=>08/25/22/07, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11894=>08/12/11/01, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=11907=>08/25/24/01, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=11998=>09/12/13/03, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12011=>09/25/26/03, fn%104=51, rc=1, delta=13 +Testing: ts[3]->lchan[0], fn=12102=>09/12/15/05, fn%104=38, rc=1, delta=91 +Testing: ts[3]->lchan[1], fn=12115=>09/25/28/05, fn%104=51, rc=1, delta=13 + + +=========================================================== +Testing: ts[4]->lchan[0], fn=7760=>05/12/08/00, fn%104=64, rc=1, delta=7760 +Testing: ts[4]->lchan[0], fn=7864=>05/12/10/02, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=7968=>06/12/12/04, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8072=>06/12/14/06, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[0], fn=8176=>06/12/16/00, fn%104=64, rc=1, delta=104 +Testing: ts[4]->lchan[1], fn=8189=>06/25/29/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8280=>06/12/18/02, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8293=>06/25/31/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8384=>06/12/20/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8397=>06/25/33/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8488=>06/12/22/06, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8501=>06/25/35/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8592=>06/12/24/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8605=>06/25/37/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8696=>06/12/26/02, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8709=>06/25/39/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8800=>06/12/28/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8813=>06/25/41/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=8904=>06/12/30/06, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=8917=>06/25/43/06, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9008=>06/12/32/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9021=>06/25/45/00, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9112=>06/12/34/02, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9125=>06/25/47/02, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9216=>06/12/36/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9229=>06/25/49/04, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9320=>07/12/38/06, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9333=>07/25/00/07, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9424=>07/12/40/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9437=>07/25/02/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9528=>07/12/42/02, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9541=>07/25/04/03, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9632=>07/12/44/04, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9645=>07/25/06/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9736=>07/12/46/06, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9749=>07/25/08/07, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9840=>07/12/48/00, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9853=>07/25/10/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=9944=>07/12/50/02, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=9957=>07/25/12/03, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10048=>07/12/01/05, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10061=>07/25/14/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10152=>07/12/03/07, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10165=>07/25/16/07, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10256=>07/12/05/01, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10269=>07/25/18/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10360=>07/12/07/03, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10373=>07/25/20/03, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10464=>07/12/09/05, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10477=>07/25/22/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10568=>07/12/11/07, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10581=>07/25/24/07, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10672=>08/12/13/01, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10685=>08/25/26/01, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10776=>08/12/15/03, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10789=>08/25/28/03, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10880=>08/12/17/05, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10893=>08/25/30/05, fn%104=77, rc=1, delta=13 +Testing: ts[4]->lchan[0], fn=10984=>08/12/19/07, fn%104=64, rc=1, delta=91 +Testing: ts[4]->lchan[1], fn=10997=>08/25/32/07, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[5]->lchan[0], fn=5264=>03/12/11/07, fn%104=64, rc=1, delta=5264 +Testing: ts[5]->lchan[0], fn=5368=>04/12/13/01, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5472=>04/12/15/03, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5576=>04/12/17/05, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[0], fn=5680=>04/12/19/07, fn%104=64, rc=1, delta=104 +Testing: ts[5]->lchan[1], fn=5693=>04/25/32/07, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5784=>04/12/21/01, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5797=>04/25/34/01, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5888=>04/12/23/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=5901=>04/25/36/03, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=5992=>04/12/25/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6005=>04/25/38/05, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6096=>04/12/27/07, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6109=>04/25/40/07, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6200=>04/12/29/01, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6213=>04/25/42/01, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6304=>04/12/31/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6317=>04/25/44/03, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6408=>04/12/33/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6421=>04/25/46/05, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6512=>04/12/35/07, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6525=>04/25/48/07, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6616=>04/12/37/01, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6629=>04/25/50/01, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6720=>05/12/39/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6733=>05/25/01/04, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6824=>05/12/41/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6837=>05/25/03/06, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=6928=>05/12/43/07, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=6941=>05/25/05/00, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7032=>05/12/45/01, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7045=>05/25/07/02, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7136=>05/12/47/03, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7149=>05/25/09/04, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7240=>05/12/49/05, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7253=>05/25/11/06, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7344=>05/12/00/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7357=>05/25/13/00, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7448=>05/12/02/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7461=>05/25/15/02, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7552=>05/12/04/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7565=>05/25/17/04, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7656=>05/12/06/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7669=>05/25/19/06, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7760=>05/12/08/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7773=>05/25/21/00, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7864=>05/12/10/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7877=>05/25/23/02, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=7968=>06/12/12/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=7981=>06/25/25/04, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8072=>06/12/14/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8085=>06/25/27/06, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8176=>06/12/16/00, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8189=>06/25/29/00, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8280=>06/12/18/02, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8293=>06/25/31/02, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8384=>06/12/20/04, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8397=>06/25/33/04, fn%104=77, rc=1, delta=13 +Testing: ts[5]->lchan[0], fn=8488=>06/12/22/06, fn%104=64, rc=1, delta=91 +Testing: ts[5]->lchan[1], fn=8501=>06/25/35/06, fn%104=77, rc=1, delta=13 + + +=========================================================== +Testing: ts[6]->lchan[0], fn=8098=>06/12/40/06, fn%104=90, rc=1, delta=8098 +Testing: ts[6]->lchan[0], fn=8202=>06/12/42/00, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8306=>06/12/44/02, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[0], fn=8410=>06/12/46/04, fn%104=90, rc=1, delta=104 +Testing: ts[6]->lchan[1], fn=8423=>06/25/08/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8514=>06/12/48/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8527=>06/25/10/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8618=>06/12/50/00, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8631=>06/25/12/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8722=>06/12/01/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8735=>06/25/14/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8826=>06/12/03/05, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8839=>06/25/16/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=8930=>06/12/05/07, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=8943=>06/25/18/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9034=>06/12/07/01, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9047=>06/25/20/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9138=>06/12/09/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9151=>06/25/22/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9242=>06/12/11/05, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9255=>06/25/24/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9346=>07/12/13/07, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9359=>07/25/26/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9450=>07/12/15/01, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9463=>07/25/28/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9554=>07/12/17/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9567=>07/25/30/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9658=>07/12/19/05, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9671=>07/25/32/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9762=>07/12/21/07, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9775=>07/25/34/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9866=>07/12/23/01, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9879=>07/25/36/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=9970=>07/12/25/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=9983=>07/25/38/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10074=>07/12/27/05, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10087=>07/25/40/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10178=>07/12/29/07, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10191=>07/25/42/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10282=>07/12/31/01, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10295=>07/25/44/01, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10386=>07/12/33/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10399=>07/25/46/03, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10490=>07/12/35/05, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10503=>07/25/48/05, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10594=>07/12/37/07, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10607=>07/25/50/07, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10698=>08/12/39/01, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10711=>08/25/01/02, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10802=>08/12/41/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10815=>08/25/03/04, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=10906=>08/12/43/05, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=10919=>08/25/05/06, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11010=>08/12/45/07, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11023=>08/25/07/00, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11114=>08/12/47/01, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11127=>08/25/09/02, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11218=>08/12/49/03, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11231=>08/25/11/04, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11322=>08/12/00/06, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11335=>08/25/13/06, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11426=>08/12/02/00, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11439=>08/25/15/00, fn%104=103, rc=1, delta=13 +Testing: ts[6]->lchan[0], fn=11530=>08/12/04/02, fn%104=90, rc=1, delta=91 +Testing: ts[6]->lchan[1], fn=11543=>08/25/17/02, fn%104=103, rc=1, delta=13 + + +=========================================================== +Testing: ts[7]->lchan[0], fn=11738=>08/12/08/06, fn%104=90, rc=1, delta=11738 +Testing: ts[7]->lchan[0], fn=11842=>08/12/10/00, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=11946=>09/12/12/02, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[0], fn=12050=>09/12/14/04, fn%104=90, rc=1, delta=104 +Testing: ts[7]->lchan[1], fn=12063=>09/25/27/04, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12154=>09/12/16/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12167=>09/25/29/06, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12258=>09/12/18/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12271=>09/25/31/00, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12362=>09/12/20/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12375=>09/25/33/02, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12466=>09/12/22/04, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12479=>09/25/35/04, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12570=>09/12/24/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12583=>09/25/37/06, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12674=>09/12/26/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12687=>09/25/39/00, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12778=>09/12/28/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12791=>09/25/41/02, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12882=>09/12/30/04, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12895=>09/25/43/04, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=12986=>09/12/32/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=12999=>09/25/45/06, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13090=>09/12/34/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13103=>09/25/47/00, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13194=>09/12/36/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13207=>09/25/49/02, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13298=>10/12/38/04, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13311=>10/25/00/05, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13402=>10/12/40/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13415=>10/25/02/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13506=>10/12/42/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13519=>10/25/04/01, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13610=>10/12/44/02, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13623=>10/25/06/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13714=>10/12/46/04, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13727=>10/25/08/05, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13818=>10/12/48/06, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13831=>10/25/10/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=13922=>10/12/50/00, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=13935=>10/25/12/01, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14026=>10/12/01/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14039=>10/25/14/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14130=>10/12/03/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14143=>10/25/16/05, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14234=>10/12/05/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14247=>10/25/18/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14338=>10/12/07/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14351=>10/25/20/01, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14442=>10/12/09/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14455=>10/25/22/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14546=>10/12/11/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14559=>10/25/24/05, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14650=>11/12/13/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14663=>11/25/26/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14754=>11/12/15/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14767=>11/25/28/01, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14858=>11/12/17/03, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14871=>11/25/30/03, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=14962=>11/12/19/05, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=14975=>11/25/32/05, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15066=>11/12/21/07, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15079=>11/25/34/07, fn%104=103, rc=1, delta=13 +Testing: ts[7]->lchan[0], fn=15170=>11/12/23/01, fn%104=90, rc=1, delta=91 +Testing: ts[7]->lchan[1], fn=15183=>11/25/36/01, fn%104=103, rc=1, delta=13 +Success diff --git a/tests/meas/sysmobts_fr_samples.h b/tests/meas/sysmobts_fr_samples.h new file mode 100644 index 0000000..ee70bd7 --- /dev/null +++ b/tests/meas/sysmobts_fr_samples.h @@ -0,0 +1,2601 @@ +/* The following dataset was generated using a sysmobts in order to have + * some real data from a real phy to test against. */ + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS2 and TS3 */ +struct fn_sample test_fn_tch_f_ts_2_3[] = { +{10954,2,0,-1},{10959,2,0,-1},{10972,2,0,-1},{10976,2,0,-1},{10980,2,0,-1}, +{10985,2,0,-1},{10989,2,0,-1},{10993,2,0,-1},{10998,2,0,-1},{11002,2,0,-1}, +{11006,2,0,-1},{11011,2,0,-1},{11015,2,0,-1},{11019,2,0,-1},{11024,2,0,-1}, +{11028,2,0,-1},{10958,2,0,-1},{11032,2,0,-1},{11037,2,0,-1},{11041,2,0,-1}, +{11045,2,0,-1},{11050,2,0,-1},{11054,2,0,-1},{11058,2,0,-1},{11063,2,0,-1}, +{11067,2,0,-1},{11071,2,0,-1},{11076,2,0,-1},{11080,2,0,-1},{11084,2,0,-1}, +{11089,2,0,-1},{11093,2,0,-1},{11097,2,0,-1},{11102,2,0,-1},{11106,2,0,-1}, +{11110,2,0,-1},{11115,2,0,-1},{11119,2,0,-1},{11123,2,0,-1},{11128,2,0,-1}, +{11132,2,0,-1},{11062,2,0,-1},{11136,2,0,-1},{11141,2,0,-1},{11145,2,0,-1}, +{11149,2,0,-1},{11154,2,0,-1},{11158,2,0,-1},{11162,2,0,-1},{11167,2,0,-1}, +{11171,2,0,-1},{11175,2,0,-1},{11180,2,0,-1},{11184,2,0,-1},{11188,2,0,-1}, +{11193,2,0,-1},{11197,2,0,-1},{11201,2,0,-1},{11206,2,0,-1},{11210,2,0,-1}, +{11214,2,0,-1},{11219,2,0,-1},{11223,2,0,-1},{11227,2,0,-1},{11232,2,0,-1}, +{11236,2,0,-1},{11166,2,0,-1},{11240,2,0,-1},{11245,2,0,-1},{11249,2,0,-1}, +{11253,2,0,-1},{11258,2,0,-1},{11262,2,0,-1},{11266,2,0,-1},{11271,2,0,-1}, +{11275,2,0,-1},{11279,2,0,-1},{11284,2,0,-1},{11288,2,0,-1},{11292,2,0,-1}, +{11297,2,0,-1},{11301,2,0,-1},{11305,2,0,-1},{11310,2,0,-1},{11314,2,0,-1}, +{11318,2,0,-1},{11323,2,0,-1},{11327,2,0,-1},{11331,2,0,-1},{11336,2,0,-1}, +{11340,2,0,-1},{11270,2,0,-1},{11344,2,0,-1},{11349,2,0,-1},{11353,2,0,-1}, +{11357,2,0,-1},{11362,2,0,-1},{11366,2,0,-1},{11370,2,0,-1},{11375,2,0,-1}, +{11379,2,0,-1},{11383,2,0,-1},{11388,2,0,-1},{11392,2,0,-1},{11396,2,0,-1}, +{11401,2,0,-1},{11405,2,0,-1},{11409,2,0,-1},{11414,2,0,-1},{11418,2,0,-1}, +{11422,2,0,-1},{11427,2,0,-1},{11431,2,0,-1},{11431,3,0,-1},{11435,2,0,-1}, +{11435,3,0,-1},{11440,2,0,-1},{11440,3,0,-1},{11444,2,0,-1},{11444,3,0,-1}, +{11374,2,0,-1},{11448,2,0,-1},{11448,3,0,-1},{11453,2,0,-1},{11453,3,0,-1}, +{11457,2,0,-1},{11457,3,0,-1},{11461,2,0,-1},{11461,3,0,-1},{11466,2,0,-1}, +{11466,3,0,-1},{11470,2,0,-1},{11470,3,0,-1},{11474,2,0,-1},{11474,3,0,-1}, +{11479,2,0,-1},{11479,3,0,-1},{11483,2,0,-1},{11483,3,0,-1},{11487,2,0,-1}, +{11487,3,0,-1},{11492,2,0,-1},{11492,3,0,-1},{11496,2,0,-1},{11496,3,0,-1}, +{11500,2,0,-1},{11500,3,0,-1},{11505,2,0,-1},{11505,3,0,-1},{11509,2,0,-1}, +{11509,3,0,-1},{11513,2,0,-1},{11513,3,0,-1},{11518,2,0,-1},{11518,3,0,-1}, +{11522,2,0,-1},{11522,3,0,-1},{11526,2,0,-1},{11526,3,0,-1},{11531,2,0,-1}, +{11531,3,0,-1},{11535,2,0,-1},{11535,3,0,-1},{11539,2,0,-1},{11539,3,0,-1}, +{11544,2,0,-1},{11544,3,0,-1},{11548,2,0,-1},{11548,3,0,-1},{11478,2,0,-1}, +{11552,2,0,-1},{11552,3,0,-1},{11557,2,0,-1},{11557,3,0,-1},{11561,2,0,-1}, +{11561,3,0,-1},{11491,3,0,-1},{11565,2,0,-1},{11565,3,0,-1},{11570,2,0,-1}, +{11570,3,0,-1},{11574,2,0,-1},{11574,3,0,-1},{11578,2,0,-1},{11578,3,0,-1}, +{11583,2,0,-1},{11583,3,0,-1},{11587,2,0,-1},{11587,3,0,-1},{11591,2,0,-1}, +{11591,3,0,-1},{11596,2,0,-1},{11596,3,0,-1},{11600,2,0,-1},{11600,3,0,-1}, +{11604,2,0,-1},{11604,3,0,-1},{11609,2,0,-1},{11609,3,0,-1},{11613,2,0,-1}, +{11613,3,0,-1},{11617,2,0,-1},{11617,3,0,-1},{11622,2,0,-1},{11622,3,0,-1}, +{11626,2,0,-1},{11626,3,0,-1},{11630,2,0,-1},{11630,3,0,-1},{11635,2,0,-1}, +{11635,3,0,-1},{11639,2,0,-1},{11639,3,0,-1},{11643,2,0,-1},{11643,3,0,-1}, +{11648,2,0,-1},{11648,3,0,-1},{11652,2,0,-1},{11652,3,0,-1},{11582,2,0,-1}, +{11656,2,0,-1},{11656,3,0,-1},{11661,2,0,-1},{11661,3,0,-1},{11665,2,0,-1}, +{11665,3,0,-1},{11595,3,0,-1},{11669,2,0,-1},{11669,3,0,-1},{11674,2,0,-1}, +{11674,3,0,-1},{11678,2,0,-1},{11678,3,0,-1},{11682,2,0,-1},{11682,3,0,-1}, +{11687,2,0,-1},{11687,3,0,-1},{11691,2,0,-1},{11691,3,0,-1},{11695,2,0,-1}, +{11695,3,0,-1},{11700,2,0,-1},{11700,3,0,-1},{11704,2,0,-1},{11704,3,0,-1}, +{11708,2,0,-1},{11708,3,0,-1},{11713,2,0,-1},{11713,3,0,-1},{11717,2,0,-1}, +{11717,3,0,-1},{11721,2,0,-1},{11721,3,0,-1},{11726,2,0,-1},{11726,3,0,-1}, +{11730,2,0,-1},{11730,3,0,-1},{11734,2,0,-1},{11734,3,0,-1},{11739,2,0,-1}, +{11739,3,0,-1},{11743,2,0,-1},{11743,3,0,-1},{11747,2,0,-1},{11747,3,0,-1}, +{11752,2,0,-1},{11752,3,0,-1},{11756,2,0,-1},{11756,3,0,-1},{11686,2,0,-1}, +{11760,2,0,-1},{11760,3,0,-1},{11765,2,0,-1},{11765,3,0,-1},{11769,2,0,-1}, +{11769,3,0,-1},{11699,3,0,-1},{11773,2,0,-1},{11773,3,0,-1},{11778,2,0,-1}, +{11778,3,0,-1},{11782,2,0,-1},{11782,3,0,-1},{11786,2,0,-1},{11786,3,0,-1}, +{11791,2,0,-1},{11791,3,0,-1},{11795,2,0,-1},{11795,3,0,-1},{11799,2,0,-1}, +{11799,3,0,-1},{11804,2,0,-1},{11804,3,0,-1},{11808,2,0,-1},{11808,3,0,-1}, +{11812,2,0,-1},{11812,3,0,-1},{11817,2,0,-1},{11817,3,0,-1},{11821,2,0,-1}, +{11821,3,0,-1},{11825,2,0,-1},{11825,3,0,-1},{11830,2,0,-1},{11830,3,0,-1}, +{11834,2,0,-1},{11834,3,0,-1},{11838,2,0,-1},{11838,3,0,-1},{11843,2,0,-1}, +{11843,3,0,-1},{11847,2,0,-1},{11847,3,0,-1},{11851,2,0,-1},{11851,3,0,-1}, +{11856,2,0,-1},{11856,3,0,-1},{11860,2,0,-1},{11860,3,0,-1},{11790,2,0,-1}, +{11864,2,0,-1},{11864,3,0,-1},{11869,2,0,-1},{11869,3,0,-1},{11873,2,0,-1}, +{11873,3,0,-1},{11803,3,0,-1},{11877,2,0,-1},{11877,3,0,-1},{11882,2,0,-1}, +{11882,3,0,-1},{11886,2,0,-1},{11886,3,0,-1},{11890,2,0,-1},{11890,3,0,-1}, +{11895,2,0,-1},{11895,3,0,-1},{11899,2,0,-1},{11899,3,0,-1},{11903,2,0,-1}, +{11903,3,0,-1},{11908,2,0,-1},{11908,3,0,-1},{11912,2,0,-1},{11912,3,0,-1}, +{11916,2,0,-1},{11916,3,0,-1},{11921,2,0,-1},{11921,3,0,-1},{11925,2,0,-1}, +{11925,3,0,-1},{11929,2,0,-1},{11929,3,0,-1},{11934,2,0,-1},{11934,3,0,-1}, +{11938,2,0,-1},{11938,3,0,-1},{11942,2,0,-1},{11942,3,0,-1},{11947,2,0,-1}, +{11947,3,0,-1},{11951,2,0,-1},{11951,3,0,-1},{11955,2,0,-1},{11955,3,0,-1}, +{11960,2,0,-1},{11960,3,0,-1},{11964,2,0,-1},{11964,3,0,-1},{11894,2,0,-1}, +{11968,2,0,-1},{11968,3,0,-1},{11973,2,0,-1},{11973,3,0,-1},{11977,2,0,-1}, +{11977,3,0,-1},{11907,3,0,-1},{11981,2,0,-1},{11981,3,0,-1},{11986,2,0,-1}, +{11986,3,0,-1},{11990,2,0,-1},{11990,3,0,-1},{11994,2,0,-1},{11994,3,0,-1}, +{11999,2,0,-1},{11999,3,0,-1},{12003,2,0,-1},{12003,3,0,-1},{12007,2,0,-1}, +{12007,3,0,-1},{12012,2,0,-1},{12012,3,0,-1},{12016,2,0,-1},{12016,3,0,-1}, +{12020,2,0,-1},{12020,3,0,-1},{12025,2,0,-1},{12025,3,0,-1},{12029,2,0,-1}, +{12029,3,0,-1},{12033,2,0,-1},{12033,3,0,-1},{12038,2,0,-1},{12038,3,0,-1}, +{12042,2,0,-1},{12042,3,0,-1},{12046,2,0,-1},{12046,3,0,-1},{12051,2,0,-1}, +{12051,3,0,-1},{12055,2,0,-1},{12055,3,0,-1},{12059,2,0,-1},{12059,3,0,-1}, +{12064,2,0,-1},{12064,3,0,-1},{12068,2,0,-1},{12068,3,0,-1},{11998,2,0,-1}, +{12072,2,0,-1},{12072,3,0,-1},{12077,2,0,-1},{12077,3,0,-1},{12081,2,0,-1}, +{12081,3,0,-1},{12011,3,0,-1},{12085,2,0,-1},{12085,3,0,-1},{12090,2,0,-1}, +{12090,3,0,-1},{12094,2,0,-1},{12094,3,0,-1},{12098,2,0,-1},{12098,3,0,-1}, +{12103,2,0,-1},{12103,3,0,-1},{12107,2,0,-1},{12107,3,0,-1},{12111,2,0,-1}, +{12111,3,0,-1},{12116,2,0,-1},{12116,3,0,-1},{12120,2,0,-1},{12120,3,0,-1}, +{12124,2,0,-1},{12124,3,0,-1},{12129,2,0,-1},{12129,3,0,-1},{12133,2,0,-1}, +{12133,3,0,-1},{12137,2,0,-1},{12137,3,0,-1},{12142,2,0,-1},{12142,3,0,-1}, +{12146,2,0,-1},{12146,3,0,-1},{12150,2,0,-1},{12150,3,0,-1},{12155,2,0,-1}, +{12155,3,0,-1},{12159,2,0,-1},{12159,3,0,-1},{12163,2,0,-1},{12163,3,0,-1}, +{12168,2,0,-1},{12168,3,0,-1},{12172,2,0,-1},{12172,3,0,-1},{12102,2,0,-1}, +{12176,2,0,-1},{12176,3,0,-1},{12181,2,0,-1},{12181,3,0,-1},{12185,2,0,-1}, +{12185,3,0,-1},{12115,3,0,-1},{12189,2,0,-1},{12189,3,0,-1},{12194,2,0,-1}, +{12194,3,0,-1},{12198,2,0,-1},{12198,3,0,-1},{12202,2,0,-1},{12202,3,0,-1}, +{12207,2,0,-1},{12207,3,0,-1},{12211,2,0,-1},{12211,3,0,-1},{12215,2,0,-1}, +{12215,3,0,-1},{12220,2,0,-1},{12220,3,0,-1},{12224,2,0,-1},{12224,3,0,-1}, +{12228,2,0,-1},{12228,3,0,-1},{12233,2,0,-1},{12233,3,0,-1},{12237,2,0,-1}, +{12237,3,0,-1},{12241,2,0,-1},{12241,3,0,-1},{12246,2,0,-1},{12246,3,0,-1}, +{12250,2,0,-1},{12250,3,0,-1},{12254,2,0,-1},{12254,3,0,-1},{12259,2,0,-1}, +{12259,3,0,-1},{12263,2,0,-1},{12263,3,0,-1},{12267,2,0,-1},{12267,3,0,-1}, +{12272,2,0,-1},{12272,3,0,-1},{12276,2,0,-1},{12276,3,0,-1},{12206,2,0,-1}, +{12280,2,0,-1},{12280,3,0,-1},{12285,2,0,-1},{12285,3,0,-1},{12289,2,0,-1}, +{12289,3,0,-1},{12219,3,0,-1},{12293,2,0,-1},{12293,3,0,-1},{12298,2,0,-1}, +{12298,3,0,-1},{12302,2,0,-1},{12302,3,0,-1},{12306,2,0,-1},{12306,3,0,-1}, +{12311,2,0,-1},{12311,3,0,-1},{12315,2,0,-1},{12315,3,0,-1},{12319,2,0,-1}, +{12319,3,0,-1},{12324,2,0,-1},{12324,3,0,-1},{12328,2,0,-1},{12328,3,0,-1}, +{12332,2,0,-1},{12332,3,0,-1},{12337,2,0,-1},{12337,3,0,-1},{12341,2,0,-1}, +{12341,3,0,-1},{12345,2,0,-1},{12345,3,0,-1},{12350,2,0,-1},{12350,3,0,-1}, +{12354,2,0,-1},{12354,3,0,-1},{12358,2,0,-1},{12358,3,0,-1},{12363,2,0,-1}, +{12363,3,0,-1},{12367,2,0,-1},{12367,3,0,-1},{12371,2,0,-1},{12371,3,0,-1}, +{12376,2,0,-1},{12376,3,0,-1},{12380,2,0,-1},{12380,3,0,-1},{12310,2,0,-1}, +{12384,2,0,-1},{12384,3,0,-1},{12389,2,0,-1},{12389,3,0,-1},{12393,2,0,-1}, +{12393,3,0,-1},{12323,3,0,-1},{12397,2,0,-1},{12397,3,0,-1},{12402,2,0,-1}, +{12402,3,0,-1},{12406,2,0,-1},{12406,3,0,-1},{12410,2,0,-1},{12410,3,0,-1}, +{12415,2,0,-1},{12415,3,0,-1},{12419,2,0,-1},{12419,3,0,-1},{12423,2,0,-1}, +{12423,3,0,-1},{12428,2,0,-1},{12428,3,0,-1},{12432,2,0,-1},{12432,3,0,-1}, +{12436,2,0,-1},{12436,3,0,-1},{12441,2,0,-1},{12441,3,0,-1},{12445,2,0,-1}, +{12445,3,0,-1},{12449,2,0,-1},{12449,3,0,-1},{12454,2,0,-1},{12454,3,0,-1}, +{12458,2,0,-1},{12458,3,0,-1},{12462,2,0,-1},{12462,3,0,-1},{12467,2,0,-1}, +{12467,3,0,-1},{12471,2,0,-1},{12471,3,0,-1},{12475,2,0,-1},{12475,3,0,-1}, +{12480,2,0,-1},{12480,3,0,-1},{12484,2,0,-1},{12484,3,0,-1},{12414,2,0,-1}, +{12488,2,0,-1},{12488,3,0,-1},{12493,2,0,-1},{12493,3,0,-1},{12497,2,0,-1}, +{12497,3,0,-1},{12427,3,0,-1},{12501,2,0,-1},{12501,3,0,-1},{12506,2,0,-1}, +{12506,3,0,-1},{12510,2,0,-1},{12510,3,0,-1},{12514,2,0,-1},{12514,3,0,-1}, +{12519,2,0,-1},{12519,3,0,-1},{12523,2,0,-1},{12523,3,0,-1},{12527,2,0,-1}, +{12527,3,0,-1},{12532,2,0,-1},{12532,3,0,-1},{12536,2,0,-1},{12536,3,0,-1}, +{12540,2,0,-1},{12540,3,0,-1},{12545,2,0,-1},{12545,3,0,-1},{12549,2,0,-1}, +{12549,3,0,-1},{12553,2,0,-1},{12553,3,0,-1},{12558,2,0,-1},{12558,3,0,-1}, +{12562,2,0,-1},{12562,3,0,-1},{12566,2,0,-1},{12566,3,0,-1},{12571,2,0,-1}, +{12571,3,0,-1},{12575,2,0,-1},{12575,3,0,-1},{12579,2,0,-1},{12579,3,0,-1}, +{12584,2,0,-1},{12584,3,0,-1},{12588,2,0,-1},{12588,3,0,-1},{12518,2,0,-1}, +{12592,2,0,-1},{12592,3,0,-1},{12597,2,0,-1},{12597,3,0,-1},{12601,2,0,-1}, +{12601,3,0,-1},{12531,3,0,-1},{12605,2,0,-1},{12605,3,0,-1},{12610,2,0,-1}, +{12610,3,0,-1},{12614,2,0,-1},{12614,3,0,-1},{12618,2,0,-1},{12618,3,0,-1}, +{12623,2,0,-1},{12623,3,0,-1},{12627,2,0,-1},{12627,3,0,-1},{12631,2,0,-1}, +{12631,3,0,-1},{12636,2,0,-1},{12636,3,0,-1},{12640,2,0,-1},{12640,3,0,-1}, +{12644,2,0,-1},{12644,3,0,-1},{12649,2,0,-1},{12649,3,0,-1},{12653,2,0,-1}, +{12653,3,0,-1},{12657,2,0,-1},{12657,3,0,-1},{12662,2,0,-1},{12662,3,0,-1}, +{12666,2,0,-1},{12666,3,0,-1},{12670,2,0,-1},{12670,3,0,-1},{12675,2,0,-1}, +{12675,3,0,-1},{12679,2,0,-1},{12679,3,0,-1},{12683,2,0,-1},{12683,3,0,-1}, +{12688,2,0,-1},{12688,3,0,-1},{12692,2,0,-1},{12692,3,0,-1},{12622,2,0,-1}, +{12696,2,0,-1},{12696,3,0,-1},{12701,2,0,-1},{12701,3,0,-1},{12705,2,0,-1}, +{12705,3,0,-1},{12635,3,0,-1},{12709,2,0,-1},{12709,3,0,-1},{12714,2,0,-1}, +{12714,3,0,-1},{12718,2,0,-1},{12718,3,0,-1},{12722,2,0,-1},{12722,3,0,-1}, +{12727,2,0,-1},{12727,3,0,-1},{12731,2,0,-1},{12731,3,0,-1},{12735,2,0,-1}, +{12735,3,0,-1},{12740,2,0,-1},{12740,3,0,-1},{12744,2,0,-1},{12744,3,0,-1}, +{12748,2,0,-1},{12748,3,0,-1},{12753,2,0,-1},{12753,3,0,-1},{12757,2,0,-1}, +{12757,3,0,-1},{12761,2,0,-1},{12761,3,0,-1},{12766,2,0,-1},{12766,3,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS4 and TS5 */ +struct fn_sample test_fn_tch_f_ts_4_5[] = { +{3407,0,1,-1},{3427,0,1,-1},{3458,0,1,-1},{3509,0,1,-1},{3529,0,1,-1}, +{3560,0,1,-1},{3611,0,1,-1},{3662,0,1,-1},{3713,0,1,-1},{3764,0,1,-1}, +{3780,0,2,-1},{3821,0,2,-1},{3872,0,2,-1},{3882,0,2,-1},{3923,0,2,-1}, +{3974,0,2,-1},{3984,0,2,-1},{4025,0,2,-1},{4076,0,2,-1},{4127,0,2,-1}, +{4178,0,2,-1},{5871,4,0,-1},{5876,4,0,-1},{5880,4,0,-1},{5884,4,0,-1}, +{5889,4,0,-1},{5893,4,0,-1},{5897,4,0,-1},{5902,4,0,-1},{5906,4,0,-1}, +{5910,4,0,-1},{5915,4,0,-1},{5919,4,0,-1},{5923,4,0,-1},{5928,4,0,-1}, +{5932,4,0,-1},{5936,4,0,-1},{5941,4,0,-1},{5945,4,0,-1},{5949,4,0,-1}, +{5954,4,0,-1},{5958,4,0,-1},{5888,4,0,-1},{5962,4,0,-1},{5967,4,0,-1}, +{5971,4,0,-1},{5975,4,0,-1},{5980,4,0,-1},{5984,4,0,-1},{5988,4,0,-1}, +{5993,4,0,-1},{5997,4,0,-1},{6001,4,0,-1},{6006,4,0,-1},{6010,4,0,-1}, +{6014,4,0,-1},{6019,4,0,-1},{6023,4,0,-1},{6027,4,0,-1},{6032,4,0,-1}, +{6036,4,0,-1},{6040,4,0,-1},{6045,4,0,-1},{6049,4,0,-1},{6053,4,0,-1}, +{6058,4,0,-1},{6062,4,0,-1},{5992,4,0,-1},{6066,4,0,-1},{6071,4,0,-1}, +{6075,4,0,-1},{6079,4,0,-1},{6084,4,0,-1},{6088,4,0,-1},{6092,4,0,-1}, +{6097,4,0,-1},{6101,4,0,-1},{6105,4,0,-1},{6110,4,0,-1},{6114,4,0,-1}, +{6118,4,0,-1},{6123,4,0,-1},{6127,4,0,-1},{6131,4,0,-1},{6136,4,0,-1}, +{6140,4,0,-1},{6144,4,0,-1},{6149,4,0,-1},{6153,4,0,-1},{6157,4,0,-1}, +{6162,4,0,-1},{6166,4,0,-1},{6096,4,0,-1},{6170,4,0,-1},{6175,4,0,-1}, +{6175,5,0,-1},{6179,4,0,-1},{6179,5,0,-1},{6183,4,0,-1},{6183,5,0,-1}, +{6188,4,0,-1},{6188,5,0,-1},{6192,4,0,-1},{6192,5,0,-1},{6196,4,0,-1}, +{6196,5,0,-1},{6201,4,0,-1},{6201,5,0,-1},{6205,4,0,-1},{6205,5,0,-1}, +{6209,4,0,-1},{6209,5,0,-1},{6214,4,0,-1},{6214,5,0,-1},{6218,4,0,-1}, +{6218,5,0,-1},{6222,4,0,-1},{6222,5,0,-1},{6227,4,0,-1},{6227,5,0,-1}, +{6231,4,0,-1},{6231,5,0,-1},{6235,4,0,-1},{6235,5,0,-1},{6240,4,0,-1}, +{6240,5,0,-1},{6244,4,0,-1},{6244,5,0,-1},{6248,4,0,-1},{6248,5,0,-1}, +{6253,4,0,-1},{6253,5,0,-1},{6257,4,0,-1},{6257,5,0,-1},{6261,4,0,-1}, +{6261,5,0,-1},{6266,4,0,-1},{6266,5,0,-1},{6270,4,0,-1},{6270,5,0,-1}, +{6200,4,0,-1},{6274,4,0,-1},{6274,5,0,-1},{6279,4,0,-1},{6279,5,0,-1}, +{6283,4,0,-1},{6283,5,0,-1},{6213,5,0,-1},{6287,4,0,-1},{6287,5,0,-1}, +{6292,4,0,-1},{6292,5,0,-1},{6296,4,0,-1},{6296,5,0,-1},{6300,4,0,-1}, +{6300,5,0,-1},{6305,4,0,-1},{6305,5,0,-1},{6309,4,0,-1},{6309,5,0,-1}, +{6313,4,0,-1},{6313,5,0,-1},{6318,4,0,-1},{6318,5,0,-1},{6322,4,0,-1}, +{6322,5,0,-1},{6326,4,0,-1},{6326,5,0,-1},{6331,4,0,-1},{6331,5,0,-1}, +{6335,4,0,-1},{6335,5,0,-1},{6339,4,0,-1},{6339,5,0,-1},{6344,4,0,-1}, +{6344,5,0,-1},{6348,4,0,-1},{6348,5,0,-1},{6352,4,0,-1},{6352,5,0,-1}, +{6357,4,0,-1},{6357,5,0,-1},{6361,4,0,-1},{6361,5,0,-1},{6365,4,0,-1}, +{6365,5,0,-1},{6370,4,0,-1},{6370,5,0,-1},{6374,4,0,-1},{6374,5,0,-1}, +{6304,4,0,-1},{6378,4,0,-1},{6378,5,0,-1},{6383,4,0,-1},{6383,5,0,-1}, +{6387,4,0,-1},{6387,5,0,-1},{6317,5,0,-1},{6391,4,0,-1},{6391,5,0,-1}, +{6396,4,0,-1},{6396,5,0,-1},{6400,4,0,-1},{6400,5,0,-1},{6404,4,0,-1}, +{6404,5,0,-1},{6409,4,0,-1},{6409,5,0,-1},{6413,4,0,-1},{6413,5,0,-1}, +{6417,4,0,-1},{6417,5,0,-1},{6422,4,0,-1},{6422,5,0,-1},{6426,4,0,-1}, +{6426,5,0,-1},{6430,4,0,-1},{6430,5,0,-1},{6435,4,0,-1},{6435,5,0,-1}, +{6439,4,0,-1},{6439,5,0,-1},{6443,4,0,-1},{6443,5,0,-1},{6448,4,0,-1}, +{6448,5,0,-1},{6452,4,0,-1},{6452,5,0,-1},{6456,4,0,-1},{6456,5,0,-1}, +{6461,4,0,-1},{6461,5,0,-1},{6465,4,0,-1},{6465,5,0,-1},{6469,4,0,-1}, +{6469,5,0,-1},{6474,4,0,-1},{6474,5,0,-1},{6478,4,0,-1},{6478,5,0,-1}, +{6408,4,0,-1},{6482,4,0,-1},{6482,5,0,-1},{6487,4,0,-1},{6487,5,0,-1}, +{6491,4,0,-1},{6491,5,0,-1},{6421,5,0,-1},{6495,4,0,-1},{6495,5,0,-1}, +{6500,4,0,-1},{6500,5,0,-1},{6504,4,0,-1},{6504,5,0,-1},{6508,4,0,-1}, +{6508,5,0,-1},{6513,4,0,-1},{6513,5,0,-1},{6517,4,0,-1},{6517,5,0,-1}, +{6521,4,0,-1},{6521,5,0,-1},{6526,4,0,-1},{6526,5,0,-1},{6530,4,0,-1}, +{6530,5,0,-1},{6534,4,0,-1},{6534,5,0,-1},{6539,4,0,-1},{6539,5,0,-1}, +{6543,4,0,-1},{6543,5,0,-1},{6547,4,0,-1},{6547,5,0,-1},{6552,4,0,-1}, +{6552,5,0,-1},{6556,4,0,-1},{6556,5,0,-1},{6560,4,0,-1},{6560,5,0,-1}, +{6565,4,0,-1},{6565,5,0,-1},{6569,4,0,-1},{6569,5,0,-1},{6573,4,0,-1}, +{6573,5,0,-1},{6578,4,0,-1},{6578,5,0,-1},{6582,4,0,-1},{6582,5,0,-1}, +{6512,4,0,-1},{6586,4,0,-1},{6586,5,0,-1},{6591,4,0,-1},{6591,5,0,-1}, +{6595,4,0,-1},{6595,5,0,-1},{6525,5,0,-1},{6599,4,0,-1},{6599,5,0,-1}, +{6604,4,0,-1},{6604,5,0,-1},{6608,4,0,-1},{6608,5,0,-1},{6612,4,0,-1}, +{6612,5,0,-1},{6617,4,0,-1},{6617,5,0,-1},{6621,4,0,-1},{6621,5,0,-1}, +{6625,4,0,-1},{6625,5,0,-1},{6630,4,0,-1},{6630,5,0,-1},{6634,4,0,-1}, +{6634,5,0,-1},{6638,4,0,-1},{6638,5,0,-1},{6643,4,0,-1},{6643,5,0,-1}, +{6647,4,0,-1},{6647,5,0,-1},{6651,4,0,-1},{6651,5,0,-1},{6656,4,0,-1}, +{6656,5,0,-1},{6660,4,0,-1},{6660,5,0,-1},{6664,4,0,-1},{6664,5,0,-1}, +{6669,4,0,-1},{6669,5,0,-1},{6673,4,0,-1},{6673,5,0,-1},{6677,4,0,-1}, +{6677,5,0,-1},{6682,4,0,-1},{6682,5,0,-1},{6686,4,0,-1},{6686,5,0,-1}, +{6616,4,0,-1},{6690,4,0,-1},{6690,5,0,-1},{6695,4,0,-1},{6695,5,0,-1}, +{6699,4,0,-1},{6699,5,0,-1},{6629,5,0,-1},{6703,4,0,-1},{6703,5,0,-1}, +{6708,4,0,-1},{6708,5,0,-1},{6712,4,0,-1},{6712,5,0,-1},{6716,4,0,-1}, +{6716,5,0,-1},{6721,4,0,-1},{6721,5,0,-1},{6725,4,0,-1},{6725,5,0,-1}, +{6729,4,0,-1},{6729,5,0,-1},{6734,4,0,-1},{6734,5,0,-1},{6738,4,0,-1}, +{6738,5,0,-1},{6742,4,0,-1},{6742,5,0,-1},{6747,4,0,-1},{6747,5,0,-1}, +{6751,4,0,-1},{6751,5,0,-1},{6755,4,0,-1},{6755,5,0,-1},{6760,4,0,-1}, +{6760,5,0,-1},{6764,4,0,-1},{6764,5,0,-1},{6768,4,0,-1},{6768,5,0,-1}, +{6773,4,0,-1},{6773,5,0,-1},{6777,4,0,-1},{6777,5,0,-1},{6781,4,0,-1}, +{6781,5,0,-1},{6786,4,0,-1},{6786,5,0,-1},{6790,4,0,-1},{6790,5,0,-1}, +{6720,4,0,-1},{6794,4,0,-1},{6794,5,0,-1},{6799,4,0,-1},{6799,5,0,-1}, +{6803,4,0,-1},{6803,5,0,-1},{6733,5,0,-1},{6807,4,0,-1},{6807,5,0,-1}, +{6812,4,0,-1},{6812,5,0,-1},{6816,4,0,-1},{6816,5,0,-1},{6820,4,0,-1}, +{6820,5,0,-1},{6825,4,0,-1},{6825,5,0,-1},{6829,4,0,-1},{6829,5,0,-1}, +{6833,4,0,-1},{6833,5,0,-1},{6838,4,0,-1},{6838,5,0,-1},{6842,4,0,-1}, +{6842,5,0,-1},{6846,4,0,-1},{6846,5,0,-1},{6851,4,0,-1},{6851,5,0,-1}, +{6855,4,0,-1},{6855,5,0,-1},{6859,4,0,-1},{6859,5,0,-1},{6864,4,0,-1}, +{6864,5,0,-1},{6868,4,0,-1},{6868,5,0,-1},{6872,4,0,-1},{6872,5,0,-1}, +{6877,4,0,-1},{6877,5,0,-1},{6881,4,0,-1},{6881,5,0,-1},{6885,4,0,-1}, +{6885,5,0,-1},{6890,4,0,-1},{6890,5,0,-1},{6894,4,0,-1},{6894,5,0,-1}, +{6824,4,0,-1},{6898,4,0,-1},{6898,5,0,-1},{6903,4,0,-1},{6903,5,0,-1}, +{6907,4,0,-1},{6907,5,0,-1},{6837,5,0,-1},{6911,4,0,-1},{6911,5,0,-1}, +{6916,4,0,-1},{6916,5,0,-1},{6920,4,0,-1},{6920,5,0,-1},{6924,4,0,-1}, +{6924,5,0,-1},{6929,4,0,-1},{6929,5,0,-1},{6933,4,0,-1},{6933,5,0,-1}, +{6937,4,0,-1},{6937,5,0,-1},{6942,4,0,-1},{6942,5,0,-1},{6946,4,0,-1}, +{6946,5,0,-1},{6950,4,0,-1},{6950,5,0,-1},{6955,4,0,-1},{6955,5,0,-1}, +{6959,4,0,-1},{6959,5,0,-1},{6963,4,0,-1},{6963,5,0,-1},{6968,4,0,-1}, +{6968,5,0,-1},{6972,4,0,-1},{6972,5,0,-1},{6976,4,0,-1},{6976,5,0,-1}, +{6981,4,0,-1},{6981,5,0,-1},{6985,4,0,-1},{6985,5,0,-1},{6989,4,0,-1}, +{6989,5,0,-1},{6994,4,0,-1},{6994,5,0,-1},{6998,4,0,-1},{6998,5,0,-1}, +{6928,4,0,-1},{7002,4,0,-1},{7002,5,0,-1},{7007,4,0,-1},{7007,5,0,-1}, +{7011,4,0,-1},{7011,5,0,-1},{6941,5,0,-1},{7015,4,0,-1},{7015,5,0,-1}, +{7020,4,0,-1},{7020,5,0,-1},{7024,4,0,-1},{7024,5,0,-1},{7028,4,0,-1}, +{7028,5,0,-1},{7033,4,0,-1},{7033,5,0,-1},{7037,4,0,-1},{7037,5,0,-1}, +{7041,4,0,-1},{7041,5,0,-1},{7046,4,0,-1},{7046,5,0,-1},{7050,4,0,-1}, +{7050,5,0,-1},{7054,4,0,-1},{7054,5,0,-1},{7059,4,0,-1},{7059,5,0,-1}, +{7063,4,0,-1},{7063,5,0,-1},{7067,4,0,-1},{7067,5,0,-1},{7072,4,0,-1}, +{7072,5,0,-1},{7076,4,0,-1},{7076,5,0,-1},{7080,4,0,-1},{7080,5,0,-1}, +{7085,4,0,-1},{7085,5,0,-1},{7089,4,0,-1},{7089,5,0,-1},{7093,4,0,-1}, +{7093,5,0,-1},{7098,4,0,-1},{7098,5,0,-1},{7102,4,0,-1},{7102,5,0,-1}, +{7032,4,0,-1},{7106,4,0,-1},{7106,5,0,-1},{7111,4,0,-1},{7111,5,0,-1}, +{7115,4,0,-1},{7115,5,0,-1},{7045,5,0,-1},{7119,4,0,-1},{7119,5,0,-1}, +{7124,4,0,-1},{7124,5,0,-1},{7128,4,0,-1},{7128,5,0,-1},{7132,4,0,-1}, +{7132,5,0,-1},{7137,4,0,-1},{7137,5,0,-1},{7141,4,0,-1},{7141,5,0,-1}, +{7145,4,0,-1},{7145,5,0,-1},{7150,4,0,-1},{7150,5,0,-1},{7154,4,0,-1}, +{7154,5,0,-1},{7158,4,0,-1},{7158,5,0,-1},{7163,4,0,-1},{7163,5,0,-1}, +{7167,4,0,-1},{7167,5,0,-1},{7171,4,0,-1},{7171,5,0,-1},{7176,4,0,-1}, +{7176,5,0,-1},{7180,4,0,-1},{7180,5,0,-1},{7184,4,0,-1},{7184,5,0,-1}, +{7189,4,0,-1},{7189,5,0,-1},{7193,4,0,-1},{7193,5,0,-1},{7197,4,0,-1}, +{7197,5,0,-1},{7202,4,0,-1},{7202,5,0,-1},{7206,4,0,-1},{7206,5,0,-1}, +{7136,4,0,-1},{7210,4,0,-1},{7210,5,0,-1},{7215,4,0,-1},{7215,5,0,-1}, +{7219,4,0,-1},{7219,5,0,-1},{7149,5,0,-1},{7223,4,0,-1},{7223,5,0,-1}, +{7228,4,0,-1},{7228,5,0,-1},{7232,4,0,-1},{7232,5,0,-1},{7236,4,0,-1}, +{7236,5,0,-1},{7241,4,0,-1},{7241,5,0,-1},{7245,4,0,-1},{7245,5,0,-1}, +{7249,4,0,-1},{7249,5,0,-1},{7254,4,0,-1},{7254,5,0,-1},{7258,4,0,-1}, +{7258,5,0,-1},{7262,4,0,-1},{7262,5,0,-1},{7267,4,0,-1},{7267,5,0,-1}, +{7271,4,0,-1},{7271,5,0,-1},{7275,4,0,-1},{7275,5,0,-1},{7280,4,0,-1}, +{7280,5,0,-1},{7284,4,0,-1},{7284,5,0,-1},{7288,4,0,-1},{7288,5,0,-1}, +{7293,4,0,-1},{7293,5,0,-1},{7297,4,0,-1},{7297,5,0,-1},{7301,4,0,-1}, +{7301,5,0,-1},{7306,4,0,-1},{7306,5,0,-1},{7310,4,0,-1},{7310,5,0,-1}, +{7240,4,0,-1},{7314,4,0,-1},{7314,5,0,-1},{7319,4,0,-1},{7319,5,0,-1}, +{7323,4,0,-1},{7323,5,0,-1},{7253,5,0,-1},{7327,4,0,-1},{7327,5,0,-1}, +{7332,4,0,-1},{7332,5,0,-1},{7336,4,0,-1},{7336,5,0,-1},{7340,4,0,-1}, +{7340,5,0,-1},{7345,4,0,-1},{7345,5,0,-1},{7349,4,0,-1},{7349,5,0,-1}, +{7353,4,0,-1},{7353,5,0,-1},{7358,4,0,-1},{7358,5,0,-1},{7362,4,0,-1}, +{7362,5,0,-1},{7366,4,0,-1},{7366,5,0,-1},{7371,4,0,-1},{7371,5,0,-1}, +{7375,4,0,-1},{7375,5,0,-1},{7379,4,0,-1},{7379,5,0,-1},{7384,4,0,-1}, +{7384,5,0,-1},{7388,4,0,-1},{7388,5,0,-1},{7392,4,0,-1},{7392,5,0,-1}, +{7397,4,0,-1},{7397,5,0,-1},{7401,4,0,-1},{7401,5,0,-1},{7405,4,0,-1}, +{7405,5,0,-1},{7410,4,0,-1},{7410,5,0,-1},{7414,4,0,-1},{7414,5,0,-1}, +{7344,4,0,-1},{7418,4,0,-1},{7418,5,0,-1},{7423,4,0,-1},{7423,5,0,-1}, +{7427,4,0,-1},{7427,5,0,-1},{7357,5,0,-1},{7431,4,0,-1},{7431,5,0,-1}, +{7436,4,0,-1},{7436,5,0,-1},{7440,4,0,-1},{7440,5,0,-1},{7444,4,0,-1}, +{7444,5,0,-1},{7449,4,0,-1},{7449,5,0,-1},{7453,4,0,-1},{7453,5,0,-1}, +{7457,4,0,-1},{7457,5,0,-1},{7462,4,0,-1},{7462,5,0,-1},{7466,4,0,-1}, +{7466,5,0,-1},{7470,4,0,-1},{7470,5,0,-1},{7475,4,0,-1},{7475,5,0,-1}, +{7479,4,0,-1},{7479,5,0,-1},{7483,4,0,-1},{7483,5,0,-1},{7488,4,0,-1}, +{7488,5,0,-1},{7492,4,0,-1},{7492,5,0,-1},{7496,4,0,-1},{7496,5,0,-1}, +{7501,4,0,-1},{7501,5,0,-1},{7505,4,0,-1},{7505,5,0,-1},{7509,4,0,-1}, +{7509,5,0,-1},{7514,4,0,-1},{7514,5,0,-1},{7518,4,0,-1},{7518,5,0,-1}, +{7448,4,0,-1},{7522,4,0,-1},{7522,5,0,-1},{7527,4,0,-1},{7527,5,0,-1}, +{7531,4,0,-1},{7531,5,0,-1},{7461,5,0,-1},{7535,4,0,-1},{7535,5,0,-1}, +{7540,4,0,-1},{7540,5,0,-1},{7544,4,0,-1},{7544,5,0,-1},{7548,4,0,-1}, +{7548,5,0,-1},{7553,4,0,-1},{7553,5,0,-1},{7557,4,0,-1},{7557,5,0,-1}, +{7561,4,0,-1},{7561,5,0,-1},{7566,4,0,-1},{7566,5,0,-1},{7570,4,0,-1}, +{7570,5,0,-1},{7574,4,0,-1},{7574,5,0,-1},{7579,4,0,-1},{7579,5,0,-1}, +{7583,4,0,-1},{7583,5,0,-1},{7587,4,0,-1},{7587,5,0,-1},{7592,4,0,-1}, +{7592,5,0,-1},{7596,4,0,-1},{7596,5,0,-1},{7600,4,0,-1},{7600,5,0,-1}, +{7605,4,0,-1},{7605,5,0,-1},{7609,4,0,-1},{7609,5,0,-1},{7613,4,0,-1}, +{7613,5,0,-1},{7618,4,0,-1},{7618,5,0,-1},{7622,4,0,-1},{7622,5,0,-1}, +{7552,4,0,-1},{7626,4,0,-1},{7626,5,0,-1},{7631,4,0,-1},{7631,5,0,-1}, +{7635,4,0,-1},{7635,5,0,-1},{7565,5,0,-1},{7639,4,0,-1},{7639,5,0,-1}, +{7644,4,0,-1},{7644,5,0,-1},{7648,4,0,-1},{7648,5,0,-1},{7652,4,0,-1}, +{7652,5,0,-1},{7657,4,0,-1},{7657,5,0,-1},{7661,4,0,-1},{7661,5,0,-1}, +{7665,4,0,-1},{7665,5,0,-1},{7670,4,0,-1},{7670,5,0,-1},{7674,4,0,-1}, +{7674,5,0,-1},{7678,4,0,-1},{7678,5,0,-1},{7683,4,0,-1},{7683,5,0,-1}, +{7687,4,0,-1},{7687,5,0,-1},{7691,4,0,-1},{7691,5,0,-1},{7696,4,0,-1}, +{7696,5,0,-1},{7700,4,0,-1},{7700,5,0,-1},{7704,4,0,-1},{7704,5,0,-1}, +{7709,4,0,-1},{7709,5,0,-1},{7713,4,0,-1},{7713,5,0,-1},{7717,4,0,-1}, +{7717,5,0,-1},{7722,4,0,-1},{7722,5,0,-1},{7726,4,0,-1},{7726,5,0,-1}, +{7656,4,0,-1},{7730,4,0,-1},{7730,5,0,-1},{7735,4,0,-1},{7735,5,0,-1}, +{7739,4,0,-1},{7739,5,0,-1},{7669,5,0,-1},{7743,4,0,-1},{7743,5,0,-1}, +{7748,4,0,-1},{7748,5,0,-1},{7752,4,0,-1},{7752,5,0,-1},{7756,4,0,-1}, +{7756,5,0,-1},{7761,4,0,-1},{7761,5,0,-1},{7765,4,0,-1},{7765,5,0,-1}, +{7769,4,0,-1},{7769,5,0,-1},{7774,4,0,-1},{7774,5,0,-1},{7778,4,0,-1}, +{7778,5,0,-1},{7782,4,0,-1},{7782,5,0,-1},{7787,4,0,-1},{7787,5,0,-1}, +{7791,4,0,-1},{7791,5,0,-1},{7795,4,0,-1},{7795,5,0,-1},{7800,4,0,-1}, +{7800,5,0,-1},{7804,4,0,-1},{7804,5,0,-1},{7808,4,0,-1},{7808,5,0,-1}, +{7813,4,0,-1},{7813,5,0,-1},{7817,4,0,-1},{7817,5,0,-1},{7821,4,0,-1}, +{7821,5,0,-1},{7826,4,0,-1},{7826,5,0,-1},{7830,4,0,-1},{7830,5,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7834,5,0,-1},{7839,4,0,-1},{7839,5,0,-1}, +{7843,4,0,-1},{7843,5,0,-1},{7773,5,0,-1},{7847,4,0,-1},{7847,5,0,-1}, +{7852,4,0,-1},{7852,5,0,-1},{7856,4,0,-1},{7856,5,0,-1},{7860,4,0,-1}, +{7860,5,0,-1},{7865,4,0,-1},{7865,5,0,-1},{7869,4,0,-1},{7869,5,0,-1}, +{7873,4,0,-1},{7873,5,0,-1},{7878,4,0,-1},{7878,5,0,-1},{7882,4,0,-1}, +{7882,5,0,-1},{7886,4,0,-1},{7886,5,0,-1},{7891,4,0,-1},{7891,5,0,-1}, +{7895,4,0,-1},{7895,5,0,-1},{7899,4,0,-1},{7899,5,0,-1},{7904,4,0,-1}, +{7904,5,0,-1},{7908,4,0,-1},{7908,5,0,-1},{7912,4,0,-1},{7912,5,0,-1}, +{7917,4,0,-1},{7917,5,0,-1},{7921,4,0,-1},{7921,5,0,-1},{7925,4,0,-1}, +{7925,5,0,-1},{7930,4,0,-1},{7930,5,0,-1},{7934,4,0,-1},{7934,5,0,-1}, +{7864,4,0,-1},{7938,4,0,-1},{7938,5,0,-1},{7943,4,0,-1},{7943,5,0,-1}, +{7947,4,0,-1},{7947,5,0,-1},{7877,5,0,-1},{7951,4,0,-1},{7951,5,0,-1}, +{7956,4,0,-1},{7956,5,0,-1},{7960,4,0,-1},{7960,5,0,-1},{7964,4,0,-1}, +{7964,5,0,-1},{7969,4,0,-1},{7969,5,0,-1},{7973,4,0,-1},{7973,5,0,-1}, +{7977,4,0,-1},{7977,5,0,-1},{7982,4,0,-1},{7982,5,0,-1},{7986,4,0,-1}, +{7986,5,0,-1},{7990,4,0,-1},{7990,5,0,-1},{7995,4,0,-1},{7995,5,0,-1}, +{7999,4,0,-1},{7999,5,0,-1},{8003,4,0,-1},{8003,5,0,-1},{8008,4,0,-1}, +{8008,5,0,-1},{8012,4,0,-1},{8012,5,0,-1},{8016,4,0,-1},{8016,5,0,-1}, +{8021,4,0,-1},{8021,5,0,-1},{8025,4,0,-1},{8025,5,0,-1},{8029,4,0,-1}, +{8029,5,0,-1},{8034,4,0,-1},{8034,5,0,-1},{8038,4,0,-1},{8038,5,0,-1}, +{7968,4,0,-1},{8042,4,0,-1},{8042,5,0,-1},{8047,4,0,-1},{8047,5,0,-1}, +{8051,4,0,-1},{8051,5,0,-1},{7981,5,0,-1},{8055,4,0,-1},{8055,5,0,-1}, +{8060,4,0,-1},{8060,5,0,-1},{8064,4,0,-1},{8064,5,0,-1},{8068,4,0,-1}, +{8068,5,0,-1},{8073,4,0,-1},{8073,5,0,-1},{8077,4,0,-1},{8077,5,0,-1}, +{8081,4,0,-1},{8081,5,0,-1},{8086,4,0,-1},{8086,5,0,-1},{8090,4,0,-1}, +{8090,5,0,-1},{8094,4,0,-1},{8094,5,0,-1},{8099,4,0,-1},{8099,5,0,-1}, +{8103,4,0,-1},{8103,5,0,-1},{8107,4,0,-1},{8107,5,0,-1},{8112,4,0,-1}, +{8112,5,0,-1},{8116,4,0,-1},{8116,5,0,-1},{8120,4,0,-1},{8120,5,0,-1}, +{8125,4,0,-1},{8125,5,0,-1},{8129,4,0,-1},{8129,5,0,-1},{8133,4,0,-1}, +{8133,5,0,-1},{8138,4,0,-1},{8138,5,0,-1},{8142,4,0,-1},{8142,5,0,-1}, +{8072,4,0,-1},{8146,4,0,-1},{8146,5,0,-1},{8151,4,0,-1},{8151,5,0,-1}, +{8155,4,0,-1},{8155,5,0,-1},{8085,5,0,-1},{8159,4,0,-1},{8159,5,0,-1}, +{8164,4,0,-1},{8164,5,0,-1},{8168,4,0,-1},{8168,5,0,-1},{8172,4,0,-1}, +{8172,5,0,-1},{8177,4,0,-1},{8177,5,0,-1},{8181,4,0,-1},{8181,5,0,-1}, +{8185,4,0,-1},{8185,5,0,-1},{8190,4,0,-1},{8190,5,0,-1},{8194,4,0,-1}, +{8194,5,0,-1},{8198,4,0,-1},{8198,5,0,-1},{8203,4,0,-1},{8203,5,0,-1}, +{8207,4,0,-1},{8207,5,0,-1},{8211,4,0,-1},{8211,5,0,-1},{8216,4,0,-1}, +{8216,5,0,-1},{8220,4,0,-1},{8220,5,0,-1},{8224,4,0,-1},{8224,5,0,-1}, +{8229,4,0,-1},{8229,5,0,-1},{8233,4,0,-1},{8233,5,0,-1},{8237,4,0,-1}, +{8237,5,0,-1},{8242,4,0,-1},{8242,5,0,-1},{8246,4,0,-1},{8246,5,0,-1}, +{8176,4,0,-1},{8250,4,0,-1},{8250,5,0,-1},{8255,4,0,-1},{8255,5,0,-1}, +{8259,4,0,-1},{8259,5,0,-1},{8189,5,0,-1},{8263,4,0,-1},{8263,5,0,-1}, +{8268,4,0,-1},{8268,5,0,-1},{8272,4,0,-1},{8272,5,0,-1},{8276,4,0,-1}, +{8276,5,0,-1},{8281,4,0,-1},{8281,5,0,-1},{8285,4,0,-1},{8285,5,0,-1}, +{8289,4,0,-1},{8289,5,0,-1},{8294,4,0,-1},{8294,5,0,-1},{8298,4,0,-1}, +{8298,5,0,-1},{8302,4,0,-1},{8302,5,0,-1},{8307,4,0,-1},{8307,5,0,-1}, +{8311,4,0,-1},{8311,5,0,-1},{8315,4,0,-1},{8315,5,0,-1},{8320,4,0,-1}, +{8320,5,0,-1},{8324,4,0,-1},{8324,5,0,-1},{8328,4,0,-1},{8328,5,0,-1}, +{8333,4,0,-1},{8333,5,0,-1},{8337,4,0,-1},{8337,5,0,-1},{8341,4,0,-1}, +{8341,5,0,-1},{8346,4,0,-1},{8346,5,0,-1},{8350,4,0,-1},{8350,5,0,-1}, +{8280,4,0,-1},{8354,4,0,-1},{8354,5,0,-1},{8359,4,0,-1},{8359,5,0,-1}, +{8363,4,0,-1},{8363,5,0,-1},{8293,5,0,-1},{8367,4,0,-1},{8367,5,0,-1}, +{8372,4,0,-1},{8372,5,0,-1},{8376,4,0,-1},{8376,5,0,-1},{8380,4,0,-1}, +{8380,5,0,-1},{8385,4,0,-1},{8385,5,0,-1},{8389,4,0,-1},{8389,5,0,-1}, +{8393,4,0,-1},{8393,5,0,-1},{8398,4,0,-1},{8398,5,0,-1},{8402,4,0,-1}, +{8402,5,0,-1},{8406,4,0,-1},{8406,5,0,-1},{8411,4,0,-1},{8411,5,0,-1}, +{8415,4,0,-1},{8415,5,0,-1},{8419,4,0,-1},{8419,5,0,-1},{8424,4,0,-1}, +{8424,5,0,-1},{8428,4,0,-1},{8428,5,0,-1},{8432,4,0,-1},{8432,5,0,-1}, +{8437,4,0,-1},{8437,5,0,-1},{8441,4,0,-1},{8441,5,0,-1},{8445,4,0,-1}, +{8445,5,0,-1},{8450,4,0,-1},{8450,5,0,-1},{8454,4,0,-1},{8454,5,0,-1}, +{8384,4,0,-1},{8458,4,0,-1},{8458,5,0,-1},{8463,4,0,-1},{8463,5,0,-1}, +{8467,4,0,-1},{8467,5,0,-1},{8397,5,0,-1},{8471,4,0,-1},{8471,5,0,-1}, +{8476,4,0,-1},{8476,5,0,-1},{8480,4,0,-1},{8480,5,0,-1},{8484,4,0,-1}, +{8484,5,0,-1},{8489,4,0,-1},{8489,5,0,-1},{8493,4,0,-1},{8493,5,0,-1}, +{8497,4,0,-1},{8497,5,0,-1},{8502,4,0,-1},{8502,5,0,-1},{8506,4,0,-1}, +{8506,5,0,-1},{8510,4,0,-1},{8510,5,0,-1},{8515,4,0,-1},{8515,5,0,-1}, +{8519,4,0,-1},{8519,5,0,-1},{8523,4,0,-1},{8523,5,0,-1},{8528,4,0,-1}, +{8528,5,0,-1},{8532,4,0,-1},{8532,5,0,-1},{8536,4,0,-1},{8536,5,0,-1}, +{8541,4,0,-1},{8541,5,0,-1},{8545,4,0,-1},{8545,5,0,-1},{8549,4,0,-1}, +{8549,5,0,-1},{8554,4,0,-1},{8554,5,0,-1},{8558,4,0,-1},{8558,5,0,-1}, +{8488,4,0,-1},{8562,4,0,-1},{8562,5,0,-1},{8567,4,0,-1},{8567,5,0,-1}, +{8571,4,0,-1},{8571,5,0,-1},{8501,5,0,-1},{8575,4,0,-1},{8575,5,0,-1}, +{8580,4,0,-1},{8580,5,0,-1},{8584,4,0,-1},{8584,5,0,-1},{8588,4,0,-1}, +{8588,5,0,-1},{8593,4,0,-1},{8593,5,0,-1},{8597,4,0,-1},{8597,5,0,-1}, +{8601,4,0,-1},{8601,5,0,-1},{8606,4,0,-1},{8606,5,0,-1},{8610,4,0,-1}, +{8610,5,0,-1},{8614,4,0,-1},{8614,5,0,-1},{8619,4,0,-1},{8619,5,0,-1}, +{8623,4,0,-1},{8623,5,0,-1},{8627,4,0,-1},{8627,5,0,-1},{8632,4,0,-1}, +{8632,5,0,-1},{8636,4,0,-1},{8636,5,0,-1},{8640,4,0,-1},{8640,5,0,-1}, +{8645,4,0,-1},{8645,5,0,-1},{8649,4,0,-1},{8649,5,0,-1},{8653,4,0,-1}, +{8653,5,0,-1},{8658,4,0,-1},{8658,5,0,-1},{8662,4,0,-1},{8662,5,0,-1}, +{8592,4,0,-1},{8666,4,0,-1},{8666,5,0,-1},{8671,4,0,-1},{8671,5,0,-1}, +{8675,4,0,-1},{8675,5,0,-1},{8605,5,0,-1},{8679,4,0,-1},{8679,5,0,-1}, +{8684,4,0,-1},{8684,5,0,-1},{8688,4,0,-1},{8688,5,0,-1},{8692,4,0,-1}, +{8692,5,0,-1},{8697,4,0,-1},{8697,5,0,-1},{8701,4,0,-1},{8701,5,0,-1}, +{8705,4,0,-1},{8705,5,0,-1},{8710,4,0,-1},{8710,5,0,-1},{8714,4,0,-1}, +{8714,5,0,-1},{8718,4,0,-1},{8718,5,0,-1},{8723,4,0,-1},{8723,5,0,-1}, +{8727,4,0,-1},{8727,5,0,-1},{8731,4,0,-1},{8731,5,0,-1},{8736,4,0,-1}, +{8736,5,0,-1},{8740,4,0,-1},{8740,5,0,-1},{8744,4,0,-1},{8744,5,0,-1}, +{8749,4,0,-1},{8749,5,0,-1},{8753,4,0,-1},{8753,5,0,-1},{8757,4,0,-1}, +{8757,5,0,-1},{8762,4,0,-1},{8762,5,0,-1},{8766,4,0,-1},{8766,5,0,-1}, +{8696,4,0,-1},{8770,4,0,-1},{8770,5,0,-1},{8775,4,0,-1},{8775,5,0,-1}, +{8779,4,0,-1},{8779,5,0,-1},{8709,5,0,-1},{8783,4,0,-1},{8783,5,0,-1}, +{8788,4,0,-1},{8788,5,0,-1},{8792,4,0,-1},{8792,5,0,-1},{8796,4,0,-1}, +{8796,5,0,-1},{8801,4,0,-1},{8801,5,0,-1},{8805,4,0,-1},{8805,5,0,-1}, +{8809,4,0,-1},{8809,5,0,-1},{8814,4,0,-1},{8814,5,0,-1},{8818,4,0,-1}, +{8818,5,0,-1},{8822,4,0,-1},{8822,5,0,-1},{8827,4,0,-1},{8827,5,0,-1}, +{8831,4,0,-1},{8831,5,0,-1},{8835,4,0,-1},{8835,5,0,-1},{8840,4,0,-1}, +{8840,5,0,-1},{8844,4,0,-1},{8844,5,0,-1},{8848,4,0,-1},{8848,5,0,-1}, +{8853,4,0,-1},{8853,5,0,-1},{8857,4,0,-1},{8857,5,0,-1},{8861,4,0,-1}, +{8861,5,0,-1},{8866,4,0,-1},{8866,5,0,-1},{8870,4,0,-1},{8870,5,0,-1}, +{8800,4,0,-1},{8874,4,0,-1},{8874,5,0,-1},{8879,4,0,-1},{8879,5,0,-1}, +{8883,4,0,-1},{8883,5,0,-1},{8813,5,0,-1},{8887,4,0,-1},{8887,5,0,-1}, +{8892,4,0,-1},{8892,5,0,-1},{8896,4,0,-1},{8896,5,0,-1},{8900,4,0,-1}, +{8900,5,0,-1},{8905,4,0,-1},{8905,5,0,-1},{8909,4,0,-1},{8909,5,0,-1}, +{8913,4,0,-1},{8913,5,0,-1},{8918,4,0,-1},{8918,5,0,-1},{8922,4,0,-1}, +{8922,5,0,-1},{8926,4,0,-1},{8926,5,0,-1},{8931,4,0,-1},{8931,5,0,-1}, +{8935,4,0,-1},{8935,5,0,-1},{8939,4,0,-1},{8939,5,0,-1},{8944,4,0,-1}, +{8944,5,0,-1},{8948,4,0,-1},{8948,5,0,-1},{8952,4,0,-1},{8952,5,0,-1}, +{8957,4,0,-1},{8957,5,0,-1},{8961,4,0,-1},{8961,5,0,-1},{8965,4,0,-1}, +{8965,5,0,-1},{8970,4,0,-1},{8970,5,0,-1},{8974,4,0,-1},{8974,5,0,-1}, +{8904,4,0,-1},{8978,4,0,-1},{8978,5,0,-1},{8983,4,0,-1},{8983,5,0,-1}, +{8987,4,0,-1},{8987,5,0,-1},{8917,5,0,-1},{8991,4,0,-1},{8991,5,0,-1}, +{8996,4,0,-1},{8996,5,0,-1},{9000,4,0,-1},{9000,5,0,-1},{9004,4,0,-1}, +{9004,5,0,-1},{9009,4,0,-1},{9009,5,0,-1},{9013,4,0,-1},{9013,5,0,-1}, +{9017,4,0,-1},{9017,5,0,-1},{9022,4,0,-1},{9022,5,0,-1},{9026,4,0,-1}, +{9026,5,0,-1},{9030,4,0,-1},{9030,5,0,-1},{9035,4,0,-1},{9035,5,0,-1}, +{9039,4,0,-1},{9039,5,0,-1},{9043,4,0,-1},{9043,5,0,-1},{9048,4,0,-1}, +{9048,5,0,-1},{9052,4,0,-1},{9052,5,0,-1},{9056,4,0,-1},{9056,5,0,-1}, +{9061,4,0,-1},{9061,5,0,-1},{9065,4,0,-1},{9065,5,0,-1},{9069,4,0,-1}, +{9069,5,0,-1},{9074,4,0,-1},{9074,5,0,-1},{9078,4,0,-1},{9078,5,0,-1}, +{9008,4,0,-1},{9082,4,0,-1},{9082,5,0,-1},{9087,4,0,-1},{9087,5,0,-1}, +{9091,4,0,-1},{9091,5,0,-1},{9021,5,0,-1},{9095,4,0,-1},{9095,5,0,-1}, +{9100,4,0,-1},{9100,5,0,-1},{9104,4,0,-1},{9104,5,0,-1},{9108,4,0,-1}, +{9108,5,0,-1},{9113,4,0,-1},{9113,5,0,-1},{9117,4,0,-1},{9117,5,0,-1}, +{9121,4,0,-1},{9121,5,0,-1},{9126,4,0,-1},{9126,5,0,-1},{9130,4,0,-1}, +{9130,5,0,-1},{9134,4,0,-1},{9134,5,0,-1},{9139,4,0,-1},{9139,5,0,-1}, +{9143,4,0,-1},{9143,5,0,-1},{9147,4,0,-1},{9147,5,0,-1},{9152,4,0,-1}, +{9152,5,0,-1},{9156,4,0,-1},{9156,5,0,-1},{9160,4,0,-1},{9160,5,0,-1}, +{9165,4,0,-1},{9165,5,0,-1},{9169,4,0,-1},{9169,5,0,-1},{9173,4,0,-1}, +{9173,5,0,-1},{9178,4,0,-1},{9178,5,0,-1},{9182,4,0,-1},{9182,5,0,-1}, +{9112,4,0,-1},{9186,4,0,-1},{9186,5,0,-1},{9191,4,0,-1},{9191,5,0,-1}, +{9195,4,0,-1},{9195,5,0,-1},{9125,5,0,-1},{9199,4,0,-1},{9199,5,0,-1}, +{9204,4,0,-1},{9204,5,0,-1},{9208,4,0,-1},{9208,5,0,-1},{9212,4,0,-1}, +{9212,5,0,-1},{9217,4,0,-1},{9217,5,0,-1},{9221,4,0,-1},{9221,5,0,-1}, +{9225,4,0,-1},{9225,5,0,-1},{9230,4,0,-1},{9230,5,0,-1},{9234,4,0,-1}, +{9234,5,0,-1},{9238,4,0,-1},{9238,5,0,-1},{9243,4,0,-1},{9243,5,0,-1}, +{9247,4,0,-1},{9247,5,0,-1},{9251,4,0,-1},{9251,5,0,-1},{9256,4,0,-1}, +{9256,5,0,-1},{9260,4,0,-1},{9260,5,0,-1},{9264,4,0,-1},{9264,5,0,-1}, +{9269,4,0,-1},{9269,5,0,-1},{9273,4,0,-1},{9273,5,0,-1},{9277,4,0,-1}, +{9277,5,0,-1},{9282,4,0,-1},{9282,5,0,-1},{9286,4,0,-1},{9286,5,0,-1}, +{9216,4,0,-1},{9290,4,0,-1},{9290,5,0,-1},{9295,4,0,-1},{9295,5,0,-1}, +{9299,4,0,-1},{9299,5,0,-1},{9229,5,0,-1},{9303,4,0,-1},{9303,5,0,-1}, +{9308,4,0,-1},{9308,5,0,-1},{9312,4,0,-1},{9312,5,0,-1},{9316,4,0,-1}, +{9316,5,0,-1},{9321,4,0,-1},{9321,5,0,-1},{9325,4,0,-1},{9325,5,0,-1}, +{9329,4,0,-1},{9329,5,0,-1},{9334,4,0,-1},{9334,5,0,-1},{9338,4,0,-1}, +{9338,5,0,-1},{9342,4,0,-1},{9342,5,0,-1},{9347,4,0,-1},{9347,5,0,-1}, +{9351,4,0,-1},{9351,5,0,-1},{9355,4,0,-1},{9355,5,0,-1},{9360,4,0,-1}, +{9360,5,0,-1},{9364,4,0,-1},{9364,5,0,-1},{9368,4,0,-1},{9368,5,0,-1}, +{9373,4,0,-1},{9373,5,0,-1},{9377,4,0,-1},{9377,5,0,-1},{9381,4,0,-1}, +{9381,5,0,-1},{9386,4,0,-1},{9386,5,0,-1},{9390,4,0,-1},{9390,5,0,-1}, +{9320,4,0,-1},{9394,4,0,-1},{9394,5,0,-1},{9399,4,0,-1},{9399,5,0,-1}, +{9403,4,0,-1},{9403,5,0,-1},{9333,5,0,-1},{9407,4,0,-1},{9407,5,0,-1}, +{9412,4,0,-1},{9412,5,0,-1},{9416,4,0,-1},{9416,5,0,-1},{9420,4,0,-1}, +{9420,5,0,-1},{9425,4,0,-1},{9425,5,0,-1},{9429,4,0,-1},{9429,5,0,-1}, +{9433,4,0,-1},{9433,5,0,-1},{9438,4,0,-1},{9438,5,0,-1},{9442,4,0,-1}, +{9442,5,0,-1},{9446,4,0,-1},{9446,5,0,-1},{9451,4,0,-1},{9451,5,0,-1}, +{9455,4,0,-1},{9455,5,0,-1},{9459,4,0,-1},{9459,5,0,-1},{9464,4,0,-1}, +{9464,5,0,-1},{9468,4,0,-1},{9468,5,0,-1},{9472,4,0,-1},{9472,5,0,-1}, +{9477,4,0,-1},{9477,5,0,-1},{9481,4,0,-1},{9481,5,0,-1},{9485,4,0,-1}, +{9485,5,0,-1},{9490,4,0,-1},{9490,5,0,-1},{9494,4,0,-1},{9494,5,0,-1}, +{9424,4,0,-1},{9498,4,0,-1},{9498,5,0,-1},{9503,4,0,-1},{9503,5,0,-1}, +{9507,4,0,-1},{9507,5,0,-1},{9437,5,0,-1},{9511,4,0,-1},{9511,5,0,-1}, +{9516,4,0,-1},{9516,5,0,-1},{9520,4,0,-1},{9520,5,0,-1},{9524,4,0,-1}, +{9524,5,0,-1},{9529,4,0,-1},{9529,5,0,-1},{9533,4,0,-1},{9533,5,0,-1}, +{9537,4,0,-1},{9537,5,0,-1},{9542,4,0,-1},{9542,5,0,-1},{9546,4,0,-1}, +{9546,5,0,-1},{9550,4,0,-1},{9550,5,0,-1},{9555,4,0,-1},{9555,5,0,-1}, +{9559,4,0,-1},{9559,5,0,-1},{9563,4,0,-1},{9563,5,0,-1},{9568,4,0,-1}, +{9568,5,0,-1},{9572,4,0,-1},{9572,5,0,-1},{9576,4,0,-1},{9576,5,0,-1}, +{9581,4,0,-1},{9581,5,0,-1},{9585,4,0,-1},{9585,5,0,-1},{9589,4,0,-1}, +{9589,5,0,-1},{9594,4,0,-1},{9594,5,0,-1},{9598,4,0,-1},{9598,5,0,-1}, +{9528,4,0,-1},{9602,4,0,-1},{9602,5,0,-1},{9607,4,0,-1},{9607,5,0,-1}, +{9611,4,0,-1},{9611,5,0,-1},{9541,5,0,-1},{9615,4,0,-1},{9615,5,0,-1}, +{9620,4,0,-1},{9620,5,0,-1},{9624,4,0,-1},{9624,5,0,-1},{9628,4,0,-1}, +{9628,5,0,-1},{9633,4,0,-1},{9633,5,0,-1},{9637,4,0,-1},{9637,5,0,-1}, +{9641,4,0,-1},{9641,5,0,-1},{9646,4,0,-1},{9646,5,0,-1},{9650,4,0,-1}, +{9650,5,0,-1},{9654,4,0,-1},{9654,5,0,-1},{9659,4,0,-1},{9659,5,0,-1}, +{9663,4,0,-1},{9663,5,0,-1},{9667,4,0,-1},{9667,5,0,-1},{9672,4,0,-1}, +{9672,5,0,-1},{9676,4,0,-1},{9676,5,0,-1},{9680,4,0,-1},{9680,5,0,-1}, +{9685,4,0,-1},{9689,4,0,-1},{9689,5,0,-1},{9693,4,0,-1},{9698,4,0,-1}, +{9702,4,0,-1},{9632,4,0,-1},{9706,4,0,-1},{9706,5,0,-1},{9711,4,0,-1}, +{9711,5,0,-1},{9715,4,0,-1},{9715,5,0,-1},{9645,5,0,-1},{9719,4,0,-1}, +{9719,5,0,-1},{9724,4,0,-1},{9724,5,0,-1},{9728,4,0,-1},{9728,5,0,-1}, +{9732,4,0,-1},{9737,4,0,-1},{9741,4,0,-1},{9741,5,0,-1},{9745,4,0,-1}, +{9745,5,0,-1},{9750,4,0,-1},{9754,4,0,-1},{9758,4,0,-1},{9763,4,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on full rate channels TS6 and TS7 */ +struct fn_sample test_fn_tch_f_ts_6_7[] = { +{4753,0,1,-1},{4784,0,1,-1},{4835,0,1,-1},{4855,0,1,-1},{4886,0,1,-1}, +{4937,0,1,-1},{4957,0,1,-1},{4988,0,1,-1},{5039,0,1,-1},{5090,0,1,-1}, +{5141,0,1,-1},{5198,0,2,-1},{5208,0,2,-1},{5249,0,2,-1},{5300,0,2,-1}, +{5310,0,2,-1},{5351,0,2,-1},{5402,0,2,-1},{5453,0,2,-1},{5504,0,2,-1}, +{5555,0,2,-1},{8597,6,0,-1},{8627,6,0,-1},{8632,6,0,-1},{8636,6,0,-1}, +{8640,6,0,-1},{8645,6,0,-1},{8649,6,0,-1},{8653,6,0,-1},{8658,6,0,-1}, +{8662,6,0,-1},{8666,6,0,-1},{8671,6,0,-1},{8675,6,0,-1},{8679,6,0,-1}, +{8684,6,0,-1},{8688,6,0,-1},{8618,6,0,-1},{8692,6,0,-1},{8697,6,0,-1}, +{8701,6,0,-1},{8705,6,0,-1},{8710,6,0,-1},{8714,6,0,-1},{8718,6,0,-1}, +{8723,6,0,-1},{8727,6,0,-1},{8731,6,0,-1},{8736,6,0,-1},{8740,6,0,-1}, +{8744,6,0,-1},{8749,6,0,-1},{8753,6,0,-1},{8757,6,0,-1},{8762,6,0,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8775,6,0,-1},{8779,6,0,-1},{8783,6,0,-1}, +{8788,6,0,-1},{8792,6,0,-1},{8722,6,0,-1},{8796,6,0,-1},{8801,6,0,-1}, +{8805,6,0,-1},{8809,6,0,-1},{8814,6,0,-1},{8818,6,0,-1},{8822,6,0,-1}, +{8827,6,0,-1},{8831,6,0,-1},{8835,6,0,-1},{8840,6,0,-1},{8844,6,0,-1}, +{8848,6,0,-1},{8853,6,0,-1},{8857,6,0,-1},{8861,6,0,-1},{8866,6,0,-1}, +{8870,6,0,-1},{8874,6,0,-1},{8874,7,0,-1},{8879,6,0,-1},{8879,7,0,-1}, +{8883,6,0,-1},{8883,7,0,-1},{8887,6,0,-1},{8887,7,0,-1},{8892,6,0,-1}, +{8892,7,0,-1},{8896,6,0,-1},{8896,7,0,-1},{8826,6,0,-1},{8900,6,0,-1}, +{8900,7,0,-1},{8905,6,0,-1},{8905,7,0,-1},{8909,6,0,-1},{8909,7,0,-1}, +{8913,6,0,-1},{8913,7,0,-1},{8918,6,0,-1},{8918,7,0,-1},{8922,6,0,-1}, +{8922,7,0,-1},{8926,6,0,-1},{8926,7,0,-1},{8931,6,0,-1},{8931,7,0,-1}, +{8935,6,0,-1},{8935,7,0,-1},{8939,6,0,-1},{8939,7,0,-1},{8944,6,0,-1}, +{8944,7,0,-1},{8948,6,0,-1},{8948,7,0,-1},{8952,6,0,-1},{8952,7,0,-1}, +{8957,6,0,-1},{8957,7,0,-1},{8961,6,0,-1},{8961,7,0,-1},{8965,6,0,-1}, +{8965,7,0,-1},{8970,6,0,-1},{8970,7,0,-1},{8974,6,0,-1},{8974,7,0,-1}, +{8978,6,0,-1},{8978,7,0,-1},{8983,6,0,-1},{8983,7,0,-1},{8987,6,0,-1}, +{8987,7,0,-1},{8991,6,0,-1},{8991,7,0,-1},{8996,6,0,-1},{8996,7,0,-1}, +{9000,6,0,-1},{9000,7,0,-1},{8930,6,0,-1},{9004,6,0,-1},{9004,7,0,-1}, +{9009,6,0,-1},{9009,7,0,-1},{9013,6,0,-1},{9013,7,0,-1},{8943,7,0,-1}, +{9017,6,0,-1},{9017,7,0,-1},{9022,6,0,-1},{9022,7,0,-1},{9026,6,0,-1}, +{9026,7,0,-1},{9030,6,0,-1},{9030,7,0,-1},{9035,6,0,-1},{9035,7,0,-1}, +{9039,6,0,-1},{9039,7,0,-1},{9043,6,0,-1},{9043,7,0,-1},{9048,6,0,-1}, +{9048,7,0,-1},{9052,6,0,-1},{9052,7,0,-1},{9056,6,0,-1},{9056,7,0,-1}, +{9061,6,0,-1},{9061,7,0,-1},{9065,6,0,-1},{9065,7,0,-1},{9069,6,0,-1}, +{9069,7,0,-1},{9074,6,0,-1},{9074,7,0,-1},{9078,6,0,-1},{9078,7,0,-1}, +{9082,6,0,-1},{9082,7,0,-1},{9087,6,0,-1},{9087,7,0,-1},{9091,6,0,-1}, +{9091,7,0,-1},{9095,6,0,-1},{9095,7,0,-1},{9100,6,0,-1},{9100,7,0,-1}, +{9104,6,0,-1},{9104,7,0,-1},{9034,6,0,-1},{9108,6,0,-1},{9108,7,0,-1}, +{9113,6,0,-1},{9113,7,0,-1},{9117,6,0,-1},{9117,7,0,-1},{9047,7,0,-1}, +{9121,6,0,-1},{9121,7,0,-1},{9126,6,0,-1},{9126,7,0,-1},{9130,6,0,-1}, +{9130,7,0,-1},{9134,6,0,-1},{9134,7,0,-1},{9139,6,0,-1},{9139,7,0,-1}, +{9143,6,0,-1},{9143,7,0,-1},{9147,6,0,-1},{9147,7,0,-1},{9152,6,0,-1}, +{9152,7,0,-1},{9156,6,0,-1},{9156,7,0,-1},{9160,6,0,-1},{9160,7,0,-1}, +{9165,6,0,-1},{9165,7,0,-1},{9169,6,0,-1},{9169,7,0,-1},{9173,6,0,-1}, +{9173,7,0,-1},{9178,6,0,-1},{9178,7,0,-1},{9182,6,0,-1},{9182,7,0,-1}, +{9186,6,0,-1},{9186,7,0,-1},{9191,6,0,-1},{9191,7,0,-1},{9195,6,0,-1}, +{9195,7,0,-1},{9199,6,0,-1},{9199,7,0,-1},{9204,6,0,-1},{9204,7,0,-1}, +{9208,6,0,-1},{9208,7,0,-1},{9138,6,0,-1},{9212,6,0,-1},{9212,7,0,-1}, +{9217,6,0,-1},{9217,7,0,-1},{9221,6,0,-1},{9221,7,0,-1},{9151,7,0,-1}, +{9225,6,0,-1},{9225,7,0,-1},{9230,6,0,-1},{9230,7,0,-1},{9234,6,0,-1}, +{9234,7,0,-1},{9238,6,0,-1},{9238,7,0,-1},{9243,6,0,-1},{9243,7,0,-1}, +{9247,6,0,-1},{9247,7,0,-1},{9251,6,0,-1},{9251,7,0,-1},{9256,6,0,-1}, +{9256,7,0,-1},{9260,6,0,-1},{9260,7,0,-1},{9264,6,0,-1},{9264,7,0,-1}, +{9269,6,0,-1},{9269,7,0,-1},{9273,6,0,-1},{9273,7,0,-1},{9277,6,0,-1}, +{9277,7,0,-1},{9282,6,0,-1},{9282,7,0,-1},{9286,6,0,-1},{9286,7,0,-1}, +{9290,6,0,-1},{9290,7,0,-1},{9295,6,0,-1},{9295,7,0,-1},{9299,6,0,-1}, +{9299,7,0,-1},{9303,6,0,-1},{9303,7,0,-1},{9308,6,0,-1},{9308,7,0,-1}, +{9312,6,0,-1},{9312,7,0,-1},{9242,6,0,-1},{9316,6,0,-1},{9316,7,0,-1}, +{9321,6,0,-1},{9321,7,0,-1},{9325,6,0,-1},{9325,7,0,-1},{9255,7,0,-1}, +{9329,6,0,-1},{9329,7,0,-1},{9334,6,0,-1},{9334,7,0,-1},{9338,6,0,-1}, +{9338,7,0,-1},{9342,6,0,-1},{9342,7,0,-1},{9347,6,0,-1},{9347,7,0,-1}, +{9351,6,0,-1},{9351,7,0,-1},{9355,6,0,-1},{9355,7,0,-1},{9360,6,0,-1}, +{9360,7,0,-1},{9364,6,0,-1},{9364,7,0,-1},{9368,6,0,-1},{9368,7,0,-1}, +{9373,6,0,-1},{9373,7,0,-1},{9377,6,0,-1},{9377,7,0,-1},{9381,6,0,-1}, +{9381,7,0,-1},{9386,6,0,-1},{9386,7,0,-1},{9390,6,0,-1},{9390,7,0,-1}, +{9394,6,0,-1},{9394,7,0,-1},{9399,6,0,-1},{9399,7,0,-1},{9403,6,0,-1}, +{9403,7,0,-1},{9407,6,0,-1},{9407,7,0,-1},{9412,6,0,-1},{9412,7,0,-1}, +{9416,6,0,-1},{9416,7,0,-1},{9346,6,0,-1},{9420,6,0,-1},{9420,7,0,-1}, +{9425,6,0,-1},{9425,7,0,-1},{9429,6,0,-1},{9429,7,0,-1},{9359,7,0,-1}, +{9433,6,0,-1},{9433,7,0,-1},{9438,6,0,-1},{9438,7,0,-1},{9442,6,0,-1}, +{9442,7,0,-1},{9446,6,0,-1},{9446,7,0,-1},{9451,6,0,-1},{9451,7,0,-1}, +{9455,6,0,-1},{9455,7,0,-1},{9459,6,0,-1},{9459,7,0,-1},{9464,6,0,-1}, +{9464,7,0,-1},{9468,6,0,-1},{9468,7,0,-1},{9472,6,0,-1},{9472,7,0,-1}, +{9477,6,0,-1},{9477,7,0,-1},{9481,6,0,-1},{9481,7,0,-1},{9485,6,0,-1}, +{9485,7,0,-1},{9490,6,0,-1},{9490,7,0,-1},{9494,6,0,-1},{9494,7,0,-1}, +{9498,6,0,-1},{9498,7,0,-1},{9503,6,0,-1},{9503,7,0,-1},{9507,6,0,-1}, +{9507,7,0,-1},{9511,6,0,-1},{9511,7,0,-1},{9516,6,0,-1},{9516,7,0,-1}, +{9520,6,0,-1},{9520,7,0,-1},{9450,6,0,-1},{9524,6,0,-1},{9524,7,0,-1}, +{9529,6,0,-1},{9529,7,0,-1},{9533,6,0,-1},{9533,7,0,-1},{9463,7,0,-1}, +{9537,6,0,-1},{9537,7,0,-1},{9542,6,0,-1},{9542,7,0,-1},{9546,6,0,-1}, +{9546,7,0,-1},{9550,6,0,-1},{9550,7,0,-1},{9555,6,0,-1},{9555,7,0,-1}, +{9559,6,0,-1},{9559,7,0,-1},{9563,6,0,-1},{9563,7,0,-1},{9568,6,0,-1}, +{9568,7,0,-1},{9572,6,0,-1},{9572,7,0,-1},{9576,6,0,-1},{9576,7,0,-1}, +{9581,6,0,-1},{9581,7,0,-1},{9585,6,0,-1},{9585,7,0,-1},{9589,6,0,-1}, +{9589,7,0,-1},{9594,6,0,-1},{9594,7,0,-1},{9598,6,0,-1},{9598,7,0,-1}, +{9602,6,0,-1},{9602,7,0,-1},{9607,6,0,-1},{9607,7,0,-1},{9611,6,0,-1}, +{9611,7,0,-1},{9615,6,0,-1},{9615,7,0,-1},{9620,6,0,-1},{9620,7,0,-1}, +{9624,6,0,-1},{9624,7,0,-1},{9554,6,0,-1},{9628,6,0,-1},{9628,7,0,-1}, +{9633,6,0,-1},{9633,7,0,-1},{9637,6,0,-1},{9637,7,0,-1},{9567,7,0,-1}, +{9641,6,0,-1},{9641,7,0,-1},{9646,6,0,-1},{9646,7,0,-1},{9650,6,0,-1}, +{9650,7,0,-1},{9654,6,0,-1},{9654,7,0,-1},{9659,6,0,-1},{9659,7,0,-1}, +{9663,6,0,-1},{9663,7,0,-1},{9667,6,0,-1},{9667,7,0,-1},{9672,6,0,-1}, +{9672,7,0,-1},{9676,6,0,-1},{9676,7,0,-1},{9680,6,0,-1},{9680,7,0,-1}, +{9685,6,0,-1},{9685,7,0,-1},{9689,6,0,-1},{9689,7,0,-1},{9693,6,0,-1}, +{9693,7,0,-1},{9698,6,0,-1},{9698,7,0,-1},{9702,6,0,-1},{9702,7,0,-1}, +{9706,6,0,-1},{9706,7,0,-1},{9711,6,0,-1},{9711,7,0,-1},{9715,6,0,-1}, +{9715,7,0,-1},{9719,6,0,-1},{9719,7,0,-1},{9724,6,0,-1},{9724,7,0,-1}, +{9728,6,0,-1},{9728,7,0,-1},{9658,6,0,-1},{9732,6,0,-1},{9732,7,0,-1}, +{9737,6,0,-1},{9737,7,0,-1},{9741,6,0,-1},{9741,7,0,-1},{9671,7,0,-1}, +{9745,6,0,-1},{9745,7,0,-1},{9750,6,0,-1},{9750,7,0,-1},{9754,6,0,-1}, +{9754,7,0,-1},{9758,6,0,-1},{9758,7,0,-1},{9763,6,0,-1},{9763,7,0,-1}, +{9767,6,0,-1},{9767,7,0,-1},{9771,6,0,-1},{9771,7,0,-1},{9776,6,0,-1}, +{9776,7,0,-1},{9780,6,0,-1},{9780,7,0,-1},{9784,6,0,-1},{9784,7,0,-1}, +{9789,6,0,-1},{9789,7,0,-1},{9793,6,0,-1},{9793,7,0,-1},{9797,6,0,-1}, +{9797,7,0,-1},{9802,6,0,-1},{9802,7,0,-1},{9806,6,0,-1},{9806,7,0,-1}, +{9810,6,0,-1},{9810,7,0,-1},{9815,6,0,-1},{9815,7,0,-1},{9819,6,0,-1}, +{9819,7,0,-1},{9823,6,0,-1},{9823,7,0,-1},{9828,6,0,-1},{9828,7,0,-1}, +{9832,6,0,-1},{9832,7,0,-1},{9762,6,0,-1},{9836,6,0,-1},{9836,7,0,-1}, +{9841,6,0,-1},{9841,7,0,-1},{9845,6,0,-1},{9845,7,0,-1},{9775,7,0,-1}, +{9849,6,0,-1},{9849,7,0,-1},{9854,6,0,-1},{9854,7,0,-1},{9858,6,0,-1}, +{9858,7,0,-1},{9862,6,0,-1},{9862,7,0,-1},{9867,6,0,-1},{9867,7,0,-1}, +{9871,6,0,-1},{9871,7,0,-1},{9875,6,0,-1},{9875,7,0,-1},{9880,6,0,-1}, +{9880,7,0,-1},{9884,6,0,-1},{9884,7,0,-1},{9888,6,0,-1},{9888,7,0,-1}, +{9893,6,0,-1},{9893,7,0,-1},{9897,6,0,-1},{9897,7,0,-1},{9901,6,0,-1}, +{9901,7,0,-1},{9906,6,0,-1},{9906,7,0,-1},{9910,6,0,-1},{9910,7,0,-1}, +{9914,6,0,-1},{9914,7,0,-1},{9919,6,0,-1},{9919,7,0,-1},{9923,6,0,-1}, +{9923,7,0,-1},{9927,6,0,-1},{9927,7,0,-1},{9932,6,0,-1},{9932,7,0,-1}, +{9936,6,0,-1},{9936,7,0,-1},{9866,6,0,-1},{9940,6,0,-1},{9940,7,0,-1}, +{9945,6,0,-1},{9945,7,0,-1},{9949,6,0,-1},{9949,7,0,-1},{9879,7,0,-1}, +{9953,6,0,-1},{9953,7,0,-1},{9958,6,0,-1},{9958,7,0,-1},{9962,6,0,-1}, +{9962,7,0,-1},{9966,6,0,-1},{9966,7,0,-1},{9971,6,0,-1},{9971,7,0,-1}, +{9975,6,0,-1},{9975,7,0,-1},{9979,6,0,-1},{9979,7,0,-1},{9984,6,0,-1}, +{9984,7,0,-1},{9988,6,0,-1},{9988,7,0,-1},{9992,6,0,-1},{9992,7,0,-1}, +{9997,6,0,-1},{9997,7,0,-1},{10001,6,0,-1},{10001,7,0,-1},{10005,6,0,-1}, +{10005,7,0,-1},{10010,6,0,-1},{10010,7,0,-1},{10014,6,0,-1},{10014,7,0,-1}, +{10018,6,0,-1},{10018,7,0,-1},{10023,6,0,-1},{10023,7,0,-1},{10027,6,0,-1}, +{10027,7,0,-1},{10031,6,0,-1},{10031,7,0,-1},{10036,6,0,-1},{10036,7,0,-1}, +{10040,6,0,-1},{10040,7,0,-1},{9970,6,0,-1},{10044,6,0,-1},{10044,7,0,-1}, +{10049,6,0,-1},{10049,7,0,-1},{10053,6,0,-1},{10053,7,0,-1},{9983,7,0,-1}, +{10057,6,0,-1},{10057,7,0,-1},{10062,6,0,-1},{10062,7,0,-1},{10066,6,0,-1}, +{10066,7,0,-1},{10070,6,0,-1},{10070,7,0,-1},{10075,6,0,-1},{10075,7,0,-1}, +{10079,6,0,-1},{10079,7,0,-1},{10083,6,0,-1},{10083,7,0,-1},{10088,6,0,-1}, +{10088,7,0,-1},{10092,6,0,-1},{10092,7,0,-1},{10096,6,0,-1},{10096,7,0,-1}, +{10101,6,0,-1},{10101,7,0,-1},{10105,6,0,-1},{10105,7,0,-1},{10109,6,0,-1}, +{10109,7,0,-1},{10114,6,0,-1},{10114,7,0,-1},{10118,6,0,-1},{10118,7,0,-1}, +{10122,6,0,-1},{10122,7,0,-1},{10127,6,0,-1},{10127,7,0,-1},{10131,6,0,-1}, +{10131,7,0,-1},{10135,6,0,-1},{10135,7,0,-1},{10140,6,0,-1},{10140,7,0,-1}, +{10144,6,0,-1},{10144,7,0,-1},{10074,6,0,-1},{10148,6,0,-1},{10148,7,0,-1}, +{10153,6,0,-1},{10153,7,0,-1},{10157,6,0,-1},{10157,7,0,-1},{10087,7,0,-1}, +{10161,6,0,-1},{10161,7,0,-1},{10166,6,0,-1},{10166,7,0,-1},{10170,6,0,-1}, +{10170,7,0,-1},{10174,6,0,-1},{10174,7,0,-1},{10179,6,0,-1},{10179,7,0,-1}, +{10183,6,0,-1},{10183,7,0,-1},{10187,6,0,-1},{10187,7,0,-1},{10192,6,0,-1}, +{10192,7,0,-1},{10196,6,0,-1},{10196,7,0,-1},{10200,6,0,-1},{10200,7,0,-1}, +{10205,6,0,-1},{10205,7,0,-1},{10209,6,0,-1},{10209,7,0,-1},{10213,6,0,-1}, +{10213,7,0,-1},{10218,6,0,-1},{10218,7,0,-1},{10222,6,0,-1},{10222,7,0,-1}, +{10226,6,0,-1},{10226,7,0,-1},{10231,6,0,-1},{10231,7,0,-1},{10235,6,0,-1}, +{10235,7,0,-1},{10239,6,0,-1},{10239,7,0,-1},{10244,6,0,-1},{10244,7,0,-1}, +{10248,6,0,-1},{10248,7,0,-1},{10178,6,0,-1},{10252,6,0,-1},{10252,7,0,-1}, +{10257,6,0,-1},{10257,7,0,-1},{10261,6,0,-1},{10261,7,0,-1},{10191,7,0,-1}, +{10265,6,0,-1},{10265,7,0,-1},{10270,6,0,-1},{10270,7,0,-1},{10274,6,0,-1}, +{10274,7,0,-1},{10278,6,0,-1},{10278,7,0,-1},{10283,6,0,-1},{10283,7,0,-1}, +{10287,6,0,-1},{10287,7,0,-1},{10291,6,0,-1},{10291,7,0,-1},{10296,6,0,-1}, +{10296,7,0,-1},{10300,6,0,-1},{10300,7,0,-1},{10304,6,0,-1},{10304,7,0,-1}, +{10309,6,0,-1},{10309,7,0,-1},{10313,6,0,-1},{10313,7,0,-1},{10317,6,0,-1}, +{10317,7,0,-1},{10322,6,0,-1},{10322,7,0,-1},{10326,6,0,-1},{10326,7,0,-1}, +{10330,6,0,-1},{10330,7,0,-1},{10335,6,0,-1},{10335,7,0,-1},{10339,6,0,-1}, +{10339,7,0,-1},{10343,6,0,-1},{10343,7,0,-1},{10348,6,0,-1},{10348,7,0,-1}, +{10352,6,0,-1},{10352,7,0,-1},{10282,6,0,-1},{10356,6,0,-1},{10356,7,0,-1}, +{10361,6,0,-1},{10361,7,0,-1},{10365,6,0,-1},{10365,7,0,-1},{10295,7,0,-1}, +{10369,6,0,-1},{10369,7,0,-1},{10374,6,0,-1},{10374,7,0,-1},{10378,6,0,-1}, +{10378,7,0,-1},{10382,6,0,-1},{10382,7,0,-1},{10387,6,0,-1},{10387,7,0,-1}, +{10391,6,0,-1},{10391,7,0,-1},{10395,6,0,-1},{10395,7,0,-1},{10400,6,0,-1}, +{10400,7,0,-1},{10404,6,0,-1},{10404,7,0,-1},{10408,6,0,-1},{10408,7,0,-1}, +{10413,6,0,-1},{10413,7,0,-1},{10417,6,0,-1},{10417,7,0,-1},{10421,6,0,-1}, +{10421,7,0,-1},{10426,6,0,-1},{10426,7,0,-1},{10430,6,0,-1},{10430,7,0,-1}, +{10434,6,0,-1},{10434,7,0,-1},{10439,6,0,-1},{10439,7,0,-1},{10443,6,0,-1}, +{10443,7,0,-1},{10447,6,0,-1},{10447,7,0,-1},{10452,6,0,-1},{10452,7,0,-1}, +{10456,6,0,-1},{10456,7,0,-1},{10386,6,0,-1},{10460,6,0,-1},{10460,7,0,-1}, +{10465,6,0,-1},{10465,7,0,-1},{10469,6,0,-1},{10469,7,0,-1},{10399,7,0,-1}, +{10473,6,0,-1},{10473,7,0,-1},{10478,6,0,-1},{10478,7,0,-1},{10482,6,0,-1}, +{10482,7,0,-1},{10486,6,0,-1},{10486,7,0,-1},{10491,6,0,-1},{10491,7,0,-1}, +{10495,6,0,-1},{10495,7,0,-1},{10499,6,0,-1},{10499,7,0,-1},{10504,6,0,-1}, +{10504,7,0,-1},{10508,6,0,-1},{10508,7,0,-1},{10512,6,0,-1},{10512,7,0,-1}, +{10517,6,0,-1},{10517,7,0,-1},{10521,6,0,-1},{10521,7,0,-1},{10525,6,0,-1}, +{10525,7,0,-1},{10530,6,0,-1},{10530,7,0,-1},{10534,6,0,-1},{10534,7,0,-1}, +{10538,6,0,-1},{10538,7,0,-1},{10543,6,0,-1},{10543,7,0,-1},{10547,6,0,-1}, +{10547,7,0,-1},{10551,6,0,-1},{10551,7,0,-1},{10556,6,0,-1},{10556,7,0,-1}, +{10560,6,0,-1},{10560,7,0,-1},{10490,6,0,-1},{10564,6,0,-1},{10564,7,0,-1}, +{10569,6,0,-1},{10569,7,0,-1},{10573,6,0,-1},{10573,7,0,-1},{10503,7,0,-1}, +{10577,6,0,-1},{10577,7,0,-1},{10582,6,0,-1},{10582,7,0,-1},{10586,6,0,-1}, +{10586,7,0,-1},{10590,6,0,-1},{10590,7,0,-1},{10595,6,0,-1},{10595,7,0,-1}, +{10599,6,0,-1},{10599,7,0,-1},{10603,6,0,-1},{10603,7,0,-1},{10608,6,0,-1}, +{10608,7,0,-1},{10612,6,0,-1},{10612,7,0,-1},{10616,6,0,-1},{10616,7,0,-1}, +{10621,6,0,-1},{10621,7,0,-1},{10625,6,0,-1},{10625,7,0,-1},{10629,6,0,-1}, +{10629,7,0,-1},{10634,6,0,-1},{10634,7,0,-1},{10638,6,0,-1},{10638,7,0,-1}, +{10642,6,0,-1},{10642,7,0,-1},{10647,6,0,-1},{10647,7,0,-1},{10651,6,0,-1}, +{10651,7,0,-1},{10655,6,0,-1},{10655,7,0,-1},{10660,6,0,-1},{10660,7,0,-1}, +{10664,6,0,-1},{10664,7,0,-1},{10594,6,0,-1},{10668,6,0,-1},{10668,7,0,-1}, +{10673,6,0,-1},{10673,7,0,-1},{10677,6,0,-1},{10677,7,0,-1},{10607,7,0,-1}, +{10681,6,0,-1},{10681,7,0,-1},{10686,6,0,-1},{10686,7,0,-1},{10690,6,0,-1}, +{10690,7,0,-1},{10694,6,0,-1},{10694,7,0,-1},{10699,6,0,-1},{10699,7,0,-1}, +{10703,6,0,-1},{10703,7,0,-1},{10707,6,0,-1},{10707,7,0,-1},{10712,6,0,-1}, +{10712,7,0,-1},{10716,6,0,-1},{10716,7,0,-1},{10720,6,0,-1},{10720,7,0,-1}, +{10725,6,0,-1},{10725,7,0,-1},{10729,6,0,-1},{10729,7,0,-1},{10733,6,0,-1}, +{10733,7,0,-1},{10738,6,0,-1},{10738,7,0,-1},{10742,6,0,-1},{10742,7,0,-1}, +{10746,6,0,-1},{10746,7,0,-1},{10751,6,0,-1},{10751,7,0,-1},{10755,6,0,-1}, +{10755,7,0,-1},{10759,6,0,-1},{10759,7,0,-1},{10764,6,0,-1},{10764,7,0,-1}, +{10768,6,0,-1},{10768,7,0,-1},{10698,6,0,-1},{10772,6,0,-1},{10772,7,0,-1}, +{10777,6,0,-1},{10777,7,0,-1},{10781,6,0,-1},{10781,7,0,-1},{10711,7,0,-1}, +{10785,6,0,-1},{10785,7,0,-1},{10790,6,0,-1},{10790,7,0,-1},{10794,6,0,-1}, +{10794,7,0,-1},{10798,6,0,-1},{10798,7,0,-1},{10803,6,0,-1},{10803,7,0,-1}, +{10807,6,0,-1},{10807,7,0,-1},{10811,6,0,-1},{10811,7,0,-1},{10816,6,0,-1}, +{10816,7,0,-1},{10820,6,0,-1},{10820,7,0,-1},{10824,6,0,-1},{10824,7,0,-1}, +{10829,6,0,-1},{10829,7,0,-1},{10833,6,0,-1},{10833,7,0,-1},{10837,6,0,-1}, +{10837,7,0,-1},{10842,6,0,-1},{10842,7,0,-1},{10846,6,0,-1},{10846,7,0,-1}, +{10850,6,0,-1},{10850,7,0,-1},{10855,6,0,-1},{10855,7,0,-1},{10859,6,0,-1}, +{10859,7,0,-1},{10863,6,0,-1},{10863,7,0,-1},{10868,6,0,-1},{10868,7,0,-1}, +{10872,6,0,-1},{10872,7,0,-1},{10802,6,0,-1},{10876,6,0,-1},{10876,7,0,-1}, +{10881,6,0,-1},{10881,7,0,-1},{10885,6,0,-1},{10885,7,0,-1},{10815,7,0,-1}, +{10889,6,0,-1},{10889,7,0,-1},{10894,6,0,-1},{10894,7,0,-1},{10898,6,0,-1}, +{10898,7,0,-1},{10902,6,0,-1},{10902,7,0,-1},{10907,6,0,-1},{10907,7,0,-1}, +{10911,6,0,-1},{10911,7,0,-1},{10915,6,0,-1},{10915,7,0,-1},{10920,6,0,-1}, +{10920,7,0,-1},{10924,6,0,-1},{10924,7,0,-1},{10928,6,0,-1},{10928,7,0,-1}, +{10933,6,0,-1},{10933,7,0,-1},{10937,6,0,-1},{10937,7,0,-1},{10941,6,0,-1}, +{10941,7,0,-1},{10946,6,0,-1},{10946,7,0,-1},{10950,6,0,-1},{10950,7,0,-1}, +{10954,6,0,-1},{10954,7,0,-1},{10959,6,0,-1},{10959,7,0,-1},{10963,6,0,-1}, +{10963,7,0,-1},{10967,6,0,-1},{10967,7,0,-1},{10972,6,0,-1},{10972,7,0,-1}, +{10976,6,0,-1},{10976,7,0,-1},{10906,6,0,-1},{10980,6,0,-1},{10980,7,0,-1}, +{10985,6,0,-1},{10985,7,0,-1},{10989,6,0,-1},{10989,7,0,-1},{10919,7,0,-1}, +{10993,6,0,-1},{10993,7,0,-1},{10998,6,0,-1},{10998,7,0,-1},{11002,6,0,-1}, +{11002,7,0,-1},{11006,6,0,-1},{11006,7,0,-1},{11011,6,0,-1},{11011,7,0,-1}, +{11015,6,0,-1},{11015,7,0,-1},{11019,6,0,-1},{11019,7,0,-1},{11024,6,0,-1}, +{11024,7,0,-1},{11028,6,0,-1},{11028,7,0,-1},{11032,6,0,-1},{11032,7,0,-1}, +{11037,6,0,-1},{11037,7,0,-1},{11041,6,0,-1},{11041,7,0,-1},{11045,6,0,-1}, +{11045,7,0,-1},{11050,6,0,-1},{11050,7,0,-1},{11054,6,0,-1},{11054,7,0,-1}, +{11058,6,0,-1},{11058,7,0,-1},{11063,6,0,-1},{11063,7,0,-1},{11067,6,0,-1}, +{11067,7,0,-1},{11071,6,0,-1},{11071,7,0,-1},{11076,6,0,-1},{11076,7,0,-1}, +{11080,6,0,-1},{11080,7,0,-1},{11010,6,0,-1},{11084,6,0,-1},{11084,7,0,-1}, +{11089,6,0,-1},{11089,7,0,-1},{11093,6,0,-1},{11093,7,0,-1},{11023,7,0,-1}, +{11097,6,0,-1},{11097,7,0,-1},{11102,6,0,-1},{11102,7,0,-1},{11106,6,0,-1}, +{11106,7,0,-1},{11110,6,0,-1},{11110,7,0,-1},{11115,6,0,-1},{11115,7,0,-1}, +{11119,6,0,-1},{11119,7,0,-1},{11123,6,0,-1},{11123,7,0,-1},{11128,6,0,-1}, +{11128,7,0,-1},{11132,6,0,-1},{11132,7,0,-1},{11136,6,0,-1},{11136,7,0,-1}, +{11141,6,0,-1},{11141,7,0,-1},{11145,6,0,-1},{11145,7,0,-1},{11149,6,0,-1}, +{11149,7,0,-1},{11154,6,0,-1},{11154,7,0,-1},{11158,6,0,-1},{11158,7,0,-1}, +{11162,6,0,-1},{11162,7,0,-1},{11167,6,0,-1},{11167,7,0,-1},{11171,6,0,-1}, +{11171,7,0,-1},{11175,6,0,-1},{11175,7,0,-1},{11180,6,0,-1},{11180,7,0,-1}, +{11184,6,0,-1},{11184,7,0,-1},{11114,6,0,-1},{11188,6,0,-1},{11188,7,0,-1}, +{11193,6,0,-1},{11193,7,0,-1},{11197,6,0,-1},{11197,7,0,-1},{11127,7,0,-1}, +{11201,6,0,-1},{11201,7,0,-1},{11206,6,0,-1},{11206,7,0,-1},{11210,6,0,-1}, +{11210,7,0,-1},{11214,6,0,-1},{11214,7,0,-1},{11219,6,0,-1},{11219,7,0,-1}, +{11223,6,0,-1},{11223,7,0,-1},{11227,6,0,-1},{11227,7,0,-1},{11232,6,0,-1}, +{11232,7,0,-1},{11236,6,0,-1},{11236,7,0,-1},{11240,6,0,-1},{11240,7,0,-1}, +{11245,6,0,-1},{11245,7,0,-1},{11249,6,0,-1},{11249,7,0,-1},{11253,6,0,-1}, +{11253,7,0,-1},{11258,6,0,-1},{11258,7,0,-1},{11262,6,0,-1},{11262,7,0,-1}, +{11266,6,0,-1},{11266,7,0,-1},{11271,6,0,-1},{11271,7,0,-1},{11275,6,0,-1}, +{11275,7,0,-1},{11279,6,0,-1},{11279,7,0,-1},{11284,6,0,-1},{11284,7,0,-1}, +{11288,6,0,-1},{11288,7,0,-1},{11218,6,0,-1},{11292,6,0,-1},{11292,7,0,-1}, +{11297,6,0,-1},{11297,7,0,-1},{11301,6,0,-1},{11301,7,0,-1},{11231,7,0,-1}, +{11305,6,0,-1},{11305,7,0,-1},{11310,6,0,-1},{11310,7,0,-1},{11314,6,0,-1}, +{11314,7,0,-1},{11318,6,0,-1},{11318,7,0,-1},{11323,6,0,-1},{11323,7,0,-1}, +{11327,6,0,-1},{11327,7,0,-1},{11331,6,0,-1},{11331,7,0,-1},{11336,6,0,-1}, +{11336,7,0,-1},{11340,6,0,-1},{11340,7,0,-1},{11344,6,0,-1},{11344,7,0,-1}, +{11349,6,0,-1},{11349,7,0,-1},{11353,6,0,-1},{11353,7,0,-1},{11357,6,0,-1}, +{11357,7,0,-1},{11362,6,0,-1},{11362,7,0,-1},{11366,6,0,-1},{11366,7,0,-1}, +{11370,6,0,-1},{11370,7,0,-1},{11375,6,0,-1},{11375,7,0,-1},{11379,6,0,-1}, +{11379,7,0,-1},{11383,6,0,-1},{11383,7,0,-1},{11388,6,0,-1},{11388,7,0,-1}, +{11392,6,0,-1},{11392,7,0,-1},{11322,6,0,-1},{11396,6,0,-1},{11396,7,0,-1}, +{11401,6,0,-1},{11401,7,0,-1},{11405,6,0,-1},{11405,7,0,-1},{11335,7,0,-1}, +{11409,6,0,-1},{11409,7,0,-1},{11414,6,0,-1},{11414,7,0,-1},{11418,6,0,-1}, +{11418,7,0,-1},{11422,6,0,-1},{11422,7,0,-1},{11427,6,0,-1},{11427,7,0,-1}, +{11431,6,0,-1},{11431,7,0,-1},{11435,6,0,-1},{11435,7,0,-1},{11440,6,0,-1}, +{11440,7,0,-1},{11444,6,0,-1},{11444,7,0,-1},{11448,6,0,-1},{11448,7,0,-1}, +{11453,6,0,-1},{11453,7,0,-1},{11457,6,0,-1},{11457,7,0,-1},{11461,6,0,-1}, +{11461,7,0,-1},{11466,6,0,-1},{11466,7,0,-1},{11470,6,0,-1},{11470,7,0,-1}, +{11474,6,0,-1},{11474,7,0,-1},{11479,6,0,-1},{11479,7,0,-1},{11483,6,0,-1}, +{11483,7,0,-1},{11487,6,0,-1},{11487,7,0,-1},{11492,6,0,-1},{11492,7,0,-1}, +{11496,6,0,-1},{11496,7,0,-1},{11426,6,0,-1},{11500,6,0,-1},{11500,7,0,-1}, +{11505,6,0,-1},{11505,7,0,-1},{11509,6,0,-1},{11509,7,0,-1},{11439,7,0,-1}, +{11513,6,0,-1},{11513,7,0,-1},{11518,6,0,-1},{11518,7,0,-1},{11522,6,0,-1}, +{11522,7,0,-1},{11526,6,0,-1},{11526,7,0,-1},{11531,6,0,-1},{11531,7,0,-1}, +{11535,6,0,-1},{11535,7,0,-1},{11539,6,0,-1},{11539,7,0,-1},{11544,6,0,-1}, +{11544,7,0,-1},{11548,6,0,-1},{11548,7,0,-1},{11552,6,0,-1},{11552,7,0,-1}, +{11557,6,0,-1},{11557,7,0,-1},{11561,6,0,-1},{11561,7,0,-1},{11565,6,0,-1}, +{11565,7,0,-1},{11570,6,0,-1},{11570,7,0,-1},{11574,6,0,-1},{11574,7,0,-1}, +{11578,6,0,-1},{11578,7,0,-1},{11583,6,0,-1},{11583,7,0,-1},{11587,6,0,-1}, +{11587,7,0,-1},{11591,6,0,-1},{11591,7,0,-1},{11596,6,0,-1},{11596,7,0,-1}, +{11600,6,0,-1},{11600,7,0,-1},{11530,6,0,-1},{11604,6,0,-1},{11604,7,0,-1}, +{11609,6,0,-1},{11609,7,0,-1},{11613,6,0,-1},{11613,7,0,-1},{11543,7,0,-1}, +{11617,6,0,-1},{11617,7,0,-1},{11622,6,0,-1},{11622,7,0,-1},{11626,6,0,-1}, +{11626,7,0,-1},{11630,6,0,-1},{11630,7,0,-1},{11635,6,0,-1},{11635,7,0,-1}, +{11639,6,0,-1},{11639,7,0,-1},{11643,6,0,-1},{11643,7,0,-1},{11648,6,0,-1}, +{11648,7,0,-1},{11652,6,0,-1},{11652,7,0,-1},{11656,6,0,-1},{11656,7,0,-1}, +{11661,6,0,-1},{11661,7,0,-1},{11665,6,0,-1},{11665,7,0,-1},{11669,6,0,-1}, +{11669,7,0,-1},{11674,6,0,-1},{11674,7,0,-1},{11678,6,0,-1},{11678,7,0,-1}, +{11682,6,0,-1},{11682,7,0,-1},{11687,6,0,-1},{11687,7,0,-1},{11691,6,0,-1}, +{11691,7,0,-1},{11695,6,0,-1},{11695,7,0,-1},{11700,6,0,-1},{11700,7,0,-1}, +{11704,6,0,-1},{11704,7,0,-1},{11634,6,0,-1},{11708,6,0,-1},{11708,7,0,-1}, +{11713,6,0,-1},{11713,7,0,-1},{11717,6,0,-1},{11717,7,0,-1},{11647,7,0,-1}, +{11721,6,0,-1},{11721,7,0,-1},{11726,6,0,-1},{11726,7,0,-1},{11730,6,0,-1}, +{11730,7,0,-1},{11734,6,0,-1},{11734,7,0,-1},{11739,6,0,-1},{11739,7,0,-1}, +{11743,6,0,-1},{11743,7,0,-1},{11747,6,0,-1},{11747,7,0,-1},{11752,6,0,-1}, +{11752,7,0,-1},{11756,6,0,-1},{11756,7,0,-1},{11760,6,0,-1},{11760,7,0,-1}, +{11765,6,0,-1},{11765,7,0,-1},{11769,6,0,-1},{11769,7,0,-1},{11773,6,0,-1}, +{11773,7,0,-1},{11778,6,0,-1},{11778,7,0,-1},{11782,6,0,-1},{11782,7,0,-1}, +{11786,6,0,-1},{11786,7,0,-1},{11791,6,0,-1},{11791,7,0,-1},{11795,6,0,-1}, +{11795,7,0,-1},{11799,6,0,-1},{11799,7,0,-1},{11804,6,0,-1},{11804,7,0,-1}, +{11808,6,0,-1},{11808,7,0,-1},{11738,6,0,-1},{11812,6,0,-1},{11812,7,0,-1}, +{11817,6,0,-1},{11817,7,0,-1},{11821,6,0,-1},{11821,7,0,-1},{11751,7,0,-1}, +{11825,6,0,-1},{11825,7,0,-1},{11830,6,0,-1},{11830,7,0,-1},{11834,6,0,-1}, +{11834,7,0,-1},{11838,6,0,-1},{11838,7,0,-1},{11843,6,0,-1},{11843,7,0,-1}, +{11847,6,0,-1},{11847,7,0,-1},{11851,6,0,-1},{11851,7,0,-1},{11856,6,0,-1}, +{11856,7,0,-1},{11860,6,0,-1},{11860,7,0,-1},{11864,6,0,-1},{11864,7,0,-1}, +{11869,6,0,-1},{11869,7,0,-1},{11873,6,0,-1},{11873,7,0,-1},{11877,6,0,-1}, +{11877,7,0,-1},{11882,6,0,-1},{11882,7,0,-1},{11886,6,0,-1},{11886,7,0,-1}, +{11890,6,0,-1},{11890,7,0,-1},{11895,6,0,-1},{11895,7,0,-1},{11899,6,0,-1}, +{11899,7,0,-1},{11903,6,0,-1},{11903,7,0,-1},{11908,6,0,-1},{11908,7,0,-1}, +{11912,6,0,-1},{11912,7,0,-1},{11842,6,0,-1},{11916,6,0,-1},{11916,7,0,-1}, +{11921,6,0,-1},{11921,7,0,-1},{11925,6,0,-1},{11925,7,0,-1},{11855,7,0,-1}, +{11929,6,0,-1},{11929,7,0,-1},{11934,6,0,-1},{11934,7,0,-1},{11938,6,0,-1}, +{11938,7,0,-1},{11942,6,0,-1},{11942,7,0,-1},{11947,6,0,-1},{11947,7,0,-1}, +{11951,6,0,-1},{11951,7,0,-1},{11955,6,0,-1},{11955,7,0,-1},{11960,6,0,-1}, +{11960,7,0,-1},{11964,6,0,-1},{11964,7,0,-1},{11968,6,0,-1},{11968,7,0,-1}, +{11973,6,0,-1},{11973,7,0,-1},{11977,6,0,-1},{11977,7,0,-1},{11981,6,0,-1}, +{11981,7,0,-1},{11986,6,0,-1},{11986,7,0,-1},{11990,6,0,-1},{11990,7,0,-1}, +{11994,6,0,-1},{11994,7,0,-1},{11999,6,0,-1},{11999,7,0,-1},{12003,6,0,-1}, +{12003,7,0,-1},{12007,6,0,-1},{12007,7,0,-1},{12012,6,0,-1},{12012,7,0,-1}, +{12016,6,0,-1},{12016,7,0,-1},{11946,6,0,-1},{12020,6,0,-1},{12020,7,0,-1}, +{12025,6,0,-1},{12025,7,0,-1},{12029,6,0,-1},{12029,7,0,-1},{11959,7,0,-1}, +{12033,6,0,-1},{12033,7,0,-1},{12038,6,0,-1},{12038,7,0,-1},{12042,6,0,-1}, +{12042,7,0,-1},{12046,6,0,-1},{12046,7,0,-1},{12051,6,0,-1},{12051,7,0,-1}, +{12055,6,0,-1},{12055,7,0,-1},{12059,6,0,-1},{12059,7,0,-1},{12064,6,0,-1}, +{12064,7,0,-1},{12068,6,0,-1},{12068,7,0,-1},{12072,6,0,-1},{12072,7,0,-1}, +{12077,6,0,-1},{12077,7,0,-1},{12081,6,0,-1},{12081,7,0,-1},{12085,6,0,-1}, +{12085,7,0,-1},{12090,6,0,-1},{12090,7,0,-1},{12094,6,0,-1},{12094,7,0,-1}, +{12098,6,0,-1},{12098,7,0,-1},{12103,6,0,-1},{12103,7,0,-1},{12107,6,0,-1}, +{12107,7,0,-1},{12111,6,0,-1},{12111,7,0,-1},{12116,6,0,-1},{12116,7,0,-1}, +{12120,6,0,-1},{12120,7,0,-1},{12050,6,0,-1},{12124,6,0,-1},{12124,7,0,-1}, +{12129,6,0,-1},{12129,7,0,-1},{12133,6,0,-1},{12133,7,0,-1},{12063,7,0,-1}, +{12137,6,0,-1},{12137,7,0,-1},{12142,6,0,-1},{12142,7,0,-1},{12146,6,0,-1}, +{12146,7,0,-1},{12150,6,0,-1},{12150,7,0,-1},{12155,6,0,-1},{12155,7,0,-1}, +{12159,6,0,-1},{12159,7,0,-1},{12163,6,0,-1},{12163,7,0,-1},{12168,6,0,-1}, +{12168,7,0,-1},{12172,6,0,-1},{12172,7,0,-1},{12176,6,0,-1},{12176,7,0,-1}, +{12181,6,0,-1},{12181,7,0,-1},{12185,6,0,-1},{12185,7,0,-1},{12189,6,0,-1}, +{12189,7,0,-1},{12194,6,0,-1},{12194,7,0,-1},{12198,6,0,-1},{12198,7,0,-1}, +{12202,6,0,-1},{12202,7,0,-1},{12207,6,0,-1},{12207,7,0,-1},{12211,6,0,-1}, +{12211,7,0,-1},{12215,6,0,-1},{12215,7,0,-1},{12220,6,0,-1},{12220,7,0,-1}, +{12224,6,0,-1},{12224,7,0,-1},{12154,6,0,-1},{12228,6,0,-1},{12228,7,0,-1}, +{12233,6,0,-1},{12233,7,0,-1},{12237,6,0,-1},{12237,7,0,-1},{12167,7,0,-1}, +{12241,6,0,-1},{12241,7,0,-1},{12246,6,0,-1},{12246,7,0,-1},{12250,7,0,-1}, +{12254,7,0,-1},{12259,6,0,-1},{12259,7,0,-1},{12263,7,0,-1},{12267,7,0,-1}, +{12272,6,0,-1},{12272,7,0,-1},{12276,6,0,-1},{12276,7,0,-1},{12280,6,0,-1}, +{12280,7,0,-1},{12285,6,0,-1},{12285,7,0,-1},{12289,7,0,-1},{12293,7,0,-1}, +{12298,7,0,-1},{12302,7,0,-1},{12306,6,0,-1},{12306,7,0,-1},{12311,6,0,-1}, +{12311,7,0,-1},{12315,7,0,-1},{12319,7,0,-1},{12324,7,0,-1},{12328,7,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS2, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_2_ss0_ss1[] = { +{8252,0,1,-1},{8987,2,0,-1},{8996,2,0,-1},{9004,2,0,-1},{9013,2,0,-1}, +{9022,2,0,-1},{9030,2,0,-1},{9039,2,0,-1},{9043,2,0,-1},{9048,2,0,-1}, +{8982,2,0,-1},{9056,2,0,-1},{9065,2,0,-1},{9074,2,0,-1},{9082,2,0,-1}, +{9091,2,0,-1},{9100,2,0,-1},{9108,2,0,-1},{9117,2,0,-1},{9126,2,0,-1}, +{9134,2,0,-1},{9143,2,0,-1},{9152,2,0,-1},{9086,2,0,-1},{9160,2,0,-1}, +{9169,2,0,-1},{9173,2,0,-1},{9178,2,0,-1},{9182,2,0,-1},{9186,2,0,-1}, +{9191,2,0,-1},{9195,2,0,-1},{9199,2,0,-1},{9204,2,0,-1},{9208,2,0,-1}, +{9212,2,0,-1},{9217,2,0,-1},{9221,2,0,-1},{9225,2,0,-1},{9230,2,0,-1}, +{9234,2,0,-1},{9238,2,0,-1},{9243,2,0,-1},{9247,2,0,-1},{9251,2,0,-1}, +{9256,2,0,-1},{9190,2,0,-1},{9260,2,0,-1},{9264,2,0,-1},{9269,2,0,-1}, +{9273,2,0,-1},{9277,2,0,-1},{9282,2,0,-1},{9286,2,0,-1},{9290,2,0,-1}, +{9295,2,0,-1},{9299,2,0,-1},{9303,2,0,-1},{9308,2,0,-1},{9312,2,0,-1}, +{9316,2,0,-1},{9321,2,0,-1},{9325,2,0,-1},{9329,2,0,-1},{9334,2,0,-1}, +{9338,2,0,-1},{9342,2,0,-1},{9347,2,0,-1},{9351,2,0,-1},{9355,2,0,-1}, +{9360,2,0,-1},{9294,2,0,-1},{9364,2,0,-1},{9368,2,0,-1},{9369,2,1,-1}, +{9373,2,0,-1},{9377,2,0,-1},{9381,2,0,-1},{9382,2,1,-1},{9386,2,0,-1}, +{9390,2,0,-1},{9391,2,1,-1},{9394,2,0,-1},{9395,2,1,-1},{9399,2,0,-1}, +{9403,2,0,-1},{9404,2,1,-1},{9407,2,0,-1},{9412,2,0,-1},{9413,2,1,-1}, +{9416,2,0,-1},{9420,2,0,-1},{9421,2,1,-1},{9425,2,0,-1},{9429,2,0,-1}, +{9430,2,1,-1},{9433,2,0,-1},{9438,2,0,-1},{9439,2,1,-1},{9442,2,0,-1}, +{9446,2,0,-1},{9447,2,1,-1},{9451,2,0,-1},{9455,2,0,-1},{9456,2,1,-1}, +{9459,2,0,-1},{9464,2,0,-1},{9465,2,1,-1},{9398,2,0,-1},{9468,2,0,-1}, +{9472,2,0,-1},{9473,2,1,-1},{9477,2,0,-1},{9411,2,1,-1},{9481,2,0,-1}, +{9482,2,1,-1},{9485,2,0,-1},{9490,2,0,-1},{9491,2,1,-1},{9494,2,0,-1}, +{9498,2,0,-1},{9499,2,1,-1},{9503,2,0,-1},{9504,2,1,-1},{9507,2,0,-1}, +{9508,2,1,-1},{9511,2,0,-1},{9512,2,1,-1},{9516,2,0,-1},{9517,2,1,-1}, +{9520,2,0,-1},{9521,2,1,-1},{9524,2,0,-1},{9525,2,1,-1},{9529,2,0,-1}, +{9533,2,0,-1},{9534,2,1,-1},{9537,2,0,-1},{9538,2,1,-1},{9542,2,0,-1}, +{9543,2,1,-1},{9546,2,0,-1},{9547,2,1,-1},{9550,2,0,-1},{9551,2,1,-1}, +{9555,2,0,-1},{9556,2,1,-1},{9559,2,0,-1},{9560,2,1,-1},{9563,2,0,-1}, +{9564,2,1,-1},{9568,2,0,-1},{9569,2,1,-1},{9502,2,0,-1},{9573,2,1,-1}, +{9576,2,0,-1},{9577,2,1,-1},{9581,2,0,-1},{9582,2,1,-1},{9515,2,1,-1}, +{9585,2,0,-1},{9586,2,1,-1},{9589,2,0,-1},{9590,2,1,-1},{9594,2,0,-1}, +{9595,2,1,-1},{9598,2,0,-1},{9599,2,1,-1},{9602,2,0,-1},{9603,2,1,-1}, +{9607,2,0,-1},{9608,2,1,-1},{9611,2,0,-1},{9612,2,1,-1},{9615,2,0,-1}, +{9616,2,1,-1},{9620,2,0,-1},{9621,2,1,-1},{9624,2,0,-1},{9625,2,1,-1}, +{9628,2,0,-1},{9629,2,1,-1},{9633,2,0,-1},{9634,2,1,-1},{9637,2,0,-1}, +{9638,2,1,-1},{9641,2,0,-1},{9642,2,1,-1},{9646,2,0,-1},{9647,2,1,-1}, +{9650,2,0,-1},{9651,2,1,-1},{9654,2,0,-1},{9655,2,1,-1},{9659,2,0,-1}, +{9660,2,1,-1},{9663,2,0,-1},{9664,2,1,-1},{9667,2,0,-1},{9668,2,1,-1}, +{9672,2,0,-1},{9673,2,1,-1},{9606,2,0,-1},{9676,2,0,-1},{9677,2,1,-1}, +{9680,2,0,-1},{9681,2,1,-1},{9685,2,0,-1},{9686,2,1,-1},{9619,2,1,-1}, +{9689,2,0,-1},{9690,2,1,-1},{9693,2,0,-1},{9694,2,1,-1},{9698,2,0,-1}, +{9699,2,1,-1},{9702,2,0,-1},{9703,2,1,-1},{9706,2,0,-1},{9707,2,1,-1}, +{9711,2,0,-1},{9712,2,1,-1},{9715,2,0,-1},{9716,2,1,-1},{9719,2,0,-1}, +{9724,2,0,-1},{9725,2,1,-1},{9728,2,0,-1},{9729,2,1,-1},{9732,2,0,-1}, +{9733,2,1,-1},{9737,2,0,-1},{9738,2,1,-1},{9741,2,0,-1},{9742,2,1,-1}, +{9745,2,0,-1},{9746,2,1,-1},{9750,2,0,-1},{9751,2,1,-1},{9754,2,0,-1}, +{9755,2,1,-1},{9758,2,0,-1},{9759,2,1,-1},{9764,2,1,-1},{9767,2,0,-1}, +{9768,2,1,-1},{9771,2,0,-1},{9776,2,0,-1},{9777,2,1,-1},{9710,2,0,-1}, +{9780,2,0,-1},{9781,2,1,-1},{9784,2,0,-1},{9785,2,1,-1},{9789,2,0,-1}, +{9790,2,1,-1},{9723,2,1,-1},{9793,2,0,-1},{9794,2,1,-1},{9797,2,0,-1}, +{9798,2,1,-1},{9802,2,0,-1},{9803,2,1,-1},{9806,2,0,-1},{9807,2,1,-1}, +{9810,2,0,-1},{9811,2,1,-1},{9815,2,0,-1},{9816,2,1,-1},{9819,2,0,-1}, +{9820,2,1,-1},{9823,2,0,-1},{9824,2,1,-1},{9828,2,0,-1},{9829,2,1,-1}, +{9832,2,0,-1},{9833,2,1,-1},{9836,2,0,-1},{9837,2,1,-1},{9841,2,0,-1}, +{9842,2,1,-1},{9845,2,0,-1},{9846,2,1,-1},{9849,2,0,-1},{9850,2,1,-1}, +{9854,2,0,-1},{9855,2,1,-1},{9858,2,0,-1},{9859,2,1,-1},{9862,2,0,-1}, +{9863,2,1,-1},{9867,2,0,-1},{9868,2,1,-1},{9871,2,0,-1},{9872,2,1,-1}, +{9875,2,0,-1},{9876,2,1,-1},{9880,2,0,-1},{9881,2,1,-1},{9814,2,0,-1}, +{9884,2,0,-1},{9885,2,1,-1},{9888,2,0,-1},{9889,2,1,-1},{9893,2,0,-1}, +{9894,2,1,-1},{9827,2,1,-1},{9897,2,0,-1},{9898,2,1,-1},{9901,2,0,-1}, +{9902,2,1,-1},{9906,2,0,-1},{9907,2,1,-1},{9910,2,0,-1},{9911,2,1,-1}, +{9914,2,0,-1},{9915,2,1,-1},{9919,2,0,-1},{9920,2,1,-1},{9923,2,0,-1}, +{9924,2,1,-1},{9927,2,0,-1},{9928,2,1,-1},{9932,2,0,-1},{9933,2,1,-1}, +{9936,2,0,-1},{9937,2,1,-1},{9940,2,0,-1},{9941,2,1,-1},{9945,2,0,-1}, +{9946,2,1,-1},{9949,2,0,-1},{9950,2,1,-1},{9953,2,0,-1},{9954,2,1,-1}, +{9958,2,0,-1},{9959,2,1,-1},{9962,2,0,-1},{9963,2,1,-1},{9966,2,0,-1}, +{9967,2,1,-1},{9971,2,0,-1},{9972,2,1,-1},{9975,2,0,-1},{9976,2,1,-1}, +{9979,2,0,-1},{9980,2,1,-1},{9984,2,0,-1},{9985,2,1,-1},{9918,2,0,-1}, +{9988,2,0,-1},{9989,2,1,-1},{9992,2,0,-1},{9993,2,1,-1},{9997,2,0,-1}, +{9998,2,1,-1},{9931,2,1,-1},{10001,2,0,-1},{10002,2,1,-1},{10005,2,0,-1}, +{10006,2,1,-1},{10010,2,0,-1},{10011,2,1,-1},{10014,2,0,-1},{10015,2,1,-1}, +{10018,2,0,-1},{10019,2,1,-1},{10023,2,0,-1},{10024,2,1,-1},{10027,2,0,-1}, +{10028,2,1,-1},{10031,2,0,-1},{10032,2,1,-1},{10036,2,0,-1},{10037,2,1,-1}, +{10040,2,0,-1},{10041,2,1,-1},{10044,2,0,-1},{10045,2,1,-1},{10049,2,0,-1}, +{10050,2,1,-1},{10053,2,0,-1},{10054,2,1,-1},{10057,2,0,-1},{10058,2,1,-1}, +{10062,2,0,-1},{10063,2,1,-1},{10066,2,0,-1},{10067,2,1,-1},{10070,2,0,-1}, +{10071,2,1,-1},{10075,2,0,-1},{10076,2,1,-1},{10079,2,0,-1},{10080,2,1,-1}, +{10083,2,0,-1},{10084,2,1,-1},{10088,2,0,-1},{10089,2,1,-1},{10022,2,0,-1}, +{10092,2,0,-1},{10093,2,1,-1},{10096,2,0,-1},{10097,2,1,-1},{10101,2,0,-1}, +{10102,2,1,-1},{10035,2,1,-1},{10105,2,0,-1},{10106,2,1,-1},{10109,2,0,-1}, +{10110,2,1,-1},{10114,2,0,-1},{10115,2,1,-1},{10118,2,0,-1},{10119,2,1,-1}, +{10122,2,0,-1},{10123,2,1,-1},{10127,2,0,-1},{10128,2,1,-1},{10131,2,0,-1}, +{10132,2,1,-1},{10135,2,0,-1},{10136,2,1,-1},{10140,2,0,-1},{10141,2,1,-1}, +{10144,2,0,-1},{10145,2,1,-1},{10148,2,0,-1},{10149,2,1,-1},{10153,2,0,-1}, +{10154,2,1,-1},{10157,2,0,-1},{10158,2,1,-1},{10161,2,0,-1},{10162,2,1,-1}, +{10166,2,0,-1},{10167,2,1,-1},{10170,2,0,-1},{10171,2,1,-1},{10174,2,0,-1}, +{10175,2,1,-1},{10179,2,0,-1},{10180,2,1,-1},{10183,2,0,-1},{10184,2,1,-1}, +{10187,2,0,-1},{10188,2,1,-1},{10192,2,0,-1},{10193,2,1,-1},{10126,2,0,-1}, +{10196,2,0,-1},{10197,2,1,-1},{10200,2,0,-1},{10201,2,1,-1},{10205,2,0,-1}, +{10206,2,1,-1},{10139,2,1,-1},{10209,2,0,-1},{10210,2,1,-1},{10213,2,0,-1}, +{10214,2,1,-1},{10218,2,0,-1},{10219,2,1,-1},{10222,2,0,-1},{10223,2,1,-1}, +{10226,2,0,-1},{10227,2,1,-1},{10231,2,0,-1},{10232,2,1,-1},{10235,2,0,-1}, +{10236,2,1,-1},{10239,2,0,-1},{10240,2,1,-1},{10244,2,0,-1},{10245,2,1,-1}, +{10248,2,0,-1},{10249,2,1,-1},{10252,2,0,-1},{10253,2,1,-1},{10257,2,0,-1}, +{10258,2,1,-1},{10261,2,0,-1},{10262,2,1,-1},{10265,2,0,-1},{10266,2,1,-1}, +{10270,2,0,-1},{10271,2,1,-1},{10274,2,0,-1},{10275,2,1,-1},{10278,2,0,-1}, +{10279,2,1,-1},{10283,2,0,-1},{10284,2,1,-1},{10287,2,0,-1},{10288,2,1,-1}, +{10291,2,0,-1},{10292,2,1,-1},{10296,2,0,-1},{10297,2,1,-1},{10230,2,0,-1}, +{10300,2,0,-1},{10301,2,1,-1},{10304,2,0,-1},{10305,2,1,-1},{10309,2,0,-1}, +{10310,2,1,-1},{10243,2,1,-1},{10313,2,0,-1},{10314,2,1,-1},{10317,2,0,-1}, +{10318,2,1,-1},{10322,2,0,-1},{10323,2,1,-1},{10326,2,0,-1},{10327,2,1,-1}, +{10330,2,0,-1},{10331,2,1,-1},{10335,2,0,-1},{10336,2,1,-1},{10339,2,0,-1}, +{10340,2,1,-1},{10343,2,0,-1},{10344,2,1,-1},{10348,2,0,-1},{10349,2,1,-1}, +{10352,2,0,-1},{10353,2,1,-1},{10356,2,0,-1},{10357,2,1,-1},{10361,2,0,-1}, +{10362,2,1,-1},{10365,2,0,-1},{10366,2,1,-1},{10369,2,0,-1},{10370,2,1,-1}, +{10374,2,0,-1},{10375,2,1,-1},{10378,2,0,-1},{10379,2,1,-1},{10382,2,0,-1}, +{10383,2,1,-1},{10387,2,0,-1},{10388,2,1,-1},{10391,2,0,-1},{10392,2,1,-1}, +{10395,2,0,-1},{10396,2,1,-1},{10400,2,0,-1},{10401,2,1,-1},{10334,2,0,-1}, +{10404,2,0,-1},{10405,2,1,-1},{10408,2,0,-1},{10409,2,1,-1},{10413,2,0,-1}, +{10414,2,1,-1},{10347,2,1,-1},{10417,2,0,-1},{10418,2,1,-1},{10421,2,0,-1}, +{10422,2,1,-1},{10426,2,0,-1},{10427,2,1,-1},{10430,2,0,-1},{10431,2,1,-1}, +{10434,2,0,-1},{10435,2,1,-1},{10439,2,0,-1},{10440,2,1,-1},{10443,2,0,-1}, +{10444,2,1,-1},{10447,2,0,-1},{10448,2,1,-1},{10452,2,0,-1},{10453,2,1,-1}, +{10456,2,0,-1},{10457,2,1,-1},{10460,2,0,-1},{10461,2,1,-1},{10465,2,0,-1}, +{10466,2,1,-1},{10469,2,0,-1},{10470,2,1,-1},{10473,2,0,-1},{10474,2,1,-1}, +{10478,2,0,-1},{10479,2,1,-1},{10482,2,0,-1},{10483,2,1,-1},{10486,2,0,-1}, +{10487,2,1,-1},{10491,2,0,-1},{10492,2,1,-1},{10495,2,0,-1},{10496,2,1,-1}, +{10499,2,0,-1},{10500,2,1,-1},{10504,2,0,-1},{10505,2,1,-1},{10438,2,0,-1}, +{10508,2,0,-1},{10509,2,1,-1},{10512,2,0,-1},{10513,2,1,-1},{10517,2,0,-1}, +{10518,2,1,-1},{10451,2,1,-1},{10521,2,0,-1},{10522,2,1,-1},{10525,2,0,-1}, +{10526,2,1,-1},{10530,2,0,-1},{10531,2,1,-1},{10534,2,0,-1},{10535,2,1,-1}, +{10538,2,0,-1},{10539,2,1,-1},{10543,2,0,-1},{10544,2,1,-1},{10547,2,0,-1}, +{10548,2,1,-1},{10551,2,0,-1},{10552,2,1,-1},{10556,2,0,-1},{10557,2,1,-1}, +{10560,2,0,-1},{10561,2,1,-1},{10564,2,0,-1},{10565,2,1,-1},{10569,2,0,-1}, +{10570,2,1,-1},{10573,2,0,-1},{10574,2,1,-1},{10577,2,0,-1},{10578,2,1,-1}, +{10582,2,0,-1},{10583,2,1,-1},{10586,2,0,-1},{10587,2,1,-1},{10590,2,0,-1}, +{10591,2,1,-1},{10595,2,0,-1},{10596,2,1,-1},{10599,2,0,-1},{10600,2,1,-1}, +{10603,2,0,-1},{10604,2,1,-1},{10608,2,0,-1},{10609,2,1,-1},{10542,2,0,-1}, +{10612,2,0,-1},{10613,2,1,-1},{10616,2,0,-1},{10617,2,1,-1},{10621,2,0,-1}, +{10622,2,1,-1},{10555,2,1,-1},{10625,2,0,-1},{10626,2,1,-1},{10629,2,0,-1}, +{10630,2,1,-1},{10634,2,0,-1},{10635,2,1,-1},{10638,2,0,-1},{10639,2,1,-1}, +{10642,2,0,-1},{10643,2,1,-1},{10647,2,0,-1},{10648,2,1,-1},{10651,2,0,-1}, +{10652,2,1,-1},{10655,2,0,-1},{10656,2,1,-1},{10660,2,0,-1},{10661,2,1,-1}, +{10664,2,0,-1},{10665,2,1,-1},{10668,2,0,-1},{10669,2,1,-1},{10673,2,0,-1}, +{10674,2,1,-1},{10677,2,0,-1},{10678,2,1,-1},{10681,2,0,-1},{10682,2,1,-1}, +{10686,2,0,-1},{10687,2,1,-1},{10690,2,0,-1},{10691,2,1,-1},{10694,2,0,-1}, +{10695,2,1,-1},{10699,2,0,-1},{10700,2,1,-1},{10703,2,0,-1},{10704,2,1,-1}, +{10707,2,0,-1},{10708,2,1,-1},{10712,2,0,-1},{10713,2,1,-1},{10646,2,0,-1}, +{10716,2,0,-1},{10717,2,1,-1},{10720,2,0,-1},{10721,2,1,-1},{10725,2,0,-1}, +{10726,2,1,-1},{10659,2,1,-1},{10729,2,0,-1},{10730,2,1,-1},{10733,2,0,-1}, +{10734,2,1,-1},{10738,2,0,-1},{10739,2,1,-1},{10742,2,0,-1},{10743,2,1,-1}, +{10746,2,0,-1},{10747,2,1,-1},{10751,2,0,-1},{10752,2,1,-1},{10755,2,0,-1}, +{10756,2,1,-1},{10759,2,0,-1},{10760,2,1,-1},{10764,2,0,-1},{10765,2,1,-1}, +{10768,2,0,-1},{10769,2,1,-1},{10772,2,0,-1},{10773,2,1,-1},{10777,2,0,-1}, +{10778,2,1,-1},{10781,2,0,-1},{10782,2,1,-1},{10785,2,0,-1},{10786,2,1,-1}, +{10790,2,0,-1},{10791,2,1,-1},{10794,2,0,-1},{10795,2,1,-1},{10798,2,0,-1}, +{10799,2,1,-1},{10803,2,0,-1},{10804,2,1,-1},{10807,2,0,-1},{10808,2,1,-1}, +{10811,2,0,-1},{10812,2,1,-1},{10816,2,0,-1},{10817,2,1,-1},{10750,2,0,-1}, +{10820,2,0,-1},{10821,2,1,-1},{10824,2,0,-1},{10825,2,1,-1},{10829,2,0,-1}, +{10830,2,1,-1},{10763,2,1,-1},{10833,2,0,-1},{10834,2,1,-1},{10837,2,0,-1}, +{10838,2,1,-1},{10842,2,0,-1},{10843,2,1,-1},{10846,2,0,-1},{10847,2,1,-1}, +{10850,2,0,-1},{10851,2,1,-1},{10855,2,0,-1},{10856,2,1,-1},{10859,2,0,-1}, +{10860,2,1,-1},{10863,2,0,-1},{10864,2,1,-1},{10868,2,0,-1},{10869,2,1,-1}, +{10872,2,0,-1},{10873,2,1,-1},{10876,2,0,-1},{10877,2,1,-1},{10881,2,0,-1}, +{10882,2,1,-1},{10885,2,0,-1},{10886,2,1,-1},{10889,2,0,-1},{10890,2,1,-1}, +{10894,2,0,-1},{10895,2,1,-1},{10898,2,0,-1},{10899,2,1,-1},{10902,2,0,-1}, +{10903,2,1,-1},{10907,2,0,-1},{10908,2,1,-1},{10911,2,0,-1},{10912,2,1,-1}, +{10915,2,0,-1},{10916,2,1,-1},{10920,2,0,-1},{10921,2,1,-1},{10854,2,0,-1}, +{10924,2,0,-1},{10925,2,1,-1},{10928,2,0,-1},{10929,2,1,-1},{10933,2,0,-1}, +{10934,2,1,-1},{10867,2,1,-1},{10937,2,0,-1},{10938,2,1,-1},{10941,2,0,-1}, +{10942,2,1,-1},{10946,2,0,-1},{10947,2,1,-1},{10950,2,0,-1},{10951,2,1,-1}, +{10954,2,0,-1},{10955,2,1,-1},{10959,2,0,-1},{10960,2,1,-1},{10963,2,0,-1}, +{10964,2,1,-1},{10967,2,0,-1},{10968,2,1,-1},{10972,2,0,-1},{10973,2,1,-1}, +{10976,2,0,-1},{10977,2,1,-1},{10980,2,0,-1},{10981,2,1,-1},{10985,2,0,-1}, +{10986,2,1,-1},{10989,2,0,-1},{10990,2,1,-1},{10993,2,0,-1},{10994,2,1,-1}, +{10998,2,0,-1},{10999,2,1,-1},{11002,2,0,-1},{11003,2,1,-1},{11006,2,0,-1}, +{11007,2,1,-1},{11011,2,0,-1},{11012,2,1,-1},{11015,2,0,-1},{11016,2,1,-1}, +{11019,2,0,-1},{11020,2,1,-1},{11024,2,0,-1},{11025,2,1,-1},{10958,2,0,-1}, +{11028,2,0,-1},{11029,2,1,-1},{11032,2,0,-1},{11033,2,1,-1},{11037,2,0,-1}, +{11038,2,1,-1},{10971,2,1,-1},{11041,2,0,-1},{11042,2,1,-1},{11045,2,0,-1}, +{11046,2,1,-1},{11050,2,0,-1},{11051,2,1,-1},{11054,2,0,-1},{11055,2,1,-1}, +{11058,2,0,-1},{11059,2,1,-1},{11063,2,0,-1},{11064,2,1,-1},{11067,2,0,-1}, +{11068,2,1,-1},{11071,2,0,-1},{11072,2,1,-1},{11076,2,0,-1},{11077,2,1,-1}, +{11080,2,0,-1},{11081,2,1,-1},{11084,2,0,-1},{11085,2,1,-1},{11089,2,0,-1}, +{11090,2,1,-1},{11093,2,0,-1},{11094,2,1,-1},{11097,2,0,-1},{11098,2,1,-1}, +{11102,2,0,-1},{11103,2,1,-1},{11106,2,0,-1},{11107,2,1,-1},{11110,2,0,-1}, +{11111,2,1,-1},{11115,2,0,-1},{11116,2,1,-1},{11119,2,0,-1},{11120,2,1,-1}, +{11123,2,0,-1},{11124,2,1,-1},{11128,2,0,-1},{11129,2,1,-1},{11062,2,0,-1}, +{11132,2,0,-1},{11133,2,1,-1},{11136,2,0,-1},{11137,2,1,-1},{11141,2,0,-1}, +{11142,2,1,-1},{11075,2,1,-1},{11145,2,0,-1},{11146,2,1,-1},{11149,2,0,-1}, +{11150,2,1,-1},{11154,2,0,-1},{11155,2,1,-1},{11158,2,0,-1},{11159,2,1,-1}, +{11162,2,0,-1},{11163,2,1,-1},{11167,2,0,-1},{11168,2,1,-1},{11171,2,0,-1}, +{11172,2,1,-1},{11175,2,0,-1},{11176,2,1,-1},{11180,2,0,-1},{11181,2,1,-1}, +{11184,2,0,-1},{11185,2,1,-1},{11188,2,0,-1},{11189,2,1,-1},{11193,2,0,-1}, +{11194,2,1,-1},{11197,2,0,-1},{11198,2,1,-1},{11201,2,0,-1},{11202,2,1,-1}, +{11206,2,0,-1},{11207,2,1,-1},{11210,2,0,-1},{11211,2,1,-1},{11214,2,0,-1}, +{11215,2,1,-1},{11219,2,0,-1},{11220,2,1,-1},{11223,2,0,-1},{11224,2,1,-1}, +{11227,2,0,-1},{11228,2,1,-1},{11232,2,0,-1},{11233,2,1,-1},{11166,2,0,-1}, +{11236,2,0,-1},{11237,2,1,-1},{11240,2,0,-1},{11241,2,1,-1},{11245,2,0,-1}, +{11246,2,1,-1},{11179,2,1,-1},{11249,2,0,-1},{11250,2,1,-1},{11253,2,0,-1}, +{11254,2,1,-1},{11258,2,0,-1},{11259,2,1,-1},{11262,2,0,-1},{11263,2,1,-1}, +{11266,2,0,-1},{11267,2,1,-1},{11271,2,0,-1},{11272,2,1,-1},{11275,2,0,-1}, +{11276,2,1,-1},{11279,2,0,-1},{11280,2,1,-1},{11284,2,0,-1},{11285,2,1,-1}, +{11288,2,0,-1},{11289,2,1,-1},{11292,2,0,-1},{11293,2,1,-1},{11297,2,0,-1}, +{11298,2,1,-1},{11301,2,0,-1},{11302,2,1,-1},{11305,2,0,-1},{11306,2,1,-1}, +{11310,2,0,-1},{11311,2,1,-1},{11314,2,0,-1},{11315,2,1,-1},{11318,2,0,-1}, +{11319,2,1,-1},{11323,2,0,-1},{11324,2,1,-1},{11327,2,0,-1},{11328,2,1,-1}, +{11331,2,0,-1},{11332,2,1,-1},{11336,2,0,-1},{11337,2,1,-1},{11270,2,0,-1}, +{11340,2,0,-1},{11341,2,1,-1},{11344,2,0,-1},{11345,2,1,-1},{11349,2,0,-1}, +{11350,2,1,-1},{11283,2,1,-1},{11353,2,0,-1},{11354,2,1,-1},{11357,2,0,-1}, +{11358,2,1,-1},{11362,2,0,-1},{11363,2,1,-1},{11366,2,0,-1},{11367,2,1,-1}, +{11370,2,0,-1},{11371,2,1,-1},{11375,2,0,-1},{11376,2,1,-1},{11379,2,0,-1}, +{11380,2,1,-1},{11383,2,0,-1},{11384,2,1,-1},{11388,2,0,-1},{11389,2,1,-1}, +{11392,2,0,-1},{11393,2,1,-1},{11396,2,0,-1},{11397,2,1,-1},{11401,2,0,-1}, +{11402,2,1,-1},{11405,2,0,-1},{11406,2,1,-1},{11409,2,0,-1},{11410,2,1,-1}, +{11414,2,0,-1},{11415,2,1,-1},{11418,2,0,-1},{11419,2,1,-1},{11422,2,0,-1}, +{11423,2,1,-1},{11427,2,0,-1},{11428,2,1,-1},{11431,2,0,-1},{11432,2,1,-1}, +{11435,2,0,-1},{11436,2,1,-1},{11440,2,0,-1},{11441,2,1,-1},{11374,2,0,-1}, +{11444,2,0,-1},{11445,2,1,-1},{11448,2,0,-1},{11449,2,1,-1},{11453,2,0,-1}, +{11454,2,1,-1},{11387,2,1,-1},{11457,2,0,-1},{11458,2,1,-1},{11461,2,0,-1}, +{11462,2,1,-1},{11466,2,0,-1},{11467,2,1,-1},{11470,2,0,-1},{11471,2,1,-1}, +{11474,2,0,-1},{11475,2,1,-1},{11479,2,0,-1},{11480,2,1,-1},{11483,2,0,-1}, +{11484,2,1,-1},{11487,2,0,-1},{11488,2,1,-1},{11492,2,0,-1},{11493,2,1,-1}, +{11496,2,0,-1},{11497,2,1,-1},{11500,2,0,-1},{11501,2,1,-1},{11505,2,0,-1}, +{11506,2,1,-1},{11509,2,0,-1},{11510,2,1,-1},{11513,2,0,-1},{11514,2,1,-1}, +{11518,2,0,-1},{11519,2,1,-1},{11522,2,0,-1},{11523,2,1,-1},{11526,2,0,-1}, +{11527,2,1,-1},{11531,2,0,-1},{11532,2,1,-1},{11535,2,0,-1},{11536,2,1,-1}, +{11539,2,0,-1},{11540,2,1,-1},{11544,2,0,-1},{11545,2,1,-1},{11478,2,0,-1}, +{11548,2,0,-1},{11549,2,1,-1},{11552,2,0,-1},{11553,2,1,-1},{11557,2,0,-1}, +{11558,2,1,-1},{11491,2,1,-1},{11561,2,0,-1},{11562,2,1,-1},{11565,2,0,-1}, +{11566,2,1,-1},{11570,2,0,-1},{11571,2,1,-1},{11574,2,0,-1},{11575,2,1,-1}, +{11578,2,0,-1},{11579,2,1,-1},{11583,2,0,-1},{11584,2,1,-1},{11587,2,0,-1}, +{11588,2,1,-1},{11591,2,0,-1},{11596,2,0,-1},{11597,2,1,-1},{11600,2,0,-1}, +{11601,2,1,-1},{11604,2,0,-1},{11605,2,1,-1},{11609,2,0,-1},{11610,2,1,-1}, +{11613,2,0,-1},{11614,2,1,-1},{11617,2,0,-1},{11618,2,1,-1},{11622,2,0,-1}, +{11623,2,1,-1},{11626,2,0,-1},{11627,2,1,-1},{11630,2,0,-1},{11631,2,1,-1}, +{11635,2,0,-1},{11636,2,1,-1},{11639,2,0,-1},{11640,2,1,-1},{11648,2,0,-1}, +{11649,2,1,-1},{11582,2,0,-1},{11652,2,0,-1},{11653,2,1,-1},{11656,2,0,-1}, +{11657,2,1,-1},{11661,2,0,-1},{11662,2,1,-1},{11665,2,0,-1},{11666,2,1,-1}, +{11669,2,0,-1},{11670,2,1,-1},{11674,2,0,-1},{11675,2,1,-1},{11678,2,0,-1}, +{11679,2,1,-1},{11682,2,0,-1},{11683,2,1,-1},{11687,2,0,-1},{11688,2,1,-1}, +{11691,2,0,-1},{11692,2,1,-1},{11700,2,0,-1},{11704,2,0,-1},{11708,2,0,-1}, +{11713,2,0,-1},{11717,2,0,-1},{11721,2,0,-1},{11726,2,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS3, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_3_ss0_ss1[] = { +{10001,3,0,-1},{10002,3,1,-1},{10005,3,0,-1},{10006,3,1,-1},{10010,3,0,-1}, +{10011,3,1,-1},{10014,3,0,-1},{10015,3,1,-1},{10018,3,0,-1},{10019,3,1,-1}, +{10023,3,0,-1},{10024,3,1,-1},{10027,3,0,-1},{10028,3,1,-1},{10031,3,0,-1}, +{10032,3,1,-1},{10036,3,0,-1},{10037,3,1,-1},{10040,3,0,-1},{10041,3,1,-1}, +{10044,3,0,-1},{10045,3,1,-1},{10049,3,0,-1},{10050,3,1,-1},{10053,3,0,-1}, +{10054,3,1,-1},{10057,3,0,-1},{10058,3,1,-1},{10062,3,0,-1},{10063,3,1,-1}, +{10066,3,0,-1},{10067,3,1,-1},{10070,3,0,-1},{10071,3,1,-1},{10075,3,0,-1}, +{10076,3,1,-1},{10079,3,0,-1},{10080,3,1,-1},{10083,3,0,-1},{10084,3,1,-1}, +{10088,3,0,-1},{10089,3,1,-1},{10022,3,0,-1},{10092,3,0,-1},{10093,3,1,-1}, +{10096,3,0,-1},{10097,3,1,-1},{10101,3,0,-1},{10102,3,1,-1},{10035,3,1,-1}, +{10105,3,0,-1},{10106,3,1,-1},{10109,3,0,-1},{10110,3,1,-1},{10114,3,0,-1}, +{10115,3,1,-1},{10118,3,0,-1},{10119,3,1,-1},{10122,3,0,-1},{10123,3,1,-1}, +{10127,3,0,-1},{10128,3,1,-1},{10131,3,0,-1},{10132,3,1,-1},{10135,3,0,-1}, +{10136,3,1,-1},{10140,3,0,-1},{10141,3,1,-1},{10144,3,0,-1},{10145,3,1,-1}, +{10148,3,0,-1},{10149,3,1,-1},{10153,3,0,-1},{10154,3,1,-1},{10157,3,0,-1}, +{10158,3,1,-1},{10161,3,0,-1},{10162,3,1,-1},{10166,3,0,-1},{10167,3,1,-1}, +{10170,3,0,-1},{10171,3,1,-1},{10174,3,0,-1},{10175,3,1,-1},{10179,3,0,-1}, +{10180,3,1,-1},{10183,3,0,-1},{10184,3,1,-1},{10187,3,0,-1},{10188,3,1,-1}, +{10192,3,0,-1},{10193,3,1,-1},{10126,3,0,-1},{10196,3,0,-1},{10197,3,1,-1}, +{10200,3,0,-1},{10201,3,1,-1},{10205,3,0,-1},{10206,3,1,-1},{10139,3,1,-1}, +{10209,3,0,-1},{10210,3,1,-1},{10213,3,0,-1},{10214,3,1,-1},{10218,3,0,-1}, +{10219,3,1,-1},{10222,3,0,-1},{10223,3,1,-1},{10226,3,0,-1},{10227,3,1,-1}, +{10231,3,0,-1},{10232,3,1,-1},{10235,3,0,-1},{10236,3,1,-1},{10239,3,0,-1}, +{10240,3,1,-1},{10244,3,0,-1},{10245,3,1,-1},{10248,3,0,-1},{10249,3,1,-1}, +{10252,3,0,-1},{10253,3,1,-1},{10257,3,0,-1},{10258,3,1,-1},{10261,3,0,-1}, +{10262,3,1,-1},{10265,3,0,-1},{10266,3,1,-1},{10270,3,0,-1},{10271,3,1,-1}, +{10274,3,0,-1},{10275,3,1,-1},{10278,3,0,-1},{10279,3,1,-1},{10283,3,0,-1}, +{10284,3,1,-1},{10287,3,0,-1},{10288,3,1,-1},{10291,3,0,-1},{10292,3,1,-1}, +{10296,3,0,-1},{10297,3,1,-1},{10230,3,0,-1},{10300,3,0,-1},{10301,3,1,-1}, +{10304,3,0,-1},{10305,3,1,-1},{10309,3,0,-1},{10310,3,1,-1},{10243,3,1,-1}, +{10313,3,0,-1},{10314,3,1,-1},{10317,3,0,-1},{10318,3,1,-1},{10322,3,0,-1}, +{10323,3,1,-1},{10326,3,0,-1},{10327,3,1,-1},{10330,3,0,-1},{10331,3,1,-1}, +{10335,3,0,-1},{10336,3,1,-1},{10339,3,0,-1},{10340,3,1,-1},{10343,3,0,-1}, +{10344,3,1,-1},{10348,3,0,-1},{10349,3,1,-1},{10352,3,0,-1},{10353,3,1,-1}, +{10356,3,0,-1},{10357,3,1,-1},{10361,3,0,-1},{10362,3,1,-1},{10365,3,0,-1}, +{10366,3,1,-1},{10369,3,0,-1},{10370,3,1,-1},{10374,3,0,-1},{10375,3,1,-1}, +{10378,3,0,-1},{10379,3,1,-1},{10382,3,0,-1},{10383,3,1,-1},{10387,3,0,-1}, +{10388,3,1,-1},{10391,3,0,-1},{10392,3,1,-1},{10395,3,0,-1},{10396,3,1,-1}, +{10400,3,0,-1},{10401,3,1,-1},{10334,3,0,-1},{10404,3,0,-1},{10405,3,1,-1}, +{10408,3,0,-1},{10409,3,1,-1},{10413,3,0,-1},{10414,3,1,-1},{10347,3,1,-1}, +{10417,3,0,-1},{10418,3,1,-1},{10421,3,0,-1},{10422,3,1,-1},{10426,3,0,-1}, +{10427,3,1,-1},{10430,3,0,-1},{10431,3,1,-1},{10434,3,0,-1},{10435,3,1,-1}, +{10439,3,0,-1},{10440,3,1,-1},{10443,3,0,-1},{10444,3,1,-1},{10447,3,0,-1}, +{10448,3,1,-1},{10452,3,0,-1},{10453,3,1,-1},{10456,3,0,-1},{10457,3,1,-1}, +{10460,3,0,-1},{10461,3,1,-1},{10465,3,0,-1},{10466,3,1,-1},{10469,3,0,-1}, +{10470,3,1,-1},{10473,3,0,-1},{10474,3,1,-1},{10478,3,0,-1},{10479,3,1,-1}, +{10482,3,0,-1},{10483,3,1,-1},{10486,3,0,-1},{10487,3,1,-1},{10491,3,0,-1}, +{10492,3,1,-1},{10495,3,0,-1},{10496,3,1,-1},{10499,3,0,-1},{10500,3,1,-1}, +{10504,3,0,-1},{10505,3,1,-1},{10438,3,0,-1},{10508,3,0,-1},{10509,3,1,-1}, +{10512,3,0,-1},{10513,3,1,-1},{10517,3,0,-1},{10518,3,1,-1},{10451,3,1,-1}, +{10521,3,0,-1},{10522,3,1,-1},{10525,3,0,-1},{10526,3,1,-1},{10530,3,0,-1}, +{10531,3,1,-1},{10534,3,0,-1},{10535,3,1,-1},{10538,3,0,-1},{10539,3,1,-1}, +{10543,3,0,-1},{10544,3,1,-1},{10547,3,0,-1},{10548,3,1,-1},{10551,3,0,-1}, +{10552,3,1,-1},{10556,3,0,-1},{10557,3,1,-1},{10560,3,0,-1},{10561,3,1,-1}, +{10564,3,0,-1},{10565,3,1,-1},{10569,3,0,-1},{10570,3,1,-1},{10573,3,0,-1}, +{10574,3,1,-1},{10577,3,0,-1},{10578,3,1,-1},{10582,3,0,-1},{10583,3,1,-1}, +{10586,3,0,-1},{10587,3,1,-1},{10590,3,0,-1},{10591,3,1,-1},{10595,3,0,-1}, +{10596,3,1,-1},{10599,3,0,-1},{10600,3,1,-1},{10603,3,0,-1},{10604,3,1,-1}, +{10608,3,0,-1},{10609,3,1,-1},{10542,3,0,-1},{10612,3,0,-1},{10613,3,1,-1}, +{10616,3,0,-1},{10617,3,1,-1},{10621,3,0,-1},{10622,3,1,-1},{10555,3,1,-1}, +{10625,3,0,-1},{10626,3,1,-1},{10629,3,0,-1},{10630,3,1,-1},{10634,3,0,-1}, +{10635,3,1,-1},{10638,3,0,-1},{10639,3,1,-1},{10642,3,0,-1},{10643,3,1,-1}, +{10647,3,0,-1},{10648,3,1,-1},{10651,3,0,-1},{10652,3,1,-1},{10655,3,0,-1}, +{10656,3,1,-1},{10660,3,0,-1},{10661,3,1,-1},{10664,3,0,-1},{10665,3,1,-1}, +{10668,3,0,-1},{10669,3,1,-1},{10673,3,0,-1},{10674,3,1,-1},{10677,3,0,-1}, +{10678,3,1,-1},{10681,3,0,-1},{10682,3,1,-1},{10686,3,0,-1},{10687,3,1,-1}, +{10690,3,0,-1},{10691,3,1,-1},{10694,3,0,-1},{10695,3,1,-1},{10699,3,0,-1}, +{10700,3,1,-1},{10703,3,0,-1},{10704,3,1,-1},{10707,3,0,-1},{10708,3,1,-1}, +{10712,3,0,-1},{10713,3,1,-1},{10646,3,0,-1},{10716,3,0,-1},{10717,3,1,-1}, +{10720,3,0,-1},{10721,3,1,-1},{10725,3,0,-1},{10726,3,1,-1},{10659,3,1,-1}, +{10729,3,0,-1},{10730,3,1,-1},{10733,3,0,-1},{10734,3,1,-1},{10738,3,0,-1}, +{10739,3,1,-1},{10742,3,0,-1},{10743,3,1,-1},{10746,3,0,-1},{10747,3,1,-1}, +{10751,3,0,-1},{10752,3,1,-1},{10755,3,0,-1},{10756,3,1,-1},{10759,3,0,-1}, +{10760,3,1,-1},{10764,3,0,-1},{10765,3,1,-1},{10768,3,0,-1},{10769,3,1,-1}, +{10772,3,0,-1},{10773,3,1,-1},{10777,3,0,-1},{10778,3,1,-1},{10781,3,0,-1}, +{10782,3,1,-1},{10785,3,0,-1},{10786,3,1,-1},{10790,3,0,-1},{10791,3,1,-1}, +{10794,3,0,-1},{10795,3,1,-1},{10798,3,0,-1},{10799,3,1,-1},{10803,3,0,-1}, +{10804,3,1,-1},{10807,3,0,-1},{10808,3,1,-1},{10811,3,0,-1},{10812,3,1,-1}, +{10816,3,0,-1},{10817,3,1,-1},{10750,3,0,-1},{10820,3,0,-1},{10821,3,1,-1}, +{10824,3,0,-1},{10825,3,1,-1},{10829,3,0,-1},{10830,3,1,-1},{10763,3,1,-1}, +{10833,3,0,-1},{10834,3,1,-1},{10837,3,0,-1},{10838,3,1,-1},{10842,3,0,-1}, +{10843,3,1,-1},{10846,3,0,-1},{10847,3,1,-1},{10850,3,0,-1},{10851,3,1,-1}, +{10855,3,0,-1},{10856,3,1,-1},{10859,3,0,-1},{10860,3,1,-1},{10863,3,0,-1}, +{10864,3,1,-1},{10868,3,0,-1},{10869,3,1,-1},{10872,3,0,-1},{10873,3,1,-1}, +{10876,3,0,-1},{10877,3,1,-1},{10881,3,0,-1},{10882,3,1,-1},{10885,3,0,-1}, +{10886,3,1,-1},{10889,3,0,-1},{10890,3,1,-1},{10894,3,0,-1},{10895,3,1,-1}, +{10898,3,0,-1},{10899,3,1,-1},{10902,3,0,-1},{10903,3,1,-1},{10907,3,0,-1}, +{10908,3,1,-1},{10911,3,0,-1},{10912,3,1,-1},{10915,3,0,-1},{10916,3,1,-1}, +{10920,3,0,-1},{10921,3,1,-1},{10854,3,0,-1},{10924,3,0,-1},{10925,3,1,-1}, +{10928,3,0,-1},{10929,3,1,-1},{10933,3,0,-1},{10934,3,1,-1},{10867,3,1,-1}, +{10937,3,0,-1},{10938,3,1,-1},{10941,3,0,-1},{10942,3,1,-1},{10946,3,0,-1}, +{10947,3,1,-1},{10950,3,0,-1},{10951,3,1,-1},{10954,3,0,-1},{10955,3,1,-1}, +{10959,3,0,-1},{10960,3,1,-1},{10963,3,0,-1},{10964,3,1,-1},{10967,3,0,-1}, +{10968,3,1,-1},{10972,3,0,-1},{10973,3,1,-1},{10976,3,0,-1},{10977,3,1,-1}, +{10980,3,0,-1},{10981,3,1,-1},{10985,3,0,-1},{10986,3,1,-1},{10989,3,0,-1}, +{10990,3,1,-1},{10993,3,0,-1},{10994,3,1,-1},{10998,3,0,-1},{10999,3,1,-1}, +{11002,3,0,-1},{11003,3,1,-1},{11006,3,0,-1},{11007,3,1,-1},{11011,3,0,-1}, +{11012,3,1,-1},{11015,3,0,-1},{11016,3,1,-1},{11019,3,0,-1},{11020,3,1,-1}, +{11024,3,0,-1},{11025,3,1,-1},{10958,3,0,-1},{11028,3,0,-1},{11029,3,1,-1}, +{11032,3,0,-1},{11033,3,1,-1},{11037,3,0,-1},{11038,3,1,-1},{10971,3,1,-1}, +{11041,3,0,-1},{11042,3,1,-1},{11045,3,0,-1},{11046,3,1,-1},{11050,3,0,-1}, +{11051,3,1,-1},{11054,3,0,-1},{11055,3,1,-1},{11058,3,0,-1},{11059,3,1,-1}, +{11063,3,0,-1},{11064,3,1,-1},{11067,3,0,-1},{11068,3,1,-1},{11071,3,0,-1}, +{11072,3,1,-1},{11076,3,0,-1},{11077,3,1,-1},{11080,3,0,-1},{11081,3,1,-1}, +{11084,3,0,-1},{11085,3,1,-1},{11089,3,0,-1},{11090,3,1,-1},{11093,3,0,-1}, +{11094,3,1,-1},{11097,3,0,-1},{11098,3,1,-1},{11102,3,0,-1},{11103,3,1,-1}, +{11106,3,0,-1},{11107,3,1,-1},{11110,3,0,-1},{11111,3,1,-1},{11115,3,0,-1}, +{11116,3,1,-1},{11119,3,0,-1},{11120,3,1,-1},{11123,3,0,-1},{11124,3,1,-1}, +{11128,3,0,-1},{11129,3,1,-1},{11062,3,0,-1},{11132,3,0,-1},{11133,3,1,-1}, +{11136,3,0,-1},{11137,3,1,-1},{11141,3,0,-1},{11142,3,1,-1},{11075,3,1,-1}, +{11145,3,0,-1},{11146,3,1,-1},{11149,3,0,-1},{11150,3,1,-1},{11154,3,0,-1}, +{11155,3,1,-1},{11158,3,0,-1},{11159,3,1,-1},{11162,3,0,-1},{11163,3,1,-1}, +{11167,3,0,-1},{11168,3,1,-1},{11171,3,0,-1},{11172,3,1,-1},{11175,3,0,-1}, +{11176,3,1,-1},{11180,3,0,-1},{11181,3,1,-1},{11184,3,0,-1},{11185,3,1,-1}, +{11188,3,0,-1},{11189,3,1,-1},{11193,3,0,-1},{11194,3,1,-1},{11197,3,0,-1}, +{11198,3,1,-1},{11201,3,0,-1},{11202,3,1,-1},{11206,3,0,-1},{11207,3,1,-1}, +{11210,3,0,-1},{11211,3,1,-1},{11214,3,0,-1},{11215,3,1,-1},{11219,3,0,-1}, +{11220,3,1,-1},{11223,3,0,-1},{11224,3,1,-1},{11227,3,0,-1},{11228,3,1,-1}, +{11232,3,0,-1},{11233,3,1,-1},{11166,3,0,-1},{11236,3,0,-1},{11237,3,1,-1}, +{11240,3,0,-1},{11241,3,1,-1},{11245,3,0,-1},{11246,3,1,-1},{11179,3,1,-1}, +{11249,3,0,-1},{11250,3,1,-1},{11253,3,0,-1},{11254,3,1,-1},{11258,3,0,-1}, +{11259,3,1,-1},{11262,3,0,-1},{11263,3,1,-1},{11266,3,0,-1},{11267,3,1,-1}, +{11271,3,0,-1},{11272,3,1,-1},{11275,3,0,-1},{11276,3,1,-1},{11279,3,0,-1}, +{11280,3,1,-1},{11284,3,0,-1},{11285,3,1,-1},{11288,3,0,-1},{11289,3,1,-1}, +{11292,3,0,-1},{11293,3,1,-1},{11297,3,0,-1},{11298,3,1,-1},{11301,3,0,-1}, +{11302,3,1,-1},{11305,3,0,-1},{11306,3,1,-1},{11310,3,0,-1},{11311,3,1,-1}, +{11314,3,0,-1},{11315,3,1,-1},{11318,3,0,-1},{11319,3,1,-1},{11323,3,0,-1}, +{11324,3,1,-1},{11327,3,0,-1},{11328,3,1,-1},{11331,3,0,-1},{11332,3,1,-1}, +{11336,3,0,-1},{11337,3,1,-1},{11270,3,0,-1},{11340,3,0,-1},{11341,3,1,-1}, +{11344,3,0,-1},{11345,3,1,-1},{11349,3,0,-1},{11350,3,1,-1},{11283,3,1,-1}, +{11353,3,0,-1},{11354,3,1,-1},{11357,3,0,-1},{11358,3,1,-1},{11362,3,0,-1}, +{11363,3,1,-1},{11366,3,0,-1},{11367,3,1,-1},{11370,3,0,-1},{11371,3,1,-1}, +{11375,3,0,-1},{11376,3,1,-1},{11379,3,0,-1},{11380,3,1,-1},{11383,3,0,-1}, +{11384,3,1,-1},{11388,3,0,-1},{11389,3,1,-1},{11392,3,0,-1},{11393,3,1,-1}, +{11396,3,0,-1},{11397,3,1,-1},{11401,3,0,-1},{11402,3,1,-1},{11405,3,0,-1}, +{11406,3,1,-1},{11409,3,0,-1},{11410,3,1,-1},{11414,3,0,-1},{11415,3,1,-1}, +{11418,3,0,-1},{11419,3,1,-1},{11422,3,0,-1},{11423,3,1,-1},{11427,3,0,-1}, +{11428,3,1,-1},{11431,3,0,-1},{11432,3,1,-1},{11435,3,0,-1},{11436,3,1,-1}, +{11440,3,0,-1},{11441,3,1,-1},{11374,3,0,-1},{11444,3,0,-1},{11445,3,1,-1}, +{11448,3,0,-1},{11449,3,1,-1},{11453,3,0,-1},{11454,3,1,-1},{11387,3,1,-1}, +{11457,3,0,-1},{11458,3,1,-1},{11461,3,0,-1},{11462,3,1,-1},{11466,3,0,-1}, +{11467,3,1,-1},{11470,3,0,-1},{11471,3,1,-1},{11474,3,0,-1},{11475,3,1,-1}, +{11479,3,0,-1},{11480,3,1,-1},{11483,3,0,-1},{11484,3,1,-1},{11487,3,0,-1}, +{11488,3,1,-1},{11492,3,0,-1},{11493,3,1,-1},{11496,3,0,-1},{11497,3,1,-1}, +{11500,3,0,-1},{11501,3,1,-1},{11505,3,0,-1},{11506,3,1,-1},{11509,3,0,-1}, +{11510,3,1,-1},{11513,3,0,-1},{11514,3,1,-1},{11518,3,0,-1},{11519,3,1,-1}, +{11522,3,0,-1},{11523,3,1,-1},{11526,3,0,-1},{11527,3,1,-1},{11531,3,0,-1}, +{11532,3,1,-1},{11535,3,0,-1},{11536,3,1,-1},{11539,3,0,-1},{11540,3,1,-1}, +{11544,3,0,-1},{11545,3,1,-1},{11478,3,0,-1},{11548,3,0,-1},{11549,3,1,-1}, +{11552,3,0,-1},{11553,3,1,-1},{11557,3,0,-1},{11558,3,1,-1},{11491,3,1,-1}, +{11561,3,0,-1},{11562,3,1,-1},{11565,3,0,-1},{11566,3,1,-1},{11570,3,0,-1}, +{11571,3,1,-1},{11574,3,0,-1},{11575,3,1,-1},{11578,3,0,-1},{11579,3,1,-1}, +{11583,3,0,-1},{11584,3,1,-1},{11587,3,0,-1},{11588,3,1,-1},{11591,3,0,-1}, +{11592,3,1,-1},{11596,3,0,-1},{11597,3,1,-1},{11600,3,0,-1},{11601,3,1,-1}, +{11604,3,0,-1},{11605,3,1,-1},{11609,3,0,-1},{11610,3,1,-1},{11613,3,0,-1}, +{11614,3,1,-1},{11617,3,0,-1},{11618,3,1,-1},{11622,3,0,-1},{11623,3,1,-1}, +{11626,3,0,-1},{11627,3,1,-1},{11630,3,0,-1},{11631,3,1,-1},{11635,3,0,-1}, +{11636,3,1,-1},{11639,3,0,-1},{11640,3,1,-1},{11643,3,0,-1},{11644,3,1,-1}, +{11648,3,0,-1},{11649,3,1,-1},{11582,3,0,-1},{11652,3,0,-1},{11653,3,1,-1}, +{11656,3,0,-1},{11657,3,1,-1},{11661,3,0,-1},{11662,3,1,-1},{11595,3,1,-1}, +{11665,3,0,-1},{11666,3,1,-1},{11669,3,0,-1},{11670,3,1,-1},{11674,3,0,-1}, +{11675,3,1,-1},{11678,3,0,-1},{11679,3,1,-1},{11682,3,0,-1},{11683,3,1,-1}, +{11687,3,0,-1},{11688,3,1,-1},{11691,3,0,-1},{11692,3,1,-1},{11695,3,0,-1}, +{11696,3,1,-1},{11700,3,0,-1},{11701,3,1,-1},{11704,3,0,-1},{11705,3,1,-1}, +{11708,3,0,-1},{11709,3,1,-1},{11713,3,0,-1},{11714,3,1,-1},{11717,3,0,-1}, +{11718,3,1,-1},{11721,3,0,-1},{11722,3,1,-1},{11726,3,0,-1},{11727,3,1,-1}, +{11730,3,0,-1},{11731,3,1,-1},{11734,3,0,-1},{11735,3,1,-1},{11739,3,0,-1}, +{11740,3,1,-1},{11743,3,0,-1},{11744,3,1,-1},{11747,3,0,-1},{11748,3,1,-1}, +{11752,3,0,-1},{11753,3,1,-1},{11686,3,0,-1},{11756,3,0,-1},{11757,3,1,-1}, +{11760,3,0,-1},{11761,3,1,-1},{11765,3,0,-1},{11766,3,1,-1},{11699,3,1,-1}, +{11769,3,0,-1},{11770,3,1,-1},{11773,3,0,-1},{11774,3,1,-1},{11778,3,0,-1}, +{11779,3,1,-1},{11782,3,0,-1},{11783,3,1,-1},{11786,3,0,-1},{11787,3,1,-1}, +{11791,3,0,-1},{11792,3,1,-1},{11795,3,0,-1},{11796,3,1,-1},{11799,3,0,-1}, +{11800,3,1,-1},{11804,3,0,-1},{11805,3,1,-1},{11808,3,0,-1},{11809,3,1,-1}, +{11812,3,0,-1},{11813,3,1,-1},{11817,3,0,-1},{11818,3,1,-1},{11821,3,0,-1}, +{11822,3,1,-1},{11825,3,0,-1},{11826,3,1,-1},{11830,3,0,-1},{11831,3,1,-1}, +{11834,3,0,-1},{11835,3,1,-1},{11838,3,0,-1},{11839,3,1,-1},{11843,3,0,-1}, +{11844,3,1,-1},{11847,3,0,-1},{11848,3,1,-1},{11851,3,0,-1},{11852,3,1,-1}, +{11856,3,0,-1},{11857,3,1,-1},{11790,3,0,-1},{11860,3,0,-1},{11861,3,1,-1}, +{11864,3,0,-1},{11865,3,1,-1},{11869,3,0,-1},{11870,3,1,-1},{11803,3,1,-1}, +{11873,3,0,-1},{11874,3,1,-1},{11877,3,0,-1},{11878,3,1,-1},{11882,3,0,-1}, +{11883,3,1,-1},{11886,3,0,-1},{11887,3,1,-1},{11890,3,0,-1},{11891,3,1,-1}, +{11895,3,0,-1},{11896,3,1,-1},{11899,3,0,-1},{11900,3,1,-1},{11903,3,0,-1}, +{11904,3,1,-1},{11908,3,0,-1},{11909,3,1,-1},{11912,3,0,-1},{11913,3,1,-1}, +{11916,3,0,-1},{11917,3,1,-1},{11921,3,0,-1},{11922,3,1,-1},{11925,3,0,-1}, +{11926,3,1,-1},{11929,3,0,-1},{11930,3,1,-1},{11934,3,0,-1},{11935,3,1,-1}, +{11938,3,0,-1},{11939,3,1,-1},{11942,3,0,-1},{11943,3,1,-1},{11947,3,0,-1}, +{11948,3,1,-1},{11951,3,0,-1},{11952,3,1,-1},{11955,3,0,-1},{11956,3,1,-1}, +{11960,3,0,-1},{11961,3,1,-1},{11894,3,0,-1},{11964,3,0,-1},{11965,3,1,-1}, +{11968,3,0,-1},{11969,3,1,-1},{11973,3,0,-1},{11974,3,1,-1},{11907,3,1,-1}, +{11977,3,0,-1},{11978,3,1,-1},{11981,3,0,-1},{11982,3,1,-1},{11986,3,0,-1}, +{11987,3,1,-1},{11990,3,0,-1},{11991,3,1,-1},{11994,3,0,-1},{11995,3,1,-1}, +{11999,3,0,-1},{12000,3,1,-1},{12003,3,0,-1},{12004,3,1,-1},{12007,3,0,-1}, +{12008,3,1,-1},{12012,3,0,-1},{12013,3,1,-1},{12016,3,0,-1},{12017,3,1,-1}, +{12020,3,0,-1},{12021,3,1,-1},{12025,3,0,-1},{12026,3,1,-1},{12029,3,0,-1}, +{12030,3,1,-1},{12033,3,0,-1},{12034,3,1,-1},{12038,3,0,-1},{12039,3,1,-1}, +{12042,3,0,-1},{12043,3,1,-1},{12046,3,0,-1},{12047,3,1,-1},{12051,3,0,-1}, +{12052,3,1,-1},{12055,3,0,-1},{12056,3,1,-1},{12059,3,0,-1},{12060,3,1,-1}, +{12064,3,0,-1},{12065,3,1,-1},{11998,3,0,-1},{12068,3,0,-1},{12069,3,1,-1}, +{12072,3,0,-1},{12073,3,1,-1},{12077,3,0,-1},{12078,3,1,-1},{12011,3,1,-1}, +{12081,3,0,-1},{12082,3,1,-1},{12085,3,0,-1},{12086,3,1,-1},{12090,3,0,-1}, +{12091,3,1,-1},{12094,3,0,-1},{12095,3,1,-1},{12098,3,0,-1},{12099,3,1,-1}, +{12103,3,0,-1},{12104,3,1,-1},{12107,3,0,-1},{12108,3,1,-1},{12111,3,0,-1}, +{12112,3,1,-1},{12116,3,0,-1},{12117,3,1,-1},{12120,3,0,-1},{12121,3,1,-1}, +{12124,3,0,-1},{12125,3,1,-1},{12129,3,0,-1},{12130,3,1,-1},{12133,3,0,-1}, +{12134,3,1,-1},{12137,3,0,-1},{12138,3,1,-1},{12142,3,0,-1},{12143,3,1,-1}, +{12146,3,0,-1},{12147,3,1,-1},{12150,3,0,-1},{12151,3,1,-1},{12155,3,0,-1}, +{12156,3,1,-1},{12159,3,0,-1},{12160,3,1,-1},{12164,3,1,-1},{12168,3,0,-1}, +{12169,3,1,-1},{12102,3,0,-1},{12172,3,0,-1},{12173,3,1,-1},{12176,3,0,-1}, +{12177,3,1,-1},{12181,3,0,-1},{12182,3,1,-1},{12115,3,1,-1},{12185,3,0,-1}, +{12186,3,1,-1},{12189,3,0,-1},{12190,3,1,-1},{12194,3,0,-1},{12195,3,1,-1}, +{12198,3,0,-1},{12199,3,1,-1},{12202,3,0,-1},{12203,3,1,-1},{12207,3,0,-1}, +{12208,3,1,-1},{12211,3,0,-1},{12212,3,1,-1},{12216,3,1,-1},{12220,3,0,-1}, +{12221,3,1,-1},{12224,3,0,-1},{12225,3,1,-1},{12228,3,0,-1},{12229,3,1,-1}, +{12233,3,0,-1},{12234,3,1,-1},{12237,3,0,-1},{12238,3,1,-1},{12241,3,0,-1}, +{12242,3,1,-1},{12246,3,0,-1},{12247,3,1,-1},{12250,3,0,-1},{12251,3,1,-1}, +{12254,3,0,-1},{12255,3,1,-1},{12260,3,1,-1},{12264,3,1,-1},{12268,3,1,-1}, +{12273,3,1,-1},{12281,3,1,-1},{12286,3,1,-1},{12290,3,1,-1},{12294,3,1,-1}, +{12299,3,1,-1},{12303,3,1,-1},{12307,3,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_4_ss0_ss1[] = { +{7704,4,0,-1},{7713,4,0,-1},{7722,4,0,-1},{7730,4,0,-1},{7739,4,0,-1}, +{7748,4,0,-1},{7756,4,0,-1},{7765,4,0,-1},{7774,4,0,-1},{7782,4,0,-1}, +{7791,4,0,-1},{7800,4,0,-1},{7808,4,0,-1},{7817,4,0,-1},{7826,4,0,-1}, +{7760,4,0,-1},{7834,4,0,-1},{7843,4,0,-1},{7852,4,0,-1},{7860,4,0,-1}, +{7865,4,0,-1},{7869,4,0,-1},{7873,4,0,-1},{7878,4,0,-1},{7882,4,0,-1}, +{7886,4,0,-1},{7891,4,0,-1},{7895,4,0,-1},{7899,4,0,-1},{7904,4,0,-1}, +{7908,4,0,-1},{7912,4,0,-1},{7917,4,0,-1},{7921,4,0,-1},{7925,4,0,-1}, +{7930,4,0,-1},{7864,4,0,-1},{7934,4,0,-1},{7938,4,0,-1},{7943,4,0,-1}, +{7947,4,0,-1},{7951,4,0,-1},{7956,4,0,-1},{7960,4,0,-1},{7964,4,0,-1}, +{7969,4,0,-1},{7973,4,0,-1},{7977,4,0,-1},{7982,4,0,-1},{7986,4,0,-1}, +{7990,4,0,-1},{7995,4,0,-1},{7999,4,0,-1},{8003,4,0,-1},{8008,4,0,-1}, +{8012,4,0,-1},{8016,4,0,-1},{8021,4,0,-1},{8025,4,0,-1},{8029,4,0,-1}, +{8034,4,0,-1},{7968,4,0,-1},{8038,4,0,-1},{8042,4,0,-1},{8047,4,0,-1}, +{8051,4,0,-1},{8055,4,0,-1},{8060,4,0,-1},{8064,4,0,-1},{8068,4,0,-1}, +{8073,4,0,-1},{8077,4,0,-1},{8081,4,0,-1},{8086,4,0,-1},{8090,4,0,-1}, +{8094,4,0,-1},{8099,4,0,-1},{8103,4,0,-1},{8107,4,0,-1},{8112,4,0,-1}, +{8116,4,0,-1},{8120,4,0,-1},{8121,4,1,-1},{8125,4,0,-1},{8129,4,0,-1}, +{8130,4,1,-1},{8133,4,0,-1},{8138,4,0,-1},{8139,4,1,-1},{8072,4,0,-1}, +{8142,4,0,-1},{8146,4,0,-1},{8147,4,1,-1},{8151,4,0,-1},{8155,4,0,-1}, +{8156,4,1,-1},{8159,4,0,-1},{8164,4,0,-1},{8165,4,1,-1},{8168,4,0,-1}, +{8172,4,0,-1},{8173,4,1,-1},{8177,4,0,-1},{8181,4,0,-1},{8182,4,1,-1}, +{8185,4,0,-1},{8190,4,0,-1},{8191,4,1,-1},{8194,4,0,-1},{8198,4,0,-1}, +{8199,4,1,-1},{8203,4,0,-1},{8207,4,0,-1},{8208,4,1,-1},{8211,4,0,-1}, +{8216,4,0,-1},{8217,4,1,-1},{8220,4,0,-1},{8224,4,0,-1},{8225,4,1,-1}, +{8229,4,0,-1},{8230,4,1,-1},{8233,4,0,-1},{8234,4,1,-1},{8237,4,0,-1}, +{8238,4,1,-1},{8242,4,0,-1},{8243,4,1,-1},{8176,4,0,-1},{8246,4,0,-1}, +{8247,4,1,-1},{8250,4,0,-1},{8251,4,1,-1},{8255,4,0,-1},{8189,4,1,-1}, +{8259,4,0,-1},{8260,4,1,-1},{8263,4,0,-1},{8264,4,1,-1},{8268,4,0,-1}, +{8269,4,1,-1},{8272,4,0,-1},{8273,4,1,-1},{8276,4,0,-1},{8277,4,1,-1}, +{8281,4,0,-1},{8282,4,1,-1},{8285,4,0,-1},{8286,4,1,-1},{8289,4,0,-1}, +{8290,4,1,-1},{8294,4,0,-1},{8295,4,1,-1},{8299,4,1,-1},{8302,4,0,-1}, +{8303,4,1,-1},{8307,4,0,-1},{8308,4,1,-1},{8311,4,0,-1},{8312,4,1,-1}, +{8315,4,0,-1},{8316,4,1,-1},{8320,4,0,-1},{8321,4,1,-1},{8324,4,0,-1}, +{8325,4,1,-1},{8328,4,0,-1},{8329,4,1,-1},{8333,4,0,-1},{8334,4,1,-1}, +{8337,4,0,-1},{8338,4,1,-1},{8341,4,0,-1},{8342,4,1,-1},{8346,4,0,-1}, +{8347,4,1,-1},{8280,4,0,-1},{8350,4,0,-1},{8351,4,1,-1},{8354,4,0,-1}, +{8355,4,1,-1},{8359,4,0,-1},{8360,4,1,-1},{8293,4,1,-1},{8363,4,0,-1}, +{8364,4,1,-1},{8367,4,0,-1},{8368,4,1,-1},{8372,4,0,-1},{8373,4,1,-1}, +{8376,4,0,-1},{8377,4,1,-1},{8380,4,0,-1},{8381,4,1,-1},{8385,4,0,-1}, +{8386,4,1,-1},{8389,4,0,-1},{8390,4,1,-1},{8393,4,0,-1},{8394,4,1,-1}, +{8398,4,0,-1},{8399,4,1,-1},{8402,4,0,-1},{8403,4,1,-1},{8406,4,0,-1}, +{8407,4,1,-1},{8411,4,0,-1},{8412,4,1,-1},{8415,4,0,-1},{8416,4,1,-1}, +{8419,4,0,-1},{8420,4,1,-1},{8424,4,0,-1},{8425,4,1,-1},{8428,4,0,-1}, +{8429,4,1,-1},{8432,4,0,-1},{8433,4,1,-1},{8437,4,0,-1},{8438,4,1,-1}, +{8441,4,0,-1},{8442,4,1,-1},{8445,4,0,-1},{8446,4,1,-1},{8450,4,0,-1}, +{8451,4,1,-1},{8384,4,0,-1},{8454,4,0,-1},{8455,4,1,-1},{8458,4,0,-1}, +{8459,4,1,-1},{8463,4,0,-1},{8397,4,1,-1},{8467,4,0,-1},{8468,4,1,-1}, +{8471,4,0,-1},{8472,4,1,-1},{8476,4,0,-1},{8477,4,1,-1},{8480,4,0,-1}, +{8481,4,1,-1},{8484,4,0,-1},{8485,4,1,-1},{8489,4,0,-1},{8490,4,1,-1}, +{8493,4,0,-1},{8494,4,1,-1},{8497,4,0,-1},{8498,4,1,-1},{8502,4,0,-1}, +{8503,4,1,-1},{8507,4,1,-1},{8510,4,0,-1},{8511,4,1,-1},{8515,4,0,-1}, +{8519,4,0,-1},{8520,4,1,-1},{8523,4,0,-1},{8524,4,1,-1},{8528,4,0,-1}, +{8529,4,1,-1},{8532,4,0,-1},{8533,4,1,-1},{8536,4,0,-1},{8537,4,1,-1}, +{8541,4,0,-1},{8542,4,1,-1},{8545,4,0,-1},{8546,4,1,-1},{8549,4,0,-1}, +{8550,4,1,-1},{8554,4,0,-1},{8555,4,1,-1},{8488,4,0,-1},{8558,4,0,-1}, +{8559,4,1,-1},{8562,4,0,-1},{8563,4,1,-1},{8567,4,0,-1},{8568,4,1,-1}, +{8501,4,1,-1},{8571,4,0,-1},{8572,4,1,-1},{8575,4,0,-1},{8576,4,1,-1}, +{8580,4,0,-1},{8581,4,1,-1},{8584,4,0,-1},{8585,4,1,-1},{8588,4,0,-1}, +{8589,4,1,-1},{8593,4,0,-1},{8594,4,1,-1},{8597,4,0,-1},{8598,4,1,-1}, +{8601,4,0,-1},{8602,4,1,-1},{8606,4,0,-1},{8607,4,1,-1},{8610,4,0,-1}, +{8611,4,1,-1},{8614,4,0,-1},{8615,4,1,-1},{8619,4,0,-1},{8620,4,1,-1}, +{8623,4,0,-1},{8624,4,1,-1},{8627,4,0,-1},{8628,4,1,-1},{8632,4,0,-1}, +{8633,4,1,-1},{8636,4,0,-1},{8637,4,1,-1},{8640,4,0,-1},{8641,4,1,-1}, +{8645,4,0,-1},{8646,4,1,-1},{8649,4,0,-1},{8650,4,1,-1},{8653,4,0,-1}, +{8654,4,1,-1},{8658,4,0,-1},{8659,4,1,-1},{8592,4,0,-1},{8662,4,0,-1}, +{8663,4,1,-1},{8666,4,0,-1},{8667,4,1,-1},{8671,4,0,-1},{8672,4,1,-1}, +{8605,4,1,-1},{8675,4,0,-1},{8676,4,1,-1},{8679,4,0,-1},{8680,4,1,-1}, +{8684,4,0,-1},{8685,4,1,-1},{8688,4,0,-1},{8689,4,1,-1},{8692,4,0,-1}, +{8693,4,1,-1},{8697,4,0,-1},{8698,4,1,-1},{8701,4,0,-1},{8702,4,1,-1}, +{8705,4,0,-1},{8706,4,1,-1},{8710,4,0,-1},{8711,4,1,-1},{8714,4,0,-1}, +{8715,4,1,-1},{8718,4,0,-1},{8719,4,1,-1},{8723,4,0,-1},{8724,4,1,-1}, +{8727,4,0,-1},{8728,4,1,-1},{8731,4,0,-1},{8732,4,1,-1},{8736,4,0,-1}, +{8737,4,1,-1},{8740,4,0,-1},{8741,4,1,-1},{8744,4,0,-1},{8745,4,1,-1}, +{8749,4,0,-1},{8750,4,1,-1},{8753,4,0,-1},{8754,4,1,-1},{8757,4,0,-1}, +{8758,4,1,-1},{8762,4,0,-1},{8763,4,1,-1},{8696,4,0,-1},{8766,4,0,-1}, +{8767,4,1,-1},{8770,4,0,-1},{8771,4,1,-1},{8775,4,0,-1},{8776,4,1,-1}, +{8709,4,1,-1},{8779,4,0,-1},{8780,4,1,-1},{8783,4,0,-1},{8784,4,1,-1}, +{8788,4,0,-1},{8789,4,1,-1},{8792,4,0,-1},{8793,4,1,-1},{8796,4,0,-1}, +{8797,4,1,-1},{8801,4,0,-1},{8802,4,1,-1},{8805,4,0,-1},{8806,4,1,-1}, +{8809,4,0,-1},{8810,4,1,-1},{8814,4,0,-1},{8815,4,1,-1},{8818,4,0,-1}, +{8819,4,1,-1},{8822,4,0,-1},{8823,4,1,-1},{8827,4,0,-1},{8828,4,1,-1}, +{8831,4,0,-1},{8832,4,1,-1},{8835,4,0,-1},{8836,4,1,-1},{8840,4,0,-1}, +{8841,4,1,-1},{8844,4,0,-1},{8845,4,1,-1},{8848,4,0,-1},{8849,4,1,-1}, +{8853,4,0,-1},{8854,4,1,-1},{8857,4,0,-1},{8858,4,1,-1},{8861,4,0,-1}, +{8862,4,1,-1},{8866,4,0,-1},{8867,4,1,-1},{8800,4,0,-1},{8870,4,0,-1}, +{8871,4,1,-1},{8874,4,0,-1},{8875,4,1,-1},{8879,4,0,-1},{8880,4,1,-1}, +{8813,4,1,-1},{8883,4,0,-1},{8884,4,1,-1},{8887,4,0,-1},{8888,4,1,-1}, +{8892,4,0,-1},{8893,4,1,-1},{8896,4,0,-1},{8897,4,1,-1},{8900,4,0,-1}, +{8901,4,1,-1},{8905,4,0,-1},{8906,4,1,-1},{8909,4,0,-1},{8910,4,1,-1}, +{8913,4,0,-1},{8914,4,1,-1},{8918,4,0,-1},{8919,4,1,-1},{8922,4,0,-1}, +{8923,4,1,-1},{8926,4,0,-1},{8927,4,1,-1},{8931,4,0,-1},{8932,4,1,-1}, +{8935,4,0,-1},{8936,4,1,-1},{8939,4,0,-1},{8940,4,1,-1},{8944,4,0,-1}, +{8945,4,1,-1},{8948,4,0,-1},{8949,4,1,-1},{8952,4,0,-1},{8953,4,1,-1}, +{8957,4,0,-1},{8958,4,1,-1},{8961,4,0,-1},{8962,4,1,-1},{8965,4,0,-1}, +{8966,4,1,-1},{8970,4,0,-1},{8971,4,1,-1},{8904,4,0,-1},{8974,4,0,-1}, +{8975,4,1,-1},{8978,4,0,-1},{8979,4,1,-1},{8983,4,0,-1},{8984,4,1,-1}, +{8917,4,1,-1},{8987,4,0,-1},{8988,4,1,-1},{8991,4,0,-1},{8992,4,1,-1}, +{8996,4,0,-1},{8997,4,1,-1},{9000,4,0,-1},{9001,4,1,-1},{9004,4,0,-1}, +{9005,4,1,-1},{9009,4,0,-1},{9010,4,1,-1},{9013,4,0,-1},{9014,4,1,-1}, +{9017,4,0,-1},{9018,4,1,-1},{9022,4,0,-1},{9023,4,1,-1},{9026,4,0,-1}, +{9027,4,1,-1},{9030,4,0,-1},{9031,4,1,-1},{9035,4,0,-1},{9036,4,1,-1}, +{9039,4,0,-1},{9040,4,1,-1},{9043,4,0,-1},{9044,4,1,-1},{9048,4,0,-1}, +{9049,4,1,-1},{9052,4,0,-1},{9053,4,1,-1},{9056,4,0,-1},{9057,4,1,-1}, +{9061,4,0,-1},{9062,4,1,-1},{9065,4,0,-1},{9066,4,1,-1},{9069,4,0,-1}, +{9070,4,1,-1},{9074,4,0,-1},{9075,4,1,-1},{9008,4,0,-1},{9078,4,0,-1}, +{9079,4,1,-1},{9082,4,0,-1},{9083,4,1,-1},{9087,4,0,-1},{9088,4,1,-1}, +{9021,4,1,-1},{9091,4,0,-1},{9092,4,1,-1},{9095,4,0,-1},{9096,4,1,-1}, +{9100,4,0,-1},{9101,4,1,-1},{9104,4,0,-1},{9105,4,1,-1},{9108,4,0,-1}, +{9109,4,1,-1},{9113,4,0,-1},{9114,4,1,-1},{9117,4,0,-1},{9118,4,1,-1}, +{9121,4,0,-1},{9122,4,1,-1},{9126,4,0,-1},{9127,4,1,-1},{9130,4,0,-1}, +{9131,4,1,-1},{9134,4,0,-1},{9135,4,1,-1},{9139,4,0,-1},{9140,4,1,-1}, +{9143,4,0,-1},{9144,4,1,-1},{9147,4,0,-1},{9148,4,1,-1},{9152,4,0,-1}, +{9153,4,1,-1},{9156,4,0,-1},{9157,4,1,-1},{9160,4,0,-1},{9161,4,1,-1}, +{9165,4,0,-1},{9166,4,1,-1},{9169,4,0,-1},{9170,4,1,-1},{9173,4,0,-1}, +{9174,4,1,-1},{9178,4,0,-1},{9179,4,1,-1},{9112,4,0,-1},{9182,4,0,-1}, +{9183,4,1,-1},{9186,4,0,-1},{9187,4,1,-1},{9191,4,0,-1},{9192,4,1,-1}, +{9125,4,1,-1},{9195,4,0,-1},{9196,4,1,-1},{9199,4,0,-1},{9200,4,1,-1}, +{9204,4,0,-1},{9205,4,1,-1},{9208,4,0,-1},{9209,4,1,-1},{9212,4,0,-1}, +{9213,4,1,-1},{9217,4,0,-1},{9218,4,1,-1},{9221,4,0,-1},{9222,4,1,-1}, +{9225,4,0,-1},{9226,4,1,-1},{9230,4,0,-1},{9231,4,1,-1},{9234,4,0,-1}, +{9235,4,1,-1},{9238,4,0,-1},{9239,4,1,-1},{9243,4,0,-1},{9244,4,1,-1}, +{9247,4,0,-1},{9248,4,1,-1},{9251,4,0,-1},{9252,4,1,-1},{9256,4,0,-1}, +{9257,4,1,-1},{9260,4,0,-1},{9261,4,1,-1},{9264,4,0,-1},{9265,4,1,-1}, +{9269,4,0,-1},{9270,4,1,-1},{9273,4,0,-1},{9274,4,1,-1},{9277,4,0,-1}, +{9278,4,1,-1},{9282,4,0,-1},{9283,4,1,-1},{9216,4,0,-1},{9286,4,0,-1}, +{9287,4,1,-1},{9290,4,0,-1},{9291,4,1,-1},{9295,4,0,-1},{9296,4,1,-1}, +{9229,4,1,-1},{9299,4,0,-1},{9300,4,1,-1},{9303,4,0,-1},{9304,4,1,-1}, +{9308,4,0,-1},{9309,4,1,-1},{9312,4,0,-1},{9313,4,1,-1},{9316,4,0,-1}, +{9317,4,1,-1},{9321,4,0,-1},{9322,4,1,-1},{9325,4,0,-1},{9326,4,1,-1}, +{9329,4,0,-1},{9330,4,1,-1},{9334,4,0,-1},{9335,4,1,-1},{9338,4,0,-1}, +{9339,4,1,-1},{9342,4,0,-1},{9343,4,1,-1},{9347,4,0,-1},{9348,4,1,-1}, +{9351,4,0,-1},{9352,4,1,-1},{9355,4,0,-1},{9356,4,1,-1},{9360,4,0,-1}, +{9361,4,1,-1},{9364,4,0,-1},{9365,4,1,-1},{9368,4,0,-1},{9369,4,1,-1}, +{9373,4,0,-1},{9374,4,1,-1},{9377,4,0,-1},{9378,4,1,-1},{9381,4,0,-1}, +{9382,4,1,-1},{9386,4,0,-1},{9387,4,1,-1},{9320,4,0,-1},{9390,4,0,-1}, +{9391,4,1,-1},{9394,4,0,-1},{9395,4,1,-1},{9399,4,0,-1},{9400,4,1,-1}, +{9333,4,1,-1},{9403,4,0,-1},{9404,4,1,-1},{9407,4,0,-1},{9408,4,1,-1}, +{9412,4,0,-1},{9413,4,1,-1},{9416,4,0,-1},{9417,4,1,-1},{9420,4,0,-1}, +{9421,4,1,-1},{9425,4,0,-1},{9426,4,1,-1},{9429,4,0,-1},{9430,4,1,-1}, +{9433,4,0,-1},{9434,4,1,-1},{9438,4,0,-1},{9439,4,1,-1},{9442,4,0,-1}, +{9443,4,1,-1},{9446,4,0,-1},{9447,4,1,-1},{9451,4,0,-1},{9452,4,1,-1}, +{9455,4,0,-1},{9456,4,1,-1},{9459,4,0,-1},{9460,4,1,-1},{9464,4,0,-1}, +{9465,4,1,-1},{9468,4,0,-1},{9469,4,1,-1},{9472,4,0,-1},{9473,4,1,-1}, +{9477,4,0,-1},{9478,4,1,-1},{9481,4,0,-1},{9482,4,1,-1},{9485,4,0,-1}, +{9486,4,1,-1},{9490,4,0,-1},{9491,4,1,-1},{9424,4,0,-1},{9494,4,0,-1}, +{9495,4,1,-1},{9498,4,0,-1},{9499,4,1,-1},{9503,4,0,-1},{9504,4,1,-1}, +{9437,4,1,-1},{9507,4,0,-1},{9508,4,1,-1},{9511,4,0,-1},{9512,4,1,-1}, +{9516,4,0,-1},{9517,4,1,-1},{9520,4,0,-1},{9521,4,1,-1},{9524,4,0,-1}, +{9525,4,1,-1},{9529,4,0,-1},{9530,4,1,-1},{9533,4,0,-1},{9534,4,1,-1}, +{9537,4,0,-1},{9538,4,1,-1},{9542,4,0,-1},{9543,4,1,-1},{9546,4,0,-1}, +{9547,4,1,-1},{9550,4,0,-1},{9551,4,1,-1},{9555,4,0,-1},{9556,4,1,-1}, +{9559,4,0,-1},{9560,4,1,-1},{9563,4,0,-1},{9564,4,1,-1},{9568,4,0,-1}, +{9569,4,1,-1},{9572,4,0,-1},{9573,4,1,-1},{9576,4,0,-1},{9577,4,1,-1}, +{9581,4,0,-1},{9582,4,1,-1},{9585,4,0,-1},{9586,4,1,-1},{9589,4,0,-1}, +{9590,4,1,-1},{9594,4,0,-1},{9595,4,1,-1},{9528,4,0,-1},{9598,4,0,-1}, +{9599,4,1,-1},{9602,4,0,-1},{9603,4,1,-1},{9607,4,0,-1},{9608,4,1,-1}, +{9541,4,1,-1},{9611,4,0,-1},{9612,4,1,-1},{9615,4,0,-1},{9616,4,1,-1}, +{9620,4,0,-1},{9621,4,1,-1},{9624,4,0,-1},{9625,4,1,-1},{9628,4,0,-1}, +{9629,4,1,-1},{9633,4,0,-1},{9634,4,1,-1},{9637,4,0,-1},{9638,4,1,-1}, +{9641,4,0,-1},{9642,4,1,-1},{9646,4,0,-1},{9647,4,1,-1},{9650,4,0,-1}, +{9651,4,1,-1},{9654,4,0,-1},{9655,4,1,-1},{9659,4,0,-1},{9660,4,1,-1}, +{9663,4,0,-1},{9664,4,1,-1},{9667,4,0,-1},{9668,4,1,-1},{9672,4,0,-1}, +{9673,4,1,-1},{9676,4,0,-1},{9677,4,1,-1},{9680,4,0,-1},{9681,4,1,-1}, +{9685,4,0,-1},{9686,4,1,-1},{9689,4,0,-1},{9690,4,1,-1},{9693,4,0,-1}, +{9694,4,1,-1},{9698,4,0,-1},{9699,4,1,-1},{9632,4,0,-1},{9702,4,0,-1}, +{9703,4,1,-1},{9706,4,0,-1},{9707,4,1,-1},{9711,4,0,-1},{9712,4,1,-1}, +{9645,4,1,-1},{9715,4,0,-1},{9716,4,1,-1},{9719,4,0,-1},{9720,4,1,-1}, +{9724,4,0,-1},{9725,4,1,-1},{9728,4,0,-1},{9729,4,1,-1},{9732,4,0,-1}, +{9733,4,1,-1},{9737,4,0,-1},{9738,4,1,-1},{9741,4,0,-1},{9742,4,1,-1}, +{9745,4,0,-1},{9746,4,1,-1},{9750,4,0,-1},{9751,4,1,-1},{9754,4,0,-1}, +{9755,4,1,-1},{9758,4,0,-1},{9759,4,1,-1},{9763,4,0,-1},{9764,4,1,-1}, +{9767,4,0,-1},{9768,4,1,-1},{9771,4,0,-1},{9772,4,1,-1},{9776,4,0,-1}, +{9777,4,1,-1},{9780,4,0,-1},{9781,4,1,-1},{9784,4,0,-1},{9785,4,1,-1}, +{9789,4,0,-1},{9790,4,1,-1},{9793,4,0,-1},{9794,4,1,-1},{9797,4,0,-1}, +{9798,4,1,-1},{9802,4,0,-1},{9803,4,1,-1},{9736,4,0,-1},{9806,4,0,-1}, +{9807,4,1,-1},{9810,4,0,-1},{9811,4,1,-1},{9815,4,0,-1},{9816,4,1,-1}, +{9749,4,1,-1},{9819,4,0,-1},{9820,4,1,-1},{9823,4,0,-1},{9824,4,1,-1}, +{9828,4,0,-1},{9829,4,1,-1},{9832,4,0,-1},{9833,4,1,-1},{9836,4,0,-1}, +{9837,4,1,-1},{9841,4,0,-1},{9842,4,1,-1},{9845,4,0,-1},{9846,4,1,-1}, +{9849,4,0,-1},{9850,4,1,-1},{9854,4,0,-1},{9855,4,1,-1},{9858,4,0,-1}, +{9859,4,1,-1},{9862,4,0,-1},{9863,4,1,-1},{9867,4,0,-1},{9868,4,1,-1}, +{9871,4,0,-1},{9872,4,1,-1},{9875,4,0,-1},{9876,4,1,-1},{9880,4,0,-1}, +{9881,4,1,-1},{9884,4,0,-1},{9885,4,1,-1},{9888,4,0,-1},{9889,4,1,-1}, +{9893,4,0,-1},{9894,4,1,-1},{9897,4,0,-1},{9898,4,1,-1},{9901,4,0,-1}, +{9902,4,1,-1},{9906,4,0,-1},{9907,4,1,-1},{9840,4,0,-1},{9910,4,0,-1}, +{9911,4,1,-1},{9914,4,0,-1},{9915,4,1,-1},{9919,4,0,-1},{9920,4,1,-1}, +{9853,4,1,-1},{9923,4,0,-1},{9924,4,1,-1},{9927,4,0,-1},{9928,4,1,-1}, +{9932,4,0,-1},{9933,4,1,-1},{9936,4,0,-1},{9937,4,1,-1},{9940,4,0,-1}, +{9941,4,1,-1},{9945,4,0,-1},{9946,4,1,-1},{9949,4,0,-1},{9950,4,1,-1}, +{9953,4,0,-1},{9954,4,1,-1},{9958,4,0,-1},{9959,4,1,-1},{9962,4,0,-1}, +{9963,4,1,-1},{9966,4,0,-1},{9967,4,1,-1},{9971,4,0,-1},{9972,4,1,-1}, +{9975,4,0,-1},{9976,4,1,-1},{9979,4,0,-1},{9980,4,1,-1},{9984,4,0,-1}, +{9985,4,1,-1},{9988,4,0,-1},{9989,4,1,-1},{9992,4,0,-1},{9993,4,1,-1}, +{9997,4,0,-1},{9998,4,1,-1},{10001,4,0,-1},{10002,4,1,-1},{10005,4,0,-1}, +{10006,4,1,-1},{10010,4,0,-1},{10011,4,1,-1},{9944,4,0,-1},{10014,4,0,-1}, +{10015,4,1,-1},{10018,4,0,-1},{10019,4,1,-1},{10023,4,0,-1},{10024,4,1,-1}, +{9957,4,1,-1},{10027,4,0,-1},{10028,4,1,-1},{10031,4,0,-1},{10032,4,1,-1}, +{10036,4,0,-1},{10037,4,1,-1},{10040,4,0,-1},{10041,4,1,-1},{10044,4,0,-1}, +{10045,4,1,-1},{10049,4,0,-1},{10050,4,1,-1},{10053,4,0,-1},{10054,4,1,-1}, +{10057,4,0,-1},{10058,4,1,-1},{10062,4,0,-1},{10063,4,1,-1},{10066,4,0,-1}, +{10067,4,1,-1},{10070,4,0,-1},{10071,4,1,-1},{10075,4,0,-1},{10076,4,1,-1}, +{10079,4,0,-1},{10080,4,1,-1},{10083,4,0,-1},{10084,4,1,-1},{10088,4,0,-1}, +{10089,4,1,-1},{10092,4,0,-1},{10093,4,1,-1},{10096,4,0,-1},{10097,4,1,-1}, +{10101,4,0,-1},{10102,4,1,-1},{10105,4,0,-1},{10106,4,1,-1},{10109,4,0,-1}, +{10110,4,1,-1},{10114,4,0,-1},{10115,4,1,-1},{10048,4,0,-1},{10118,4,0,-1}, +{10119,4,1,-1},{10122,4,0,-1},{10123,4,1,-1},{10127,4,0,-1},{10128,4,1,-1}, +{10061,4,1,-1},{10131,4,0,-1},{10132,4,1,-1},{10135,4,0,-1},{10136,4,1,-1}, +{10140,4,0,-1},{10141,4,1,-1},{10144,4,0,-1},{10145,4,1,-1},{10148,4,0,-1}, +{10149,4,1,-1},{10153,4,0,-1},{10154,4,1,-1},{10157,4,0,-1},{10158,4,1,-1}, +{10161,4,0,-1},{10162,4,1,-1},{10166,4,0,-1},{10167,4,1,-1},{10170,4,0,-1}, +{10171,4,1,-1},{10174,4,0,-1},{10175,4,1,-1},{10179,4,0,-1},{10180,4,1,-1}, +{10183,4,0,-1},{10184,4,1,-1},{10187,4,0,-1},{10188,4,1,-1},{10192,4,0,-1}, +{10193,4,1,-1},{10196,4,0,-1},{10197,4,1,-1},{10200,4,0,-1},{10201,4,1,-1}, +{10205,4,0,-1},{10206,4,1,-1},{10209,4,0,-1},{10210,4,1,-1},{10213,4,0,-1}, +{10214,4,1,-1},{10218,4,0,-1},{10219,4,1,-1},{10152,4,0,-1},{10222,4,0,-1}, +{10223,4,1,-1},{10226,4,0,-1},{10227,4,1,-1},{10231,4,0,-1},{10232,4,1,-1}, +{10165,4,1,-1},{10235,4,0,-1},{10236,4,1,-1},{10239,4,0,-1},{10240,4,1,-1}, +{10244,4,0,-1},{10245,4,1,-1},{10248,4,0,-1},{10249,4,1,-1},{10252,4,0,-1}, +{10253,4,1,-1},{10257,4,0,-1},{10258,4,1,-1},{10261,4,0,-1},{10262,4,1,-1}, +{10265,4,0,-1},{10266,4,1,-1},{10270,4,0,-1},{10271,4,1,-1},{10274,4,0,-1}, +{10275,4,1,-1},{10278,4,0,-1},{10279,4,1,-1},{10283,4,0,-1},{10284,4,1,-1}, +{10287,4,0,-1},{10288,4,1,-1},{10291,4,0,-1},{10292,4,1,-1},{10296,4,0,-1}, +{10297,4,1,-1},{10300,4,0,-1},{10301,4,1,-1},{10304,4,0,-1},{10305,4,1,-1}, +{10309,4,0,-1},{10310,4,1,-1},{10313,4,0,-1},{10314,4,1,-1},{10317,4,0,-1}, +{10318,4,1,-1},{10322,4,0,-1},{10323,4,1,-1},{10256,4,0,-1},{10326,4,0,-1}, +{10327,4,1,-1},{10330,4,0,-1},{10331,4,1,-1},{10335,4,0,-1},{10336,4,1,-1}, +{10269,4,1,-1},{10339,4,0,-1},{10340,4,1,-1},{10343,4,0,-1},{10344,4,1,-1}, +{10348,4,0,-1},{10349,4,1,-1},{10352,4,0,-1},{10353,4,1,-1},{10356,4,0,-1}, +{10357,4,1,-1},{10361,4,0,-1},{10362,4,1,-1},{10365,4,0,-1},{10366,4,1,-1}, +{10369,4,0,-1},{10370,4,1,-1},{10374,4,0,-1},{10375,4,1,-1},{10378,4,0,-1}, +{10379,4,1,-1},{10382,4,0,-1},{10383,4,1,-1},{10387,4,0,-1},{10388,4,1,-1}, +{10391,4,0,-1},{10392,4,1,-1},{10395,4,0,-1},{10396,4,1,-1},{10400,4,0,-1}, +{10401,4,1,-1},{10404,4,0,-1},{10405,4,1,-1},{10408,4,0,-1},{10409,4,1,-1}, +{10413,4,0,-1},{10414,4,1,-1},{10417,4,0,-1},{10418,4,1,-1},{10421,4,0,-1}, +{10422,4,1,-1},{10426,4,0,-1},{10427,4,1,-1},{10360,4,0,-1},{10430,4,0,-1}, +{10431,4,1,-1},{10434,4,0,-1},{10435,4,1,-1},{10439,4,0,-1},{10440,4,1,-1}, +{10373,4,1,-1},{10443,4,0,-1},{10444,4,1,-1},{10447,4,0,-1},{10448,4,1,-1}, +{10452,4,0,-1},{10453,4,1,-1},{10456,4,0,-1},{10457,4,1,-1},{10460,4,0,-1}, +{10461,4,1,-1},{10465,4,0,-1},{10466,4,1,-1},{10469,4,0,-1},{10470,4,1,-1}, +{10473,4,0,-1},{10474,4,1,-1},{10478,4,0,-1},{10479,4,1,-1},{10482,4,0,-1}, +{10483,4,1,-1},{10486,4,0,-1},{10487,4,1,-1},{10491,4,0,-1},{10492,4,1,-1}, +{10495,4,0,-1},{10496,4,1,-1},{10499,4,0,-1},{10500,4,1,-1},{10504,4,0,-1}, +{10505,4,1,-1},{10508,4,0,-1},{10509,4,1,-1},{10512,4,0,-1},{10513,4,1,-1}, +{10517,4,0,-1},{10518,4,1,-1},{10521,4,0,-1},{10522,4,1,-1},{10525,4,0,-1}, +{10526,4,1,-1},{10530,4,0,-1},{10531,4,1,-1},{10464,4,0,-1},{10534,4,0,-1}, +{10535,4,1,-1},{10538,4,0,-1},{10539,4,1,-1},{10543,4,0,-1},{10544,4,1,-1}, +{10477,4,1,-1},{10547,4,0,-1},{10548,4,1,-1},{10551,4,0,-1},{10552,4,1,-1}, +{10556,4,0,-1},{10557,4,1,-1},{10560,4,0,-1},{10561,4,1,-1},{10564,4,0,-1}, +{10565,4,1,-1},{10569,4,0,-1},{10570,4,1,-1},{10573,4,0,-1},{10574,4,1,-1}, +{10577,4,0,-1},{10578,4,1,-1},{10582,4,0,-1},{10583,4,1,-1},{10586,4,0,-1}, +{10587,4,1,-1},{10590,4,0,-1},{10591,4,1,-1},{10595,4,0,-1},{10596,4,1,-1}, +{10599,4,0,-1},{10600,4,1,-1},{10603,4,0,-1},{10604,4,1,-1},{10608,4,0,-1}, +{10609,4,1,-1},{10612,4,0,-1},{10613,4,1,-1},{10616,4,0,-1},{10617,4,1,-1}, +{10621,4,0,-1},{10622,4,1,-1},{10625,4,0,-1},{10626,4,1,-1},{10629,4,0,-1}, +{10630,4,1,-1},{10634,4,0,-1},{10635,4,1,-1},{10568,4,0,-1},{10638,4,0,-1}, +{10639,4,1,-1},{10642,4,0,-1},{10643,4,1,-1},{10647,4,0,-1},{10648,4,1,-1}, +{10581,4,1,-1},{10651,4,0,-1},{10652,4,1,-1},{10655,4,0,-1},{10656,4,1,-1}, +{10660,4,0,-1},{10661,4,1,-1},{10664,4,0,-1},{10665,4,1,-1},{10668,4,0,-1}, +{10669,4,1,-1},{10673,4,0,-1},{10674,4,1,-1},{10677,4,0,-1},{10678,4,1,-1}, +{10681,4,0,-1},{10682,4,1,-1},{10686,4,0,-1},{10687,4,1,-1},{10690,4,0,-1}, +{10691,4,1,-1},{10694,4,0,-1},{10695,4,1,-1},{10699,4,0,-1},{10700,4,1,-1}, +{10703,4,0,-1},{10704,4,1,-1},{10707,4,0,-1},{10708,4,1,-1},{10712,4,0,-1}, +{10713,4,1,-1},{10716,4,0,-1},{10717,4,1,-1},{10720,4,0,-1},{10721,4,1,-1}, +{10725,4,0,-1},{10726,4,1,-1},{10729,4,0,-1},{10730,4,1,-1},{10733,4,0,-1}, +{10734,4,1,-1},{10738,4,0,-1},{10739,4,1,-1},{10672,4,0,-1},{10742,4,0,-1}, +{10743,4,1,-1},{10746,4,0,-1},{10747,4,1,-1},{10751,4,0,-1},{10752,4,1,-1}, +{10685,4,1,-1},{10755,4,0,-1},{10756,4,1,-1},{10759,4,0,-1},{10760,4,1,-1}, +{10764,4,0,-1},{10765,4,1,-1},{10768,4,0,-1},{10769,4,1,-1},{10772,4,0,-1}, +{10773,4,1,-1},{10777,4,0,-1},{10778,4,1,-1},{10781,4,0,-1},{10782,4,1,-1}, +{10785,4,0,-1},{10786,4,1,-1},{10790,4,0,-1},{10791,4,1,-1},{10794,4,0,-1}, +{10795,4,1,-1},{10798,4,0,-1},{10799,4,1,-1},{10803,4,0,-1},{10804,4,1,-1}, +{10807,4,0,-1},{10808,4,1,-1},{10811,4,0,-1},{10812,4,1,-1},{10816,4,0,-1}, +{10817,4,1,-1},{10820,4,0,-1},{10821,4,1,-1},{10824,4,0,-1},{10825,4,1,-1}, +{10829,4,0,-1},{10830,4,1,-1},{10833,4,0,-1},{10834,4,1,-1},{10837,4,0,-1}, +{10838,4,1,-1},{10842,4,0,-1},{10843,4,1,-1},{10776,4,0,-1},{10846,4,0,-1}, +{10847,4,1,-1},{10850,4,0,-1},{10851,4,1,-1},{10855,4,0,-1},{10856,4,1,-1}, +{10789,4,1,-1},{10859,4,0,-1},{10860,4,1,-1},{10863,4,0,-1},{10864,4,1,-1}, +{10868,4,0,-1},{10869,4,1,-1},{10872,4,0,-1},{10873,4,1,-1},{10876,4,0,-1}, +{10877,4,1,-1},{10881,4,0,-1},{10882,4,1,-1},{10885,4,0,-1},{10886,4,1,-1}, +{10889,4,0,-1},{10890,4,1,-1},{10894,4,0,-1},{10895,4,1,-1},{10898,4,0,-1}, +{10899,4,1,-1},{10902,4,0,-1},{10903,4,1,-1},{10907,4,0,-1},{10908,4,1,-1}, +{10911,4,0,-1},{10912,4,1,-1},{10915,4,0,-1},{10916,4,1,-1},{10920,4,0,-1}, +{10921,4,1,-1},{10924,4,0,-1},{10925,4,1,-1},{10928,4,0,-1},{10929,4,1,-1}, +{10933,4,0,-1},{10934,4,1,-1},{10937,4,0,-1},{10938,4,1,-1},{10941,4,0,-1}, +{10942,4,1,-1},{10946,4,0,-1},{10947,4,1,-1},{10880,4,0,-1},{10950,4,0,-1}, +{10951,4,1,-1},{10954,4,0,-1},{10955,4,1,-1},{10959,4,0,-1},{10960,4,1,-1}, +{10893,4,1,-1},{10963,4,0,-1},{10964,4,1,-1},{10967,4,0,-1},{10968,4,1,-1}, +{10972,4,0,-1},{10973,4,1,-1},{10976,4,0,-1},{10977,4,1,-1},{10980,4,0,-1}, +{10981,4,1,-1},{10985,4,0,-1},{10986,4,1,-1},{10989,4,0,-1},{10990,4,1,-1}, +{10993,4,0,-1},{10994,4,1,-1},{10998,4,0,-1},{10999,4,1,-1},{11002,4,0,-1}, +{11003,4,1,-1},{11006,4,0,-1},{11007,4,1,-1},{11012,4,1,-1},{11016,4,1,-1}, +{11020,4,1,-1},{11025,4,1,-1},{11029,4,1,-1},{11033,4,1,-1},{11038,4,1,-1}, +{11042,4,1,-1},{11046,4,1,-1},{11051,4,1,-1},{10984,4,0,-1},{11055,4,1,-1}, +{11058,4,0,-1},{11059,4,1,-1},{10997,4,1,-1},{11067,4,0,-1},{11068,4,1,-1}, +{11072,4,1,-1},{11077,4,1,-1},{11081,4,1,-1},{11085,4,1,-1},{11090,4,1,-1}, +{11094,4,1,-1},{11098,4,1,-1},{11102,4,0,-1},{11103,4,1,-1},{11107,4,1,-1}, +{11111,4,1,-1},{11116,4,1,-1},{11120,4,1,-1},{11129,4,1,-1},{11133,4,1,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS4, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_5_ss0_ss1[] = { +{5269,5,0,-1},{5278,5,0,-1},{5286,5,0,-1},{5295,5,0,-1},{5304,5,0,-1}, +{5312,5,0,-1},{5321,5,0,-1},{5330,5,0,-1},{5264,5,0,-1},{5338,5,0,-1}, +{5347,5,0,-1},{5351,5,0,-1},{5356,5,0,-1},{5360,5,0,-1},{5364,5,0,-1}, +{5369,5,0,-1},{5373,5,0,-1},{5377,5,0,-1},{5382,5,0,-1},{5386,5,0,-1}, +{5390,5,0,-1},{5395,5,0,-1},{5399,5,0,-1},{5403,5,0,-1},{5408,5,0,-1}, +{5412,5,0,-1},{5416,5,0,-1},{5421,5,0,-1},{5425,5,0,-1},{5429,5,0,-1}, +{5434,5,0,-1},{5368,5,0,-1},{5438,5,0,-1},{5442,5,0,-1},{5447,5,0,-1}, +{5451,5,0,-1},{5455,5,0,-1},{5460,5,0,-1},{5464,5,0,-1},{5468,5,0,-1}, +{5473,5,0,-1},{5477,5,0,-1},{5481,5,0,-1},{5486,5,0,-1},{5490,5,0,-1}, +{5494,5,0,-1},{5499,5,0,-1},{5503,5,0,-1},{5507,5,0,-1},{5512,5,0,-1}, +{5516,5,0,-1},{5520,5,0,-1},{5525,5,0,-1},{5529,5,0,-1},{5533,5,0,-1}, +{5538,5,0,-1},{5472,5,0,-1},{5542,5,0,-1},{5546,5,0,-1},{5551,5,0,-1}, +{5555,5,0,-1},{5559,5,0,-1},{5564,5,0,-1},{5568,5,0,-1},{5572,5,0,-1}, +{5577,5,0,-1},{5581,5,0,-1},{5585,5,0,-1},{5590,5,0,-1},{5594,5,0,-1}, +{5598,5,0,-1},{5603,5,0,-1},{5607,5,0,-1},{5611,5,0,-1},{5616,5,0,-1}, +{5620,5,0,-1},{5624,5,0,-1},{5629,5,0,-1},{5633,5,0,-1},{5637,5,0,-1}, +{5638,5,1,-1},{5642,5,0,-1},{5576,5,0,-1},{5646,5,0,-1},{5647,5,1,-1}, +{5650,5,0,-1},{5655,5,0,-1},{5656,5,1,-1},{5659,5,0,-1},{5663,5,0,-1}, +{5668,5,0,-1},{5669,5,1,-1},{5672,5,0,-1},{5676,5,0,-1},{5677,5,1,-1}, +{5681,5,0,-1},{5685,5,0,-1},{5686,5,1,-1},{5689,5,0,-1},{5694,5,0,-1}, +{5695,5,1,-1},{5698,5,0,-1},{5702,5,0,-1},{5703,5,1,-1},{5707,5,0,-1}, +{5711,5,0,-1},{5712,5,1,-1},{5715,5,0,-1},{5720,5,0,-1},{5721,5,1,-1}, +{5724,5,0,-1},{5728,5,0,-1},{5729,5,1,-1},{5733,5,0,-1},{5737,5,0,-1}, +{5738,5,1,-1},{5741,5,0,-1},{5746,5,0,-1},{5747,5,1,-1},{5680,5,0,-1}, +{5750,5,0,-1},{5754,5,0,-1},{5755,5,1,-1},{5759,5,0,-1},{5693,5,1,-1}, +{5763,5,0,-1},{5764,5,1,-1},{5767,5,0,-1},{5772,5,0,-1},{5773,5,1,-1}, +{5776,5,0,-1},{5780,5,0,-1},{5781,5,1,-1},{5785,5,0,-1},{5789,5,0,-1}, +{5790,5,1,-1},{5793,5,0,-1},{5798,5,0,-1},{5799,5,1,-1},{5802,5,0,-1}, +{5806,5,0,-1},{5807,5,1,-1},{5811,5,0,-1},{5815,5,0,-1},{5816,5,1,-1}, +{5819,5,0,-1},{5820,5,1,-1},{5824,5,0,-1},{5825,5,1,-1},{5828,5,0,-1}, +{5829,5,1,-1},{5832,5,0,-1},{5833,5,1,-1},{5837,5,0,-1},{5838,5,1,-1}, +{5841,5,0,-1},{5842,5,1,-1},{5845,5,0,-1},{5850,5,0,-1},{5851,5,1,-1}, +{5784,5,0,-1},{5854,5,0,-1},{5855,5,1,-1},{5858,5,0,-1},{5859,5,1,-1}, +{5863,5,0,-1},{5864,5,1,-1},{5797,5,1,-1},{5867,5,0,-1},{5868,5,1,-1}, +{5871,5,0,-1},{5872,5,1,-1},{5876,5,0,-1},{5877,5,1,-1},{5880,5,0,-1}, +{5881,5,1,-1},{5884,5,0,-1},{5885,5,1,-1},{5890,5,1,-1},{5893,5,0,-1}, +{5894,5,1,-1},{5897,5,0,-1},{5898,5,1,-1},{5902,5,0,-1},{5903,5,1,-1}, +{5906,5,0,-1},{5907,5,1,-1},{5910,5,0,-1},{5911,5,1,-1},{5915,5,0,-1}, +{5916,5,1,-1},{5919,5,0,-1},{5920,5,1,-1},{5923,5,0,-1},{5924,5,1,-1}, +{5928,5,0,-1},{5929,5,1,-1},{5932,5,0,-1},{5933,5,1,-1},{5936,5,0,-1}, +{5937,5,1,-1},{5941,5,0,-1},{5942,5,1,-1},{5945,5,0,-1},{5946,5,1,-1}, +{5949,5,0,-1},{5950,5,1,-1},{5954,5,0,-1},{5955,5,1,-1},{5888,5,0,-1}, +{5958,5,0,-1},{5959,5,1,-1},{5962,5,0,-1},{5963,5,1,-1},{5967,5,0,-1}, +{5968,5,1,-1},{5901,5,1,-1},{5971,5,0,-1},{5972,5,1,-1},{5975,5,0,-1}, +{5976,5,1,-1},{5980,5,0,-1},{5981,5,1,-1},{5984,5,0,-1},{5988,5,0,-1}, +{5989,5,1,-1},{5993,5,0,-1},{5994,5,1,-1},{5997,5,0,-1},{5998,5,1,-1}, +{6001,5,0,-1},{6002,5,1,-1},{6006,5,0,-1},{6007,5,1,-1},{6010,5,0,-1}, +{6011,5,1,-1},{6014,5,0,-1},{6015,5,1,-1},{6019,5,0,-1},{6020,5,1,-1}, +{6023,5,0,-1},{6024,5,1,-1},{6028,5,1,-1},{6032,5,0,-1},{6033,5,1,-1}, +{6036,5,0,-1},{6040,5,0,-1},{6041,5,1,-1},{6045,5,0,-1},{6046,5,1,-1}, +{6049,5,0,-1},{6050,5,1,-1},{6053,5,0,-1},{6054,5,1,-1},{6058,5,0,-1}, +{6059,5,1,-1},{5992,5,0,-1},{6062,5,0,-1},{6063,5,1,-1},{6066,5,0,-1}, +{6067,5,1,-1},{6071,5,0,-1},{6072,5,1,-1},{6005,5,1,-1},{6075,5,0,-1}, +{6076,5,1,-1},{6079,5,0,-1},{6080,5,1,-1},{6084,5,0,-1},{6085,5,1,-1}, +{6088,5,0,-1},{6089,5,1,-1},{6092,5,0,-1},{6093,5,1,-1},{6097,5,0,-1}, +{6098,5,1,-1},{6101,5,0,-1},{6102,5,1,-1},{6105,5,0,-1},{6106,5,1,-1}, +{6110,5,0,-1},{6111,5,1,-1},{6114,5,0,-1},{6115,5,1,-1},{6118,5,0,-1}, +{6119,5,1,-1},{6123,5,0,-1},{6124,5,1,-1},{6127,5,0,-1},{6128,5,1,-1}, +{6131,5,0,-1},{6132,5,1,-1},{6136,5,0,-1},{6137,5,1,-1},{6140,5,0,-1}, +{6141,5,1,-1},{6144,5,0,-1},{6145,5,1,-1},{6149,5,0,-1},{6150,5,1,-1}, +{6153,5,0,-1},{6154,5,1,-1},{6157,5,0,-1},{6158,5,1,-1},{6162,5,0,-1}, +{6163,5,1,-1},{6096,5,0,-1},{6166,5,0,-1},{6167,5,1,-1},{6170,5,0,-1}, +{6171,5,1,-1},{6175,5,0,-1},{6176,5,1,-1},{6109,5,1,-1},{6179,5,0,-1}, +{6180,5,1,-1},{6183,5,0,-1},{6184,5,1,-1},{6188,5,0,-1},{6189,5,1,-1}, +{6192,5,0,-1},{6193,5,1,-1},{6196,5,0,-1},{6197,5,1,-1},{6201,5,0,-1}, +{6202,5,1,-1},{6205,5,0,-1},{6206,5,1,-1},{6209,5,0,-1},{6210,5,1,-1}, +{6214,5,0,-1},{6215,5,1,-1},{6218,5,0,-1},{6219,5,1,-1},{6222,5,0,-1}, +{6223,5,1,-1},{6227,5,0,-1},{6228,5,1,-1},{6231,5,0,-1},{6232,5,1,-1}, +{6235,5,0,-1},{6236,5,1,-1},{6240,5,0,-1},{6241,5,1,-1},{6244,5,0,-1}, +{6245,5,1,-1},{6248,5,0,-1},{6249,5,1,-1},{6253,5,0,-1},{6254,5,1,-1}, +{6257,5,0,-1},{6258,5,1,-1},{6261,5,0,-1},{6262,5,1,-1},{6266,5,0,-1}, +{6267,5,1,-1},{6200,5,0,-1},{6270,5,0,-1},{6271,5,1,-1},{6274,5,0,-1}, +{6275,5,1,-1},{6279,5,0,-1},{6280,5,1,-1},{6213,5,1,-1},{6283,5,0,-1}, +{6284,5,1,-1},{6287,5,0,-1},{6288,5,1,-1},{6292,5,0,-1},{6293,5,1,-1}, +{6296,5,0,-1},{6297,5,1,-1},{6300,5,0,-1},{6301,5,1,-1},{6305,5,0,-1}, +{6306,5,1,-1},{6309,5,0,-1},{6310,5,1,-1},{6313,5,0,-1},{6314,5,1,-1}, +{6318,5,0,-1},{6319,5,1,-1},{6322,5,0,-1},{6323,5,1,-1},{6326,5,0,-1}, +{6327,5,1,-1},{6331,5,0,-1},{6332,5,1,-1},{6335,5,0,-1},{6336,5,1,-1}, +{6339,5,0,-1},{6340,5,1,-1},{6344,5,0,-1},{6345,5,1,-1},{6348,5,0,-1}, +{6349,5,1,-1},{6352,5,0,-1},{6353,5,1,-1},{6357,5,0,-1},{6358,5,1,-1}, +{6361,5,0,-1},{6362,5,1,-1},{6365,5,0,-1},{6366,5,1,-1},{6370,5,0,-1}, +{6371,5,1,-1},{6304,5,0,-1},{6374,5,0,-1},{6375,5,1,-1},{6378,5,0,-1}, +{6379,5,1,-1},{6383,5,0,-1},{6384,5,1,-1},{6317,5,1,-1},{6387,5,0,-1}, +{6388,5,1,-1},{6391,5,0,-1},{6392,5,1,-1},{6396,5,0,-1},{6397,5,1,-1}, +{6400,5,0,-1},{6401,5,1,-1},{6404,5,0,-1},{6405,5,1,-1},{6409,5,0,-1}, +{6410,5,1,-1},{6413,5,0,-1},{6414,5,1,-1},{6417,5,0,-1},{6418,5,1,-1}, +{6422,5,0,-1},{6423,5,1,-1},{6426,5,0,-1},{6427,5,1,-1},{6430,5,0,-1}, +{6431,5,1,-1},{6435,5,0,-1},{6436,5,1,-1},{6439,5,0,-1},{6440,5,1,-1}, +{6443,5,0,-1},{6444,5,1,-1},{6448,5,0,-1},{6449,5,1,-1},{6452,5,0,-1}, +{6453,5,1,-1},{6456,5,0,-1},{6457,5,1,-1},{6461,5,0,-1},{6462,5,1,-1}, +{6465,5,0,-1},{6466,5,1,-1},{6469,5,0,-1},{6470,5,1,-1},{6474,5,0,-1}, +{6475,5,1,-1},{6408,5,0,-1},{6478,5,0,-1},{6479,5,1,-1},{6482,5,0,-1}, +{6483,5,1,-1},{6487,5,0,-1},{6488,5,1,-1},{6421,5,1,-1},{6491,5,0,-1}, +{6492,5,1,-1},{6495,5,0,-1},{6496,5,1,-1},{6500,5,0,-1},{6501,5,1,-1}, +{6504,5,0,-1},{6505,5,1,-1},{6508,5,0,-1},{6509,5,1,-1},{6513,5,0,-1}, +{6514,5,1,-1},{6517,5,0,-1},{6518,5,1,-1},{6521,5,0,-1},{6522,5,1,-1}, +{6526,5,0,-1},{6527,5,1,-1},{6530,5,0,-1},{6531,5,1,-1},{6534,5,0,-1}, +{6535,5,1,-1},{6539,5,0,-1},{6540,5,1,-1},{6543,5,0,-1},{6544,5,1,-1}, +{6547,5,0,-1},{6548,5,1,-1},{6552,5,0,-1},{6553,5,1,-1},{6556,5,0,-1}, +{6557,5,1,-1},{6560,5,0,-1},{6561,5,1,-1},{6565,5,0,-1},{6566,5,1,-1}, +{6569,5,0,-1},{6570,5,1,-1},{6573,5,0,-1},{6574,5,1,-1},{6578,5,0,-1}, +{6579,5,1,-1},{6512,5,0,-1},{6582,5,0,-1},{6583,5,1,-1},{6586,5,0,-1}, +{6587,5,1,-1},{6591,5,0,-1},{6592,5,1,-1},{6525,5,1,-1},{6595,5,0,-1}, +{6596,5,1,-1},{6599,5,0,-1},{6600,5,1,-1},{6604,5,0,-1},{6605,5,1,-1}, +{6608,5,0,-1},{6609,5,1,-1},{6612,5,0,-1},{6613,5,1,-1},{6617,5,0,-1}, +{6618,5,1,-1},{6621,5,0,-1},{6622,5,1,-1},{6625,5,0,-1},{6626,5,1,-1}, +{6630,5,0,-1},{6631,5,1,-1},{6634,5,0,-1},{6635,5,1,-1},{6638,5,0,-1}, +{6639,5,1,-1},{6643,5,0,-1},{6644,5,1,-1},{6647,5,0,-1},{6648,5,1,-1}, +{6651,5,0,-1},{6652,5,1,-1},{6656,5,0,-1},{6657,5,1,-1},{6660,5,0,-1}, +{6661,5,1,-1},{6664,5,0,-1},{6665,5,1,-1},{6669,5,0,-1},{6670,5,1,-1}, +{6673,5,0,-1},{6674,5,1,-1},{6677,5,0,-1},{6678,5,1,-1},{6682,5,0,-1}, +{6683,5,1,-1},{6616,5,0,-1},{6686,5,0,-1},{6687,5,1,-1},{6690,5,0,-1}, +{6691,5,1,-1},{6695,5,0,-1},{6696,5,1,-1},{6629,5,1,-1},{6699,5,0,-1}, +{6700,5,1,-1},{6703,5,0,-1},{6704,5,1,-1},{6708,5,0,-1},{6709,5,1,-1}, +{6712,5,0,-1},{6713,5,1,-1},{6716,5,0,-1},{6717,5,1,-1},{6721,5,0,-1}, +{6722,5,1,-1},{6725,5,0,-1},{6726,5,1,-1},{6729,5,0,-1},{6730,5,1,-1}, +{6734,5,0,-1},{6735,5,1,-1},{6738,5,0,-1},{6739,5,1,-1},{6742,5,0,-1}, +{6743,5,1,-1},{6747,5,0,-1},{6748,5,1,-1},{6751,5,0,-1},{6752,5,1,-1}, +{6755,5,0,-1},{6756,5,1,-1},{6760,5,0,-1},{6761,5,1,-1},{6764,5,0,-1}, +{6765,5,1,-1},{6768,5,0,-1},{6769,5,1,-1},{6773,5,0,-1},{6774,5,1,-1}, +{6777,5,0,-1},{6778,5,1,-1},{6781,5,0,-1},{6782,5,1,-1},{6786,5,0,-1}, +{6787,5,1,-1},{6720,5,0,-1},{6790,5,0,-1},{6791,5,1,-1},{6794,5,0,-1}, +{6795,5,1,-1},{6799,5,0,-1},{6800,5,1,-1},{6733,5,1,-1},{6803,5,0,-1}, +{6804,5,1,-1},{6807,5,0,-1},{6808,5,1,-1},{6812,5,0,-1},{6813,5,1,-1}, +{6816,5,0,-1},{6817,5,1,-1},{6820,5,0,-1},{6821,5,1,-1},{6825,5,0,-1}, +{6826,5,1,-1},{6829,5,0,-1},{6830,5,1,-1},{6833,5,0,-1},{6834,5,1,-1}, +{6838,5,0,-1},{6839,5,1,-1},{6842,5,0,-1},{6843,5,1,-1},{6846,5,0,-1}, +{6847,5,1,-1},{6851,5,0,-1},{6852,5,1,-1},{6855,5,0,-1},{6856,5,1,-1}, +{6859,5,0,-1},{6860,5,1,-1},{6864,5,0,-1},{6865,5,1,-1},{6868,5,0,-1}, +{6869,5,1,-1},{6872,5,0,-1},{6873,5,1,-1},{6877,5,0,-1},{6878,5,1,-1}, +{6881,5,0,-1},{6882,5,1,-1},{6885,5,0,-1},{6886,5,1,-1},{6890,5,0,-1}, +{6891,5,1,-1},{6824,5,0,-1},{6894,5,0,-1},{6895,5,1,-1},{6898,5,0,-1}, +{6899,5,1,-1},{6903,5,0,-1},{6904,5,1,-1},{6837,5,1,-1},{6907,5,0,-1}, +{6908,5,1,-1},{6911,5,0,-1},{6912,5,1,-1},{6916,5,0,-1},{6917,5,1,-1}, +{6920,5,0,-1},{6921,5,1,-1},{6924,5,0,-1},{6925,5,1,-1},{6929,5,0,-1}, +{6930,5,1,-1},{6933,5,0,-1},{6934,5,1,-1},{6937,5,0,-1},{6938,5,1,-1}, +{6942,5,0,-1},{6943,5,1,-1},{6946,5,0,-1},{6947,5,1,-1},{6950,5,0,-1}, +{6951,5,1,-1},{6955,5,0,-1},{6956,5,1,-1},{6959,5,0,-1},{6960,5,1,-1}, +{6963,5,0,-1},{6964,5,1,-1},{6968,5,0,-1},{6969,5,1,-1},{6972,5,0,-1}, +{6973,5,1,-1},{6976,5,0,-1},{6977,5,1,-1},{6981,5,0,-1},{6982,5,1,-1}, +{6985,5,0,-1},{6986,5,1,-1},{6989,5,0,-1},{6990,5,1,-1},{6994,5,0,-1}, +{6995,5,1,-1},{6928,5,0,-1},{6998,5,0,-1},{6999,5,1,-1},{7002,5,0,-1}, +{7003,5,1,-1},{7007,5,0,-1},{7008,5,1,-1},{6941,5,1,-1},{7011,5,0,-1}, +{7012,5,1,-1},{7015,5,0,-1},{7016,5,1,-1},{7020,5,0,-1},{7021,5,1,-1}, +{7024,5,0,-1},{7025,5,1,-1},{7028,5,0,-1},{7029,5,1,-1},{7033,5,0,-1}, +{7034,5,1,-1},{7037,5,0,-1},{7038,5,1,-1},{7041,5,0,-1},{7042,5,1,-1}, +{7046,5,0,-1},{7047,5,1,-1},{7050,5,0,-1},{7051,5,1,-1},{7054,5,0,-1}, +{7055,5,1,-1},{7059,5,0,-1},{7060,5,1,-1},{7063,5,0,-1},{7064,5,1,-1}, +{7067,5,0,-1},{7068,5,1,-1},{7072,5,0,-1},{7073,5,1,-1},{7076,5,0,-1}, +{7077,5,1,-1},{7080,5,0,-1},{7081,5,1,-1},{7085,5,0,-1},{7086,5,1,-1}, +{7089,5,0,-1},{7090,5,1,-1},{7093,5,0,-1},{7094,5,1,-1},{7098,5,0,-1}, +{7099,5,1,-1},{7032,5,0,-1},{7102,5,0,-1},{7103,5,1,-1},{7106,5,0,-1}, +{7107,5,1,-1},{7111,5,0,-1},{7112,5,1,-1},{7045,5,1,-1},{7115,5,0,-1}, +{7116,5,1,-1},{7119,5,0,-1},{7120,5,1,-1},{7124,5,0,-1},{7125,5,1,-1}, +{7128,5,0,-1},{7129,5,1,-1},{7132,5,0,-1},{7133,5,1,-1},{7137,5,0,-1}, +{7138,5,1,-1},{7141,5,0,-1},{7142,5,1,-1},{7145,5,0,-1},{7146,5,1,-1}, +{7150,5,0,-1},{7151,5,1,-1},{7154,5,0,-1},{7155,5,1,-1},{7158,5,0,-1}, +{7159,5,1,-1},{7163,5,0,-1},{7164,5,1,-1},{7167,5,0,-1},{7168,5,1,-1}, +{7171,5,0,-1},{7172,5,1,-1},{7176,5,0,-1},{7177,5,1,-1},{7180,5,0,-1}, +{7181,5,1,-1},{7184,5,0,-1},{7185,5,1,-1},{7189,5,0,-1},{7190,5,1,-1}, +{7193,5,0,-1},{7194,5,1,-1},{7197,5,0,-1},{7198,5,1,-1},{7202,5,0,-1}, +{7203,5,1,-1},{7136,5,0,-1},{7206,5,0,-1},{7207,5,1,-1},{7210,5,0,-1}, +{7211,5,1,-1},{7215,5,0,-1},{7216,5,1,-1},{7149,5,1,-1},{7219,5,0,-1}, +{7220,5,1,-1},{7223,5,0,-1},{7224,5,1,-1},{7228,5,0,-1},{7229,5,1,-1}, +{7232,5,0,-1},{7233,5,1,-1},{7236,5,0,-1},{7237,5,1,-1},{7241,5,0,-1}, +{7242,5,1,-1},{7245,5,0,-1},{7246,5,1,-1},{7249,5,0,-1},{7250,5,1,-1}, +{7254,5,0,-1},{7255,5,1,-1},{7258,5,0,-1},{7259,5,1,-1},{7262,5,0,-1}, +{7263,5,1,-1},{7267,5,0,-1},{7268,5,1,-1},{7271,5,0,-1},{7272,5,1,-1}, +{7275,5,0,-1},{7276,5,1,-1},{7280,5,0,-1},{7281,5,1,-1},{7284,5,0,-1}, +{7285,5,1,-1},{7288,5,0,-1},{7289,5,1,-1},{7293,5,0,-1},{7294,5,1,-1}, +{7297,5,0,-1},{7298,5,1,-1},{7301,5,0,-1},{7302,5,1,-1},{7306,5,0,-1}, +{7307,5,1,-1},{7240,5,0,-1},{7310,5,0,-1},{7311,5,1,-1},{7314,5,0,-1}, +{7315,5,1,-1},{7319,5,0,-1},{7320,5,1,-1},{7253,5,1,-1},{7323,5,0,-1}, +{7324,5,1,-1},{7327,5,0,-1},{7328,5,1,-1},{7332,5,0,-1},{7333,5,1,-1}, +{7336,5,0,-1},{7337,5,1,-1},{7340,5,0,-1},{7341,5,1,-1},{7345,5,0,-1}, +{7346,5,1,-1},{7349,5,0,-1},{7350,5,1,-1},{7353,5,0,-1},{7354,5,1,-1}, +{7358,5,0,-1},{7359,5,1,-1},{7362,5,0,-1},{7363,5,1,-1},{7366,5,0,-1}, +{7367,5,1,-1},{7371,5,0,-1},{7372,5,1,-1},{7375,5,0,-1},{7376,5,1,-1}, +{7379,5,0,-1},{7380,5,1,-1},{7384,5,0,-1},{7385,5,1,-1},{7388,5,0,-1}, +{7389,5,1,-1},{7392,5,0,-1},{7393,5,1,-1},{7397,5,0,-1},{7398,5,1,-1}, +{7401,5,0,-1},{7402,5,1,-1},{7405,5,0,-1},{7406,5,1,-1},{7410,5,0,-1}, +{7411,5,1,-1},{7344,5,0,-1},{7414,5,0,-1},{7415,5,1,-1},{7418,5,0,-1}, +{7419,5,1,-1},{7423,5,0,-1},{7424,5,1,-1},{7357,5,1,-1},{7427,5,0,-1}, +{7428,5,1,-1},{7431,5,0,-1},{7432,5,1,-1},{7436,5,0,-1},{7437,5,1,-1}, +{7440,5,0,-1},{7441,5,1,-1},{7444,5,0,-1},{7445,5,1,-1},{7449,5,0,-1}, +{7450,5,1,-1},{7453,5,0,-1},{7454,5,1,-1},{7457,5,0,-1},{7458,5,1,-1}, +{7462,5,0,-1},{7463,5,1,-1},{7466,5,0,-1},{7467,5,1,-1},{7470,5,0,-1}, +{7471,5,1,-1},{7475,5,0,-1},{7476,5,1,-1},{7479,5,0,-1},{7480,5,1,-1}, +{7483,5,0,-1},{7484,5,1,-1},{7488,5,0,-1},{7489,5,1,-1},{7492,5,0,-1}, +{7493,5,1,-1},{7496,5,0,-1},{7497,5,1,-1},{7501,5,0,-1},{7502,5,1,-1}, +{7505,5,0,-1},{7506,5,1,-1},{7509,5,0,-1},{7510,5,1,-1},{7514,5,0,-1}, +{7515,5,1,-1},{7448,5,0,-1},{7518,5,0,-1},{7519,5,1,-1},{7522,5,0,-1}, +{7523,5,1,-1},{7527,5,0,-1},{7528,5,1,-1},{7461,5,1,-1},{7531,5,0,-1}, +{7532,5,1,-1},{7535,5,0,-1},{7536,5,1,-1},{7540,5,0,-1},{7541,5,1,-1}, +{7544,5,0,-1},{7545,5,1,-1},{7548,5,0,-1},{7549,5,1,-1},{7553,5,0,-1}, +{7554,5,1,-1},{7557,5,0,-1},{7558,5,1,-1},{7561,5,0,-1},{7562,5,1,-1}, +{7566,5,0,-1},{7567,5,1,-1},{7570,5,0,-1},{7571,5,1,-1},{7574,5,0,-1}, +{7575,5,1,-1},{7579,5,0,-1},{7580,5,1,-1},{7583,5,0,-1},{7584,5,1,-1}, +{7587,5,0,-1},{7588,5,1,-1},{7592,5,0,-1},{7593,5,1,-1},{7596,5,0,-1}, +{7597,5,1,-1},{7600,5,0,-1},{7601,5,1,-1},{7605,5,0,-1},{7606,5,1,-1}, +{7609,5,0,-1},{7610,5,1,-1},{7613,5,0,-1},{7614,5,1,-1},{7618,5,0,-1}, +{7619,5,1,-1},{7552,5,0,-1},{7622,5,0,-1},{7623,5,1,-1},{7626,5,0,-1}, +{7627,5,1,-1},{7631,5,0,-1},{7632,5,1,-1},{7565,5,1,-1},{7635,5,0,-1}, +{7636,5,1,-1},{7639,5,0,-1},{7640,5,1,-1},{7644,5,0,-1},{7645,5,1,-1}, +{7648,5,0,-1},{7649,5,1,-1},{7652,5,0,-1},{7653,5,1,-1},{7657,5,0,-1}, +{7658,5,1,-1},{7661,5,0,-1},{7662,5,1,-1},{7665,5,0,-1},{7666,5,1,-1}, +{7670,5,0,-1},{7671,5,1,-1},{7674,5,0,-1},{7675,5,1,-1},{7678,5,0,-1}, +{7679,5,1,-1},{7683,5,0,-1},{7684,5,1,-1},{7687,5,0,-1},{7688,5,1,-1}, +{7691,5,0,-1},{7692,5,1,-1},{7696,5,0,-1},{7697,5,1,-1},{7700,5,0,-1}, +{7701,5,1,-1},{7704,5,0,-1},{7705,5,1,-1},{7709,5,0,-1},{7710,5,1,-1}, +{7713,5,0,-1},{7714,5,1,-1},{7717,5,0,-1},{7718,5,1,-1},{7722,5,0,-1}, +{7723,5,1,-1},{7656,5,0,-1},{7726,5,0,-1},{7727,5,1,-1},{7730,5,0,-1}, +{7731,5,1,-1},{7735,5,0,-1},{7736,5,1,-1},{7669,5,1,-1},{7739,5,0,-1}, +{7740,5,1,-1},{7743,5,0,-1},{7744,5,1,-1},{7748,5,0,-1},{7749,5,1,-1}, +{7752,5,0,-1},{7753,5,1,-1},{7756,5,0,-1},{7757,5,1,-1},{7761,5,0,-1}, +{7762,5,1,-1},{7765,5,0,-1},{7766,5,1,-1},{7769,5,0,-1},{7770,5,1,-1}, +{7774,5,0,-1},{7775,5,1,-1},{7778,5,0,-1},{7779,5,1,-1},{7782,5,0,-1}, +{7783,5,1,-1},{7787,5,0,-1},{7788,5,1,-1},{7791,5,0,-1},{7792,5,1,-1}, +{7795,5,0,-1},{7796,5,1,-1},{7800,5,0,-1},{7801,5,1,-1},{7804,5,0,-1}, +{7805,5,1,-1},{7808,5,0,-1},{7809,5,1,-1},{7813,5,0,-1},{7814,5,1,-1}, +{7817,5,0,-1},{7818,5,1,-1},{7821,5,0,-1},{7822,5,1,-1},{7826,5,0,-1}, +{7827,5,1,-1},{7760,5,0,-1},{7830,5,0,-1},{7831,5,1,-1},{7834,5,0,-1}, +{7835,5,1,-1},{7839,5,0,-1},{7840,5,1,-1},{7773,5,1,-1},{7843,5,0,-1}, +{7844,5,1,-1},{7847,5,0,-1},{7848,5,1,-1},{7852,5,0,-1},{7853,5,1,-1}, +{7856,5,0,-1},{7857,5,1,-1},{7860,5,0,-1},{7861,5,1,-1},{7865,5,0,-1}, +{7866,5,1,-1},{7869,5,0,-1},{7870,5,1,-1},{7873,5,0,-1},{7874,5,1,-1}, +{7878,5,0,-1},{7879,5,1,-1},{7882,5,0,-1},{7883,5,1,-1},{7886,5,0,-1}, +{7887,5,1,-1},{7891,5,0,-1},{7892,5,1,-1},{7895,5,0,-1},{7896,5,1,-1}, +{7899,5,0,-1},{7900,5,1,-1},{7904,5,0,-1},{7905,5,1,-1},{7908,5,0,-1}, +{7909,5,1,-1},{7912,5,0,-1},{7913,5,1,-1},{7917,5,0,-1},{7918,5,1,-1}, +{7921,5,0,-1},{7922,5,1,-1},{7925,5,0,-1},{7926,5,1,-1},{7930,5,0,-1}, +{7931,5,1,-1},{7864,5,0,-1},{7934,5,0,-1},{7935,5,1,-1},{7938,5,0,-1}, +{7939,5,1,-1},{7943,5,0,-1},{7944,5,1,-1},{7877,5,1,-1},{7947,5,0,-1}, +{7948,5,1,-1},{7951,5,0,-1},{7952,5,1,-1},{7956,5,0,-1},{7957,5,1,-1}, +{7960,5,0,-1},{7961,5,1,-1},{7964,5,0,-1},{7965,5,1,-1},{7969,5,0,-1}, +{7970,5,1,-1},{7973,5,0,-1},{7974,5,1,-1},{7977,5,0,-1},{7978,5,1,-1}, +{7982,5,0,-1},{7983,5,1,-1},{7986,5,0,-1},{7987,5,1,-1},{7990,5,0,-1}, +{7991,5,1,-1},{7995,5,0,-1},{7996,5,1,-1},{7999,5,0,-1},{8000,5,1,-1}, +{8003,5,0,-1},{8004,5,1,-1},{8008,5,0,-1},{8009,5,1,-1},{8012,5,0,-1}, +{8013,5,1,-1},{8016,5,0,-1},{8017,5,1,-1},{8021,5,0,-1},{8022,5,1,-1}, +{8025,5,0,-1},{8026,5,1,-1},{8029,5,0,-1},{8030,5,1,-1},{8034,5,0,-1}, +{8035,5,1,-1},{7968,5,0,-1},{8038,5,0,-1},{8039,5,1,-1},{8042,5,0,-1}, +{8043,5,1,-1},{8047,5,0,-1},{8048,5,1,-1},{7981,5,1,-1},{8051,5,0,-1}, +{8052,5,1,-1},{8055,5,0,-1},{8056,5,1,-1},{8060,5,0,-1},{8061,5,1,-1}, +{8064,5,0,-1},{8065,5,1,-1},{8068,5,0,-1},{8069,5,1,-1},{8073,5,0,-1}, +{8074,5,1,-1},{8077,5,0,-1},{8078,5,1,-1},{8081,5,0,-1},{8082,5,1,-1}, +{8086,5,0,-1},{8087,5,1,-1},{8090,5,0,-1},{8091,5,1,-1},{8094,5,0,-1}, +{8095,5,1,-1},{8099,5,0,-1},{8100,5,1,-1},{8103,5,0,-1},{8104,5,1,-1}, +{8107,5,0,-1},{8108,5,1,-1},{8112,5,0,-1},{8113,5,1,-1},{8116,5,0,-1}, +{8117,5,1,-1},{8120,5,0,-1},{8121,5,1,-1},{8125,5,0,-1},{8126,5,1,-1}, +{8129,5,0,-1},{8130,5,1,-1},{8133,5,0,-1},{8134,5,1,-1},{8138,5,0,-1}, +{8139,5,1,-1},{8072,5,0,-1},{8142,5,0,-1},{8143,5,1,-1},{8146,5,0,-1}, +{8147,5,1,-1},{8151,5,0,-1},{8152,5,1,-1},{8085,5,1,-1},{8155,5,0,-1}, +{8156,5,1,-1},{8159,5,0,-1},{8160,5,1,-1},{8164,5,0,-1},{8165,5,1,-1}, +{8168,5,0,-1},{8169,5,1,-1},{8172,5,0,-1},{8173,5,1,-1},{8177,5,0,-1}, +{8178,5,1,-1},{8181,5,0,-1},{8182,5,1,-1},{8185,5,0,-1},{8186,5,1,-1}, +{8190,5,0,-1},{8191,5,1,-1},{8194,5,0,-1},{8195,5,1,-1},{8198,5,0,-1}, +{8199,5,1,-1},{8203,5,0,-1},{8204,5,1,-1},{8207,5,0,-1},{8208,5,1,-1}, +{8211,5,0,-1},{8212,5,1,-1},{8216,5,0,-1},{8217,5,1,-1},{8220,5,0,-1}, +{8221,5,1,-1},{8224,5,0,-1},{8225,5,1,-1},{8229,5,0,-1},{8230,5,1,-1}, +{8233,5,0,-1},{8234,5,1,-1},{8237,5,0,-1},{8238,5,1,-1},{8242,5,0,-1}, +{8243,5,1,-1},{8176,5,0,-1},{8246,5,0,-1},{8247,5,1,-1},{8250,5,0,-1}, +{8251,5,1,-1},{8255,5,0,-1},{8256,5,1,-1},{8189,5,1,-1},{8259,5,0,-1}, +{8260,5,1,-1},{8263,5,0,-1},{8264,5,1,-1},{8268,5,0,-1},{8269,5,1,-1}, +{8272,5,0,-1},{8273,5,1,-1},{8276,5,0,-1},{8277,5,1,-1},{8281,5,0,-1}, +{8282,5,1,-1},{8285,5,0,-1},{8286,5,1,-1},{8289,5,0,-1},{8290,5,1,-1}, +{8294,5,0,-1},{8295,5,1,-1},{8298,5,0,-1},{8299,5,1,-1},{8302,5,0,-1}, +{8303,5,1,-1},{8307,5,0,-1},{8308,5,1,-1},{8311,5,0,-1},{8312,5,1,-1}, +{8315,5,0,-1},{8316,5,1,-1},{8320,5,0,-1},{8321,5,1,-1},{8324,5,0,-1}, +{8325,5,1,-1},{8328,5,0,-1},{8329,5,1,-1},{8333,5,0,-1},{8334,5,1,-1}, +{8337,5,0,-1},{8338,5,1,-1},{8341,5,0,-1},{8342,5,1,-1},{8346,5,0,-1}, +{8347,5,1,-1},{8280,5,0,-1},{8350,5,0,-1},{8351,5,1,-1},{8354,5,0,-1}, +{8355,5,1,-1},{8359,5,0,-1},{8360,5,1,-1},{8293,5,1,-1},{8363,5,0,-1}, +{8364,5,1,-1},{8367,5,0,-1},{8368,5,1,-1},{8372,5,0,-1},{8373,5,1,-1}, +{8376,5,0,-1},{8377,5,1,-1},{8380,5,0,-1},{8381,5,1,-1},{8385,5,0,-1}, +{8386,5,1,-1},{8389,5,0,-1},{8390,5,1,-1},{8393,5,0,-1},{8394,5,1,-1}, +{8398,5,0,-1},{8399,5,1,-1},{8402,5,0,-1},{8403,5,1,-1},{8406,5,0,-1}, +{8407,5,1,-1},{8411,5,0,-1},{8412,5,1,-1},{8415,5,0,-1},{8416,5,1,-1}, +{8419,5,0,-1},{8420,5,1,-1},{8424,5,0,-1},{8425,5,1,-1},{8428,5,0,-1}, +{8429,5,1,-1},{8432,5,0,-1},{8433,5,1,-1},{8437,5,0,-1},{8438,5,1,-1}, +{8441,5,0,-1},{8442,5,1,-1},{8445,5,0,-1},{8446,5,1,-1},{8450,5,0,-1}, +{8451,5,1,-1},{8384,5,0,-1},{8454,5,0,-1},{8455,5,1,-1},{8458,5,0,-1}, +{8459,5,1,-1},{8463,5,0,-1},{8464,5,1,-1},{8397,5,1,-1},{8467,5,0,-1}, +{8468,5,1,-1},{8471,5,0,-1},{8472,5,1,-1},{8476,5,0,-1},{8477,5,1,-1}, +{8480,5,0,-1},{8481,5,1,-1},{8484,5,0,-1},{8485,5,1,-1},{8489,5,0,-1}, +{8490,5,1,-1},{8493,5,0,-1},{8494,5,1,-1},{8497,5,0,-1},{8498,5,1,-1}, +{8502,5,0,-1},{8503,5,1,-1},{8506,5,0,-1},{8507,5,1,-1},{8510,5,0,-1}, +{8511,5,1,-1},{8515,5,0,-1},{8516,5,1,-1},{8519,5,0,-1},{8520,5,1,-1}, +{8523,5,0,-1},{8524,5,1,-1},{8528,5,0,-1},{8529,5,1,-1},{8532,5,0,-1}, +{8533,5,1,-1},{8536,5,0,-1},{8537,5,1,-1},{8541,5,0,-1},{8545,5,0,-1}, +{8549,5,0,-1},{8554,5,0,-1},{8488,5,0,-1},{8558,5,0,-1},{8562,5,0,-1}, +{8567,5,0,-1},{8501,5,1,-1},{8571,5,0,-1},{8575,5,0,-1},{8580,5,0,-1}, +{8584,5,0,-1},{8585,5,1,-1},{8588,5,0,-1},{8589,5,1,-1},{8597,5,0,-1}, +{8601,5,0,-1},{8606,5,0,-1},{8610,5,0,-1},{8614,5,0,-1},{8619,5,0,-1}, +{8623,5,0,-1},{8627,5,0,-1},{8632,5,0,-1},{8636,5,0,-1},{8640,5,0,-1}, +{8641,5,1,-1},{8649,5,0,-1},{8653,5,0,-1},{8658,5,0,-1},{8662,5,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS6, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_6_ss0_ss1[] = { +{8112,6,0,-1},{8120,6,0,-1},{8129,6,0,-1},{8138,6,0,-1},{8146,6,0,-1}, +{8155,6,0,-1},{8164,6,0,-1},{8098,6,0,-1},{8172,6,0,-1},{8181,6,0,-1}, +{8190,6,0,-1},{8198,6,0,-1},{8207,6,0,-1},{8211,6,0,-1},{8216,6,0,-1}, +{8220,6,0,-1},{8224,6,0,-1},{8229,6,0,-1},{8233,6,0,-1},{8237,6,0,-1}, +{8242,6,0,-1},{8246,6,0,-1},{8250,6,0,-1},{8255,6,0,-1},{8259,6,0,-1}, +{8263,6,0,-1},{8268,6,0,-1},{8202,6,0,-1},{8272,6,0,-1},{8276,6,0,-1}, +{8281,6,0,-1},{8285,6,0,-1},{8289,6,0,-1},{8294,6,0,-1},{8298,6,0,-1}, +{8302,6,0,-1},{8307,6,0,-1},{8311,6,0,-1},{8315,6,0,-1},{8320,6,0,-1}, +{8324,6,0,-1},{8328,6,0,-1},{8333,6,0,-1},{8337,6,0,-1},{8341,6,0,-1}, +{8346,6,0,-1},{8350,6,0,-1},{8354,6,0,-1},{8355,6,1,-1},{8359,6,0,-1}, +{8363,6,0,-1},{8364,6,1,-1},{8367,6,0,-1},{8372,6,0,-1},{8373,6,1,-1}, +{8306,6,0,-1},{8376,6,0,-1},{8380,6,0,-1},{8381,6,1,-1},{8385,6,0,-1}, +{8389,6,0,-1},{8390,6,1,-1},{8393,6,0,-1},{8398,6,0,-1},{8399,6,1,-1}, +{8402,6,0,-1},{8406,6,0,-1},{8407,6,1,-1},{8411,6,0,-1},{8412,6,1,-1}, +{8415,6,0,-1},{8416,6,1,-1},{8419,6,0,-1},{8420,6,1,-1},{8424,6,0,-1}, +{8425,6,1,-1},{8428,6,0,-1},{8432,6,0,-1},{8433,6,1,-1},{8437,6,0,-1}, +{8441,6,0,-1},{8442,6,1,-1},{8445,6,0,-1},{8450,6,0,-1},{8451,6,1,-1}, +{8454,6,0,-1},{8458,6,0,-1},{8459,6,1,-1},{8463,6,0,-1},{8467,6,0,-1}, +{8468,6,1,-1},{8471,6,0,-1},{8476,6,0,-1},{8477,6,1,-1},{8410,6,0,-1}, +{8480,6,0,-1},{8484,6,0,-1},{8485,6,1,-1},{8489,6,0,-1},{8490,6,1,-1}, +{8423,6,1,-1},{8493,6,0,-1},{8494,6,1,-1},{8497,6,0,-1},{8498,6,1,-1}, +{8502,6,0,-1},{8503,6,1,-1},{8506,6,0,-1},{8507,6,1,-1},{8510,6,0,-1}, +{8511,6,1,-1},{8515,6,0,-1},{8519,6,0,-1},{8520,6,1,-1},{8523,6,0,-1}, +{8524,6,1,-1},{8528,6,0,-1},{8529,6,1,-1},{8532,6,0,-1},{8533,6,1,-1}, +{8536,6,0,-1},{8537,6,1,-1},{8541,6,0,-1},{8542,6,1,-1},{8545,6,0,-1}, +{8546,6,1,-1},{8549,6,0,-1},{8550,6,1,-1},{8554,6,0,-1},{8555,6,1,-1}, +{8558,6,0,-1},{8559,6,1,-1},{8562,6,0,-1},{8563,6,1,-1},{8567,6,0,-1}, +{8568,6,1,-1},{8571,6,0,-1},{8572,6,1,-1},{8575,6,0,-1},{8576,6,1,-1}, +{8580,6,0,-1},{8581,6,1,-1},{8514,6,0,-1},{8584,6,0,-1},{8585,6,1,-1}, +{8588,6,0,-1},{8589,6,1,-1},{8593,6,0,-1},{8594,6,1,-1},{8527,6,1,-1}, +{8597,6,0,-1},{8598,6,1,-1},{8601,6,0,-1},{8602,6,1,-1},{8606,6,0,-1}, +{8607,6,1,-1},{8610,6,0,-1},{8611,6,1,-1},{8614,6,0,-1},{8615,6,1,-1}, +{8619,6,0,-1},{8620,6,1,-1},{8623,6,0,-1},{8624,6,1,-1},{8627,6,0,-1}, +{8628,6,1,-1},{8632,6,0,-1},{8633,6,1,-1},{8636,6,0,-1},{8637,6,1,-1}, +{8640,6,0,-1},{8641,6,1,-1},{8645,6,0,-1},{8646,6,1,-1},{8649,6,0,-1}, +{8650,6,1,-1},{8653,6,0,-1},{8654,6,1,-1},{8658,6,0,-1},{8659,6,1,-1}, +{8662,6,0,-1},{8663,6,1,-1},{8666,6,0,-1},{8667,6,1,-1},{8671,6,0,-1}, +{8672,6,1,-1},{8675,6,0,-1},{8676,6,1,-1},{8679,6,0,-1},{8680,6,1,-1}, +{8684,6,0,-1},{8685,6,1,-1},{8618,6,0,-1},{8688,6,0,-1},{8689,6,1,-1}, +{8692,6,0,-1},{8693,6,1,-1},{8697,6,0,-1},{8698,6,1,-1},{8631,6,1,-1}, +{8701,6,0,-1},{8702,6,1,-1},{8705,6,0,-1},{8706,6,1,-1},{8710,6,0,-1}, +{8711,6,1,-1},{8714,6,0,-1},{8715,6,1,-1},{8718,6,0,-1},{8719,6,1,-1}, +{8723,6,0,-1},{8724,6,1,-1},{8727,6,0,-1},{8728,6,1,-1},{8731,6,0,-1}, +{8732,6,1,-1},{8736,6,0,-1},{8737,6,1,-1},{8740,6,0,-1},{8741,6,1,-1}, +{8744,6,0,-1},{8745,6,1,-1},{8749,6,0,-1},{8750,6,1,-1},{8753,6,0,-1}, +{8754,6,1,-1},{8757,6,0,-1},{8758,6,1,-1},{8762,6,0,-1},{8763,6,1,-1}, +{8766,6,0,-1},{8770,6,0,-1},{8771,6,1,-1},{8775,6,0,-1},{8776,6,1,-1}, +{8779,6,0,-1},{8780,6,1,-1},{8783,6,0,-1},{8784,6,1,-1},{8788,6,0,-1}, +{8789,6,1,-1},{8722,6,0,-1},{8792,6,0,-1},{8793,6,1,-1},{8796,6,0,-1}, +{8797,6,1,-1},{8801,6,0,-1},{8802,6,1,-1},{8735,6,1,-1},{8805,6,0,-1}, +{8806,6,1,-1},{8810,6,1,-1},{8814,6,0,-1},{8815,6,1,-1},{8818,6,0,-1}, +{8822,6,0,-1},{8823,6,1,-1},{8827,6,0,-1},{8828,6,1,-1},{8831,6,0,-1}, +{8832,6,1,-1},{8835,6,0,-1},{8836,6,1,-1},{8840,6,0,-1},{8841,6,1,-1}, +{8844,6,0,-1},{8845,6,1,-1},{8848,6,0,-1},{8849,6,1,-1},{8853,6,0,-1}, +{8854,6,1,-1},{8857,6,0,-1},{8858,6,1,-1},{8861,6,0,-1},{8862,6,1,-1}, +{8866,6,0,-1},{8867,6,1,-1},{8870,6,0,-1},{8871,6,1,-1},{8874,6,0,-1}, +{8875,6,1,-1},{8879,6,0,-1},{8880,6,1,-1},{8883,6,0,-1},{8884,6,1,-1}, +{8887,6,0,-1},{8888,6,1,-1},{8892,6,0,-1},{8893,6,1,-1},{8826,6,0,-1}, +{8896,6,0,-1},{8897,6,1,-1},{8900,6,0,-1},{8901,6,1,-1},{8905,6,0,-1}, +{8906,6,1,-1},{8839,6,1,-1},{8909,6,0,-1},{8910,6,1,-1},{8913,6,0,-1}, +{8914,6,1,-1},{8918,6,0,-1},{8919,6,1,-1},{8922,6,0,-1},{8923,6,1,-1}, +{8926,6,0,-1},{8927,6,1,-1},{8931,6,0,-1},{8932,6,1,-1},{8935,6,0,-1}, +{8936,6,1,-1},{8939,6,0,-1},{8940,6,1,-1},{8944,6,0,-1},{8945,6,1,-1}, +{8948,6,0,-1},{8949,6,1,-1},{8952,6,0,-1},{8953,6,1,-1},{8957,6,0,-1}, +{8958,6,1,-1},{8961,6,0,-1},{8962,6,1,-1},{8965,6,0,-1},{8966,6,1,-1}, +{8970,6,0,-1},{8971,6,1,-1},{8974,6,0,-1},{8975,6,1,-1},{8978,6,0,-1}, +{8979,6,1,-1},{8983,6,0,-1},{8984,6,1,-1},{8987,6,0,-1},{8988,6,1,-1}, +{8991,6,0,-1},{8992,6,1,-1},{8996,6,0,-1},{8997,6,1,-1},{8930,6,0,-1}, +{9000,6,0,-1},{9001,6,1,-1},{9004,6,0,-1},{9005,6,1,-1},{9009,6,0,-1}, +{9010,6,1,-1},{8943,6,1,-1},{9013,6,0,-1},{9014,6,1,-1},{9017,6,0,-1}, +{9018,6,1,-1},{9022,6,0,-1},{9023,6,1,-1},{9026,6,0,-1},{9027,6,1,-1}, +{9030,6,0,-1},{9031,6,1,-1},{9035,6,0,-1},{9036,6,1,-1},{9039,6,0,-1}, +{9040,6,1,-1},{9043,6,0,-1},{9044,6,1,-1},{9048,6,0,-1},{9049,6,1,-1}, +{9052,6,0,-1},{9053,6,1,-1},{9056,6,0,-1},{9057,6,1,-1},{9061,6,0,-1}, +{9062,6,1,-1},{9065,6,0,-1},{9066,6,1,-1},{9069,6,0,-1},{9070,6,1,-1}, +{9074,6,0,-1},{9075,6,1,-1},{9078,6,0,-1},{9079,6,1,-1},{9082,6,0,-1}, +{9083,6,1,-1},{9087,6,0,-1},{9088,6,1,-1},{9091,6,0,-1},{9092,6,1,-1}, +{9095,6,0,-1},{9096,6,1,-1},{9100,6,0,-1},{9101,6,1,-1},{9034,6,0,-1}, +{9104,6,0,-1},{9105,6,1,-1},{9108,6,0,-1},{9109,6,1,-1},{9113,6,0,-1}, +{9114,6,1,-1},{9047,6,1,-1},{9117,6,0,-1},{9118,6,1,-1},{9121,6,0,-1}, +{9122,6,1,-1},{9126,6,0,-1},{9127,6,1,-1},{9130,6,0,-1},{9131,6,1,-1}, +{9134,6,0,-1},{9135,6,1,-1},{9139,6,0,-1},{9140,6,1,-1},{9143,6,0,-1}, +{9144,6,1,-1},{9147,6,0,-1},{9148,6,1,-1},{9152,6,0,-1},{9153,6,1,-1}, +{9156,6,0,-1},{9157,6,1,-1},{9160,6,0,-1},{9161,6,1,-1},{9165,6,0,-1}, +{9166,6,1,-1},{9169,6,0,-1},{9170,6,1,-1},{9173,6,0,-1},{9174,6,1,-1}, +{9178,6,0,-1},{9179,6,1,-1},{9182,6,0,-1},{9183,6,1,-1},{9186,6,0,-1}, +{9187,6,1,-1},{9191,6,0,-1},{9192,6,1,-1},{9195,6,0,-1},{9196,6,1,-1}, +{9199,6,0,-1},{9200,6,1,-1},{9204,6,0,-1},{9205,6,1,-1},{9138,6,0,-1}, +{9208,6,0,-1},{9209,6,1,-1},{9212,6,0,-1},{9213,6,1,-1},{9217,6,0,-1}, +{9218,6,1,-1},{9151,6,1,-1},{9221,6,0,-1},{9222,6,1,-1},{9225,6,0,-1}, +{9226,6,1,-1},{9230,6,0,-1},{9231,6,1,-1},{9234,6,0,-1},{9235,6,1,-1}, +{9238,6,0,-1},{9239,6,1,-1},{9243,6,0,-1},{9244,6,1,-1},{9247,6,0,-1}, +{9248,6,1,-1},{9251,6,0,-1},{9252,6,1,-1},{9256,6,0,-1},{9257,6,1,-1}, +{9260,6,0,-1},{9261,6,1,-1},{9264,6,0,-1},{9265,6,1,-1},{9269,6,0,-1}, +{9270,6,1,-1},{9273,6,0,-1},{9274,6,1,-1},{9277,6,0,-1},{9278,6,1,-1}, +{9282,6,0,-1},{9283,6,1,-1},{9286,6,0,-1},{9287,6,1,-1},{9290,6,0,-1}, +{9291,6,1,-1},{9295,6,0,-1},{9296,6,1,-1},{9299,6,0,-1},{9300,6,1,-1}, +{9303,6,0,-1},{9304,6,1,-1},{9308,6,0,-1},{9309,6,1,-1},{9242,6,0,-1}, +{9312,6,0,-1},{9313,6,1,-1},{9316,6,0,-1},{9317,6,1,-1},{9321,6,0,-1}, +{9322,6,1,-1},{9255,6,1,-1},{9325,6,0,-1},{9326,6,1,-1},{9329,6,0,-1}, +{9330,6,1,-1},{9334,6,0,-1},{9335,6,1,-1},{9338,6,0,-1},{9339,6,1,-1}, +{9342,6,0,-1},{9343,6,1,-1},{9347,6,0,-1},{9348,6,1,-1},{9351,6,0,-1}, +{9352,6,1,-1},{9355,6,0,-1},{9356,6,1,-1},{9360,6,0,-1},{9361,6,1,-1}, +{9364,6,0,-1},{9365,6,1,-1},{9368,6,0,-1},{9369,6,1,-1},{9373,6,0,-1}, +{9374,6,1,-1},{9377,6,0,-1},{9378,6,1,-1},{9381,6,0,-1},{9382,6,1,-1}, +{9386,6,0,-1},{9387,6,1,-1},{9390,6,0,-1},{9391,6,1,-1},{9394,6,0,-1}, +{9395,6,1,-1},{9399,6,0,-1},{9400,6,1,-1},{9403,6,0,-1},{9404,6,1,-1}, +{9407,6,0,-1},{9408,6,1,-1},{9412,6,0,-1},{9413,6,1,-1},{9346,6,0,-1}, +{9416,6,0,-1},{9417,6,1,-1},{9420,6,0,-1},{9421,6,1,-1},{9425,6,0,-1}, +{9426,6,1,-1},{9359,6,1,-1},{9429,6,0,-1},{9430,6,1,-1},{9433,6,0,-1}, +{9434,6,1,-1},{9438,6,0,-1},{9439,6,1,-1},{9442,6,0,-1},{9443,6,1,-1}, +{9446,6,0,-1},{9447,6,1,-1},{9451,6,0,-1},{9452,6,1,-1},{9455,6,0,-1}, +{9456,6,1,-1},{9459,6,0,-1},{9460,6,1,-1},{9464,6,0,-1},{9465,6,1,-1}, +{9468,6,0,-1},{9469,6,1,-1},{9472,6,0,-1},{9473,6,1,-1},{9477,6,0,-1}, +{9478,6,1,-1},{9481,6,0,-1},{9482,6,1,-1},{9485,6,0,-1},{9486,6,1,-1}, +{9490,6,0,-1},{9491,6,1,-1},{9494,6,0,-1},{9495,6,1,-1},{9498,6,0,-1}, +{9499,6,1,-1},{9503,6,0,-1},{9504,6,1,-1},{9507,6,0,-1},{9508,6,1,-1}, +{9511,6,0,-1},{9512,6,1,-1},{9516,6,0,-1},{9517,6,1,-1},{9450,6,0,-1}, +{9520,6,0,-1},{9521,6,1,-1},{9524,6,0,-1},{9525,6,1,-1},{9529,6,0,-1}, +{9530,6,1,-1},{9463,6,1,-1},{9533,6,0,-1},{9534,6,1,-1},{9537,6,0,-1}, +{9538,6,1,-1},{9542,6,0,-1},{9543,6,1,-1},{9546,6,0,-1},{9547,6,1,-1}, +{9550,6,0,-1},{9551,6,1,-1},{9555,6,0,-1},{9556,6,1,-1},{9559,6,0,-1}, +{9560,6,1,-1},{9563,6,0,-1},{9564,6,1,-1},{9568,6,0,-1},{9569,6,1,-1}, +{9572,6,0,-1},{9573,6,1,-1},{9576,6,0,-1},{9577,6,1,-1},{9581,6,0,-1}, +{9582,6,1,-1},{9585,6,0,-1},{9586,6,1,-1},{9589,6,0,-1},{9590,6,1,-1}, +{9594,6,0,-1},{9595,6,1,-1},{9598,6,0,-1},{9599,6,1,-1},{9602,6,0,-1}, +{9603,6,1,-1},{9607,6,0,-1},{9608,6,1,-1},{9611,6,0,-1},{9612,6,1,-1}, +{9615,6,0,-1},{9616,6,1,-1},{9620,6,0,-1},{9621,6,1,-1},{9554,6,0,-1}, +{9624,6,0,-1},{9625,6,1,-1},{9628,6,0,-1},{9629,6,1,-1},{9633,6,0,-1}, +{9634,6,1,-1},{9567,6,1,-1},{9637,6,0,-1},{9638,6,1,-1},{9641,6,0,-1}, +{9642,6,1,-1},{9646,6,0,-1},{9647,6,1,-1},{9650,6,0,-1},{9651,6,1,-1}, +{9654,6,0,-1},{9655,6,1,-1},{9659,6,0,-1},{9660,6,1,-1},{9663,6,0,-1}, +{9664,6,1,-1},{9667,6,0,-1},{9668,6,1,-1},{9672,6,0,-1},{9673,6,1,-1}, +{9676,6,0,-1},{9677,6,1,-1},{9680,6,0,-1},{9681,6,1,-1},{9685,6,0,-1}, +{9686,6,1,-1},{9689,6,0,-1},{9690,6,1,-1},{9693,6,0,-1},{9694,6,1,-1}, +{9698,6,0,-1},{9699,6,1,-1},{9702,6,0,-1},{9703,6,1,-1},{9706,6,0,-1}, +{9707,6,1,-1},{9711,6,0,-1},{9712,6,1,-1},{9715,6,0,-1},{9716,6,1,-1}, +{9719,6,0,-1},{9720,6,1,-1},{9724,6,0,-1},{9725,6,1,-1},{9658,6,0,-1}, +{9728,6,0,-1},{9729,6,1,-1},{9732,6,0,-1},{9733,6,1,-1},{9737,6,0,-1}, +{9738,6,1,-1},{9671,6,1,-1},{9741,6,0,-1},{9742,6,1,-1},{9745,6,0,-1}, +{9746,6,1,-1},{9750,6,0,-1},{9751,6,1,-1},{9754,6,0,-1},{9755,6,1,-1}, +{9758,6,0,-1},{9759,6,1,-1},{9763,6,0,-1},{9764,6,1,-1},{9767,6,0,-1}, +{9768,6,1,-1},{9771,6,0,-1},{9772,6,1,-1},{9776,6,0,-1},{9777,6,1,-1}, +{9780,6,0,-1},{9781,6,1,-1},{9784,6,0,-1},{9785,6,1,-1},{9789,6,0,-1}, +{9790,6,1,-1},{9793,6,0,-1},{9794,6,1,-1},{9797,6,0,-1},{9798,6,1,-1}, +{9802,6,0,-1},{9803,6,1,-1},{9806,6,0,-1},{9807,6,1,-1},{9810,6,0,-1}, +{9811,6,1,-1},{9815,6,0,-1},{9816,6,1,-1},{9819,6,0,-1},{9820,6,1,-1}, +{9823,6,0,-1},{9824,6,1,-1},{9828,6,0,-1},{9829,6,1,-1},{9762,6,0,-1}, +{9832,6,0,-1},{9833,6,1,-1},{9836,6,0,-1},{9837,6,1,-1},{9841,6,0,-1}, +{9842,6,1,-1},{9775,6,1,-1},{9845,6,0,-1},{9846,6,1,-1},{9849,6,0,-1}, +{9850,6,1,-1},{9854,6,0,-1},{9855,6,1,-1},{9858,6,0,-1},{9859,6,1,-1}, +{9862,6,0,-1},{9863,6,1,-1},{9867,6,0,-1},{9868,6,1,-1},{9871,6,0,-1}, +{9872,6,1,-1},{9875,6,0,-1},{9876,6,1,-1},{9880,6,0,-1},{9881,6,1,-1}, +{9884,6,0,-1},{9885,6,1,-1},{9888,6,0,-1},{9889,6,1,-1},{9893,6,0,-1}, +{9894,6,1,-1},{9897,6,0,-1},{9898,6,1,-1},{9901,6,0,-1},{9902,6,1,-1}, +{9906,6,0,-1},{9907,6,1,-1},{9910,6,0,-1},{9911,6,1,-1},{9914,6,0,-1}, +{9915,6,1,-1},{9919,6,0,-1},{9920,6,1,-1},{9923,6,0,-1},{9924,6,1,-1}, +{9927,6,0,-1},{9928,6,1,-1},{9932,6,0,-1},{9933,6,1,-1},{9866,6,0,-1}, +{9936,6,0,-1},{9937,6,1,-1},{9940,6,0,-1},{9941,6,1,-1},{9945,6,0,-1}, +{9946,6,1,-1},{9879,6,1,-1},{9949,6,0,-1},{9950,6,1,-1},{9953,6,0,-1}, +{9954,6,1,-1},{9958,6,0,-1},{9959,6,1,-1},{9962,6,0,-1},{9963,6,1,-1}, +{9966,6,0,-1},{9967,6,1,-1},{9971,6,0,-1},{9972,6,1,-1},{9975,6,0,-1}, +{9976,6,1,-1},{9979,6,0,-1},{9980,6,1,-1},{9984,6,0,-1},{9985,6,1,-1}, +{9988,6,0,-1},{9989,6,1,-1},{9992,6,0,-1},{9993,6,1,-1},{9997,6,0,-1}, +{9998,6,1,-1},{10001,6,0,-1},{10002,6,1,-1},{10005,6,0,-1},{10006,6,1,-1}, +{10010,6,0,-1},{10011,6,1,-1},{10014,6,0,-1},{10015,6,1,-1},{10018,6,0,-1}, +{10019,6,1,-1},{10023,6,0,-1},{10024,6,1,-1},{10027,6,0,-1},{10028,6,1,-1}, +{10031,6,0,-1},{10032,6,1,-1},{10036,6,0,-1},{10037,6,1,-1},{9970,6,0,-1}, +{10040,6,0,-1},{10041,6,1,-1},{10044,6,0,-1},{10045,6,1,-1},{10049,6,0,-1}, +{10050,6,1,-1},{9983,6,1,-1},{10053,6,0,-1},{10054,6,1,-1},{10057,6,0,-1}, +{10058,6,1,-1},{10062,6,0,-1},{10063,6,1,-1},{10066,6,0,-1},{10067,6,1,-1}, +{10070,6,0,-1},{10071,6,1,-1},{10075,6,0,-1},{10076,6,1,-1},{10079,6,0,-1}, +{10080,6,1,-1},{10083,6,0,-1},{10084,6,1,-1},{10088,6,0,-1},{10089,6,1,-1}, +{10092,6,0,-1},{10093,6,1,-1},{10096,6,0,-1},{10097,6,1,-1},{10101,6,0,-1}, +{10102,6,1,-1},{10105,6,0,-1},{10106,6,1,-1},{10109,6,0,-1},{10110,6,1,-1}, +{10114,6,0,-1},{10115,6,1,-1},{10118,6,0,-1},{10119,6,1,-1},{10122,6,0,-1}, +{10123,6,1,-1},{10127,6,0,-1},{10128,6,1,-1},{10131,6,0,-1},{10132,6,1,-1}, +{10135,6,0,-1},{10136,6,1,-1},{10140,6,0,-1},{10141,6,1,-1},{10074,6,0,-1}, +{10144,6,0,-1},{10145,6,1,-1},{10148,6,0,-1},{10149,6,1,-1},{10153,6,0,-1}, +{10154,6,1,-1},{10087,6,1,-1},{10157,6,0,-1},{10158,6,1,-1},{10161,6,0,-1}, +{10162,6,1,-1},{10166,6,0,-1},{10167,6,1,-1},{10170,6,0,-1},{10171,6,1,-1}, +{10174,6,0,-1},{10175,6,1,-1},{10179,6,0,-1},{10180,6,1,-1},{10183,6,0,-1}, +{10184,6,1,-1},{10187,6,0,-1},{10188,6,1,-1},{10192,6,0,-1},{10193,6,1,-1}, +{10196,6,0,-1},{10197,6,1,-1},{10200,6,0,-1},{10201,6,1,-1},{10205,6,0,-1}, +{10206,6,1,-1},{10209,6,0,-1},{10210,6,1,-1},{10213,6,0,-1},{10214,6,1,-1}, +{10218,6,0,-1},{10219,6,1,-1},{10222,6,0,-1},{10223,6,1,-1},{10226,6,0,-1}, +{10227,6,1,-1},{10231,6,0,-1},{10232,6,1,-1},{10235,6,0,-1},{10236,6,1,-1}, +{10239,6,0,-1},{10240,6,1,-1},{10244,6,0,-1},{10245,6,1,-1},{10178,6,0,-1}, +{10248,6,0,-1},{10249,6,1,-1},{10252,6,0,-1},{10253,6,1,-1},{10257,6,0,-1}, +{10258,6,1,-1},{10191,6,1,-1},{10261,6,0,-1},{10262,6,1,-1},{10265,6,0,-1}, +{10266,6,1,-1},{10270,6,0,-1},{10271,6,1,-1},{10274,6,0,-1},{10275,6,1,-1}, +{10278,6,0,-1},{10279,6,1,-1},{10283,6,0,-1},{10284,6,1,-1},{10287,6,0,-1}, +{10288,6,1,-1},{10291,6,0,-1},{10292,6,1,-1},{10296,6,0,-1},{10297,6,1,-1}, +{10300,6,0,-1},{10301,6,1,-1},{10304,6,0,-1},{10305,6,1,-1},{10309,6,0,-1}, +{10310,6,1,-1},{10313,6,0,-1},{10314,6,1,-1},{10317,6,0,-1},{10318,6,1,-1}, +{10322,6,0,-1},{10323,6,1,-1},{10326,6,0,-1},{10327,6,1,-1},{10330,6,0,-1}, +{10331,6,1,-1},{10335,6,0,-1},{10336,6,1,-1},{10339,6,0,-1},{10340,6,1,-1}, +{10343,6,0,-1},{10344,6,1,-1},{10348,6,0,-1},{10349,6,1,-1},{10282,6,0,-1}, +{10352,6,0,-1},{10353,6,1,-1},{10356,6,0,-1},{10357,6,1,-1},{10361,6,0,-1}, +{10362,6,1,-1},{10295,6,1,-1},{10365,6,0,-1},{10366,6,1,-1},{10369,6,0,-1}, +{10370,6,1,-1},{10374,6,0,-1},{10375,6,1,-1},{10378,6,0,-1},{10379,6,1,-1}, +{10382,6,0,-1},{10383,6,1,-1},{10387,6,0,-1},{10388,6,1,-1},{10391,6,0,-1}, +{10392,6,1,-1},{10395,6,0,-1},{10396,6,1,-1},{10400,6,0,-1},{10401,6,1,-1}, +{10404,6,0,-1},{10405,6,1,-1},{10408,6,0,-1},{10409,6,1,-1},{10413,6,0,-1}, +{10414,6,1,-1},{10417,6,0,-1},{10418,6,1,-1},{10421,6,0,-1},{10422,6,1,-1}, +{10426,6,0,-1},{10427,6,1,-1},{10430,6,0,-1},{10431,6,1,-1},{10434,6,0,-1}, +{10435,6,1,-1},{10439,6,0,-1},{10440,6,1,-1},{10443,6,0,-1},{10444,6,1,-1}, +{10447,6,0,-1},{10448,6,1,-1},{10452,6,0,-1},{10453,6,1,-1},{10386,6,0,-1}, +{10456,6,0,-1},{10457,6,1,-1},{10460,6,0,-1},{10461,6,1,-1},{10465,6,0,-1}, +{10466,6,1,-1},{10399,6,1,-1},{10469,6,0,-1},{10470,6,1,-1},{10473,6,0,-1}, +{10474,6,1,-1},{10478,6,0,-1},{10479,6,1,-1},{10482,6,0,-1},{10483,6,1,-1}, +{10486,6,0,-1},{10487,6,1,-1},{10491,6,0,-1},{10492,6,1,-1},{10495,6,0,-1}, +{10496,6,1,-1},{10499,6,0,-1},{10500,6,1,-1},{10504,6,0,-1},{10505,6,1,-1}, +{10508,6,0,-1},{10509,6,1,-1},{10512,6,0,-1},{10513,6,1,-1},{10517,6,0,-1}, +{10518,6,1,-1},{10521,6,0,-1},{10522,6,1,-1},{10525,6,0,-1},{10526,6,1,-1}, +{10530,6,0,-1},{10531,6,1,-1},{10534,6,0,-1},{10535,6,1,-1},{10538,6,0,-1}, +{10539,6,1,-1},{10543,6,0,-1},{10544,6,1,-1},{10547,6,0,-1},{10548,6,1,-1}, +{10551,6,0,-1},{10552,6,1,-1},{10556,6,0,-1},{10557,6,1,-1},{10490,6,0,-1}, +{10560,6,0,-1},{10561,6,1,-1},{10564,6,0,-1},{10565,6,1,-1},{10569,6,0,-1}, +{10570,6,1,-1},{10503,6,1,-1},{10573,6,0,-1},{10574,6,1,-1},{10577,6,0,-1}, +{10578,6,1,-1},{10582,6,0,-1},{10583,6,1,-1},{10586,6,0,-1},{10587,6,1,-1}, +{10590,6,0,-1},{10591,6,1,-1},{10595,6,0,-1},{10596,6,1,-1},{10599,6,0,-1}, +{10600,6,1,-1},{10603,6,0,-1},{10604,6,1,-1},{10608,6,0,-1},{10609,6,1,-1}, +{10612,6,0,-1},{10613,6,1,-1},{10616,6,0,-1},{10617,6,1,-1},{10621,6,0,-1}, +{10622,6,1,-1},{10625,6,0,-1},{10626,6,1,-1},{10629,6,0,-1},{10630,6,1,-1}, +{10634,6,0,-1},{10635,6,1,-1},{10638,6,0,-1},{10639,6,1,-1},{10642,6,0,-1}, +{10643,6,1,-1},{10647,6,0,-1},{10648,6,1,-1},{10651,6,0,-1},{10652,6,1,-1}, +{10655,6,0,-1},{10656,6,1,-1},{10660,6,0,-1},{10661,6,1,-1},{10594,6,0,-1}, +{10664,6,0,-1},{10665,6,1,-1},{10668,6,0,-1},{10669,6,1,-1},{10673,6,0,-1}, +{10674,6,1,-1},{10607,6,1,-1},{10677,6,0,-1},{10678,6,1,-1},{10681,6,0,-1}, +{10682,6,1,-1},{10686,6,0,-1},{10687,6,1,-1},{10690,6,0,-1},{10691,6,1,-1}, +{10694,6,0,-1},{10695,6,1,-1},{10699,6,0,-1},{10700,6,1,-1},{10703,6,0,-1}, +{10704,6,1,-1},{10707,6,0,-1},{10708,6,1,-1},{10712,6,0,-1},{10713,6,1,-1}, +{10716,6,0,-1},{10717,6,1,-1},{10720,6,0,-1},{10721,6,1,-1},{10725,6,0,-1}, +{10726,6,1,-1},{10729,6,0,-1},{10730,6,1,-1},{10733,6,0,-1},{10734,6,1,-1}, +{10738,6,0,-1},{10739,6,1,-1},{10742,6,0,-1},{10743,6,1,-1},{10746,6,0,-1}, +{10747,6,1,-1},{10751,6,0,-1},{10752,6,1,-1},{10755,6,0,-1},{10756,6,1,-1}, +{10759,6,0,-1},{10760,6,1,-1},{10764,6,0,-1},{10765,6,1,-1},{10698,6,0,-1}, +{10768,6,0,-1},{10769,6,1,-1},{10772,6,0,-1},{10773,6,1,-1},{10777,6,0,-1}, +{10778,6,1,-1},{10711,6,1,-1},{10781,6,0,-1},{10782,6,1,-1},{10785,6,0,-1}, +{10786,6,1,-1},{10790,6,0,-1},{10791,6,1,-1},{10794,6,0,-1},{10795,6,1,-1}, +{10798,6,0,-1},{10799,6,1,-1},{10803,6,0,-1},{10804,6,1,-1},{10807,6,0,-1}, +{10808,6,1,-1},{10811,6,0,-1},{10812,6,1,-1},{10816,6,0,-1},{10817,6,1,-1}, +{10820,6,0,-1},{10821,6,1,-1},{10824,6,0,-1},{10825,6,1,-1},{10829,6,0,-1}, +{10830,6,1,-1},{10833,6,0,-1},{10834,6,1,-1},{10837,6,0,-1},{10838,6,1,-1}, +{10842,6,0,-1},{10843,6,1,-1},{10846,6,0,-1},{10847,6,1,-1},{10850,6,0,-1}, +{10851,6,1,-1},{10855,6,0,-1},{10856,6,1,-1},{10859,6,0,-1},{10860,6,1,-1}, +{10863,6,0,-1},{10864,6,1,-1},{10868,6,0,-1},{10869,6,1,-1},{10802,6,0,-1}, +{10872,6,0,-1},{10873,6,1,-1},{10876,6,0,-1},{10877,6,1,-1},{10881,6,0,-1}, +{10882,6,1,-1},{10815,6,1,-1},{10885,6,0,-1},{10886,6,1,-1},{10889,6,0,-1}, +{10890,6,1,-1},{10894,6,0,-1},{10895,6,1,-1},{10898,6,0,-1},{10899,6,1,-1}, +{10902,6,0,-1},{10903,6,1,-1},{10907,6,0,-1},{10908,6,1,-1},{10911,6,0,-1}, +{10912,6,1,-1},{10915,6,0,-1},{10916,6,1,-1},{10920,6,0,-1},{10921,6,1,-1}, +{10924,6,0,-1},{10925,6,1,-1},{10928,6,0,-1},{10929,6,1,-1},{10933,6,0,-1}, +{10934,6,1,-1},{10937,6,0,-1},{10938,6,1,-1},{10941,6,0,-1},{10942,6,1,-1}, +{10946,6,0,-1},{10947,6,1,-1},{10950,6,0,-1},{10951,6,1,-1},{10954,6,0,-1}, +{10955,6,1,-1},{10959,6,0,-1},{10960,6,1,-1},{10963,6,0,-1},{10964,6,1,-1}, +{10967,6,0,-1},{10968,6,1,-1},{10972,6,0,-1},{10973,6,1,-1},{10906,6,0,-1}, +{10976,6,0,-1},{10977,6,1,-1},{10980,6,0,-1},{10981,6,1,-1},{10985,6,0,-1}, +{10986,6,1,-1},{10919,6,1,-1},{10989,6,0,-1},{10990,6,1,-1},{10993,6,0,-1}, +{10994,6,1,-1},{10998,6,0,-1},{10999,6,1,-1},{11002,6,0,-1},{11003,6,1,-1}, +{11006,6,0,-1},{11007,6,1,-1},{11011,6,0,-1},{11012,6,1,-1},{11015,6,0,-1}, +{11016,6,1,-1},{11019,6,0,-1},{11020,6,1,-1},{11024,6,0,-1},{11025,6,1,-1}, +{11028,6,0,-1},{11029,6,1,-1},{11032,6,0,-1},{11033,6,1,-1},{11037,6,0,-1}, +{11038,6,1,-1},{11041,6,0,-1},{11042,6,1,-1},{11045,6,0,-1},{11046,6,1,-1}, +{11050,6,0,-1},{11051,6,1,-1},{11054,6,0,-1},{11055,6,1,-1},{11058,6,0,-1}, +{11059,6,1,-1},{11063,6,0,-1},{11064,6,1,-1},{11067,6,0,-1},{11068,6,1,-1}, +{11071,6,0,-1},{11072,6,1,-1},{11076,6,0,-1},{11077,6,1,-1},{11010,6,0,-1}, +{11080,6,0,-1},{11081,6,1,-1},{11084,6,0,-1},{11085,6,1,-1},{11089,6,0,-1}, +{11090,6,1,-1},{11023,6,1,-1},{11093,6,0,-1},{11094,6,1,-1},{11097,6,0,-1}, +{11098,6,1,-1},{11102,6,0,-1},{11103,6,1,-1},{11106,6,0,-1},{11107,6,1,-1}, +{11110,6,0,-1},{11111,6,1,-1},{11115,6,0,-1},{11116,6,1,-1},{11119,6,0,-1}, +{11120,6,1,-1},{11123,6,0,-1},{11124,6,1,-1},{11128,6,0,-1},{11129,6,1,-1}, +{11132,6,0,-1},{11133,6,1,-1},{11136,6,0,-1},{11137,6,1,-1},{11141,6,0,-1}, +{11142,6,1,-1},{11145,6,0,-1},{11146,6,1,-1},{11149,6,0,-1},{11150,6,1,-1}, +{11154,6,0,-1},{11155,6,1,-1},{11158,6,0,-1},{11159,6,1,-1},{11162,6,0,-1}, +{11163,6,1,-1},{11167,6,0,-1},{11168,6,1,-1},{11171,6,0,-1},{11172,6,1,-1}, +{11175,6,0,-1},{11176,6,1,-1},{11180,6,0,-1},{11181,6,1,-1},{11114,6,0,-1}, +{11184,6,0,-1},{11185,6,1,-1},{11188,6,0,-1},{11189,6,1,-1},{11193,6,0,-1}, +{11194,6,1,-1},{11127,6,1,-1},{11197,6,0,-1},{11198,6,1,-1},{11201,6,0,-1}, +{11202,6,1,-1},{11206,6,0,-1},{11207,6,1,-1},{11210,6,0,-1},{11211,6,1,-1}, +{11214,6,0,-1},{11215,6,1,-1},{11219,6,0,-1},{11220,6,1,-1},{11223,6,0,-1}, +{11224,6,1,-1},{11227,6,0,-1},{11228,6,1,-1},{11232,6,0,-1},{11233,6,1,-1}, +{11236,6,0,-1},{11237,6,1,-1},{11240,6,0,-1},{11241,6,1,-1},{11245,6,0,-1}, +{11246,6,1,-1},{11249,6,0,-1},{11250,6,1,-1},{11253,6,0,-1},{11254,6,1,-1}, +{11258,6,0,-1},{11259,6,1,-1},{11262,6,0,-1},{11263,6,1,-1},{11266,6,0,-1}, +{11267,6,1,-1},{11271,6,0,-1},{11272,6,1,-1},{11275,6,0,-1},{11276,6,1,-1}, +{11279,6,0,-1},{11280,6,1,-1},{11284,6,0,-1},{11285,6,1,-1},{11218,6,0,-1}, +{11288,6,0,-1},{11289,6,1,-1},{11292,6,0,-1},{11293,6,1,-1},{11297,6,0,-1}, +{11298,6,1,-1},{11231,6,1,-1},{11301,6,0,-1},{11302,6,1,-1},{11305,6,0,-1}, +{11306,6,1,-1},{11310,6,0,-1},{11311,6,1,-1},{11314,6,0,-1},{11315,6,1,-1}, +{11318,6,0,-1},{11319,6,1,-1},{11323,6,0,-1},{11324,6,1,-1},{11327,6,0,-1}, +{11328,6,1,-1},{11331,6,0,-1},{11332,6,1,-1},{11336,6,0,-1},{11337,6,1,-1}, +{11340,6,0,-1},{11341,6,1,-1},{11344,6,0,-1},{11345,6,1,-1},{11349,6,0,-1}, +{11350,6,1,-1},{11353,6,0,-1},{11354,6,1,-1},{11357,6,0,-1},{11358,6,1,-1}, +{11362,6,0,-1},{11363,6,1,-1},{11366,6,0,-1},{11367,6,1,-1},{11370,6,0,-1}, +{11371,6,1,-1},{11375,6,0,-1},{11376,6,1,-1},{11379,6,0,-1},{11380,6,1,-1}, +{11383,6,0,-1},{11384,6,1,-1},{11388,6,0,-1},{11389,6,1,-1},{11322,6,0,-1}, +{11392,6,0,-1},{11393,6,1,-1},{11396,6,0,-1},{11397,6,1,-1},{11401,6,0,-1}, +{11402,6,1,-1},{11335,6,1,-1},{11405,6,0,-1},{11406,6,1,-1},{11409,6,0,-1}, +{11410,6,1,-1},{11414,6,0,-1},{11415,6,1,-1},{11418,6,0,-1},{11419,6,1,-1}, +{11422,6,0,-1},{11423,6,1,-1},{11427,6,0,-1},{11428,6,1,-1},{11431,6,0,-1}, +{11432,6,1,-1},{11435,6,0,-1},{11436,6,1,-1},{11440,6,0,-1},{11441,6,1,-1}, +{11444,6,0,-1},{11445,6,1,-1},{11448,6,0,-1},{11449,6,1,-1},{11453,6,0,-1}, +{11454,6,1,-1},{11457,6,0,-1},{11458,6,1,-1},{11461,6,0,-1},{11462,6,1,-1}, +{11466,6,0,-1},{11467,6,1,-1},{11470,6,0,-1},{11471,6,1,-1},{11474,6,0,-1}, +{11475,6,1,-1},{11479,6,0,-1},{11480,6,1,-1},{11483,6,0,-1},{11484,6,1,-1}, +{11487,6,0,-1},{11488,6,1,-1},{11492,6,0,-1},{11493,6,1,-1},{11426,6,0,-1}, +{11496,6,0,-1},{11497,6,1,-1},{11500,6,0,-1},{11501,6,1,-1},{11505,6,0,-1}, +{11506,6,1,-1},{11439,6,1,-1},{11509,6,0,-1},{11510,6,1,-1},{11513,6,0,-1}, +{11514,6,1,-1},{11518,6,0,-1},{11519,6,1,-1},{11522,6,0,-1},{11523,6,1,-1}, +{11526,6,0,-1},{11527,6,1,-1},{11531,6,0,-1},{11532,6,1,-1},{11535,6,0,-1}, +{11536,6,1,-1},{11539,6,0,-1},{11540,6,1,-1},{11544,6,0,-1},{11545,6,1,-1}, +{11548,6,0,-1},{11549,6,1,-1},{11552,6,0,-1},{11553,6,1,-1},{11557,6,0,-1}, +{11558,6,1,-1},{11561,6,0,-1},{11562,6,1,-1},{11565,6,0,-1},{11566,6,1,-1}, +{11570,6,0,-1},{11571,6,1,-1},{11574,6,0,-1},{11575,6,1,-1},{11578,6,0,-1}, +{11579,6,1,-1},{11583,6,0,-1},{11584,6,1,-1},{11587,6,0,-1},{11588,6,1,-1}, +{11591,6,0,-1},{11592,6,1,-1},{11596,6,0,-1},{11597,6,1,-1},{11530,6,0,-1}, +{11600,6,0,-1},{11601,6,1,-1},{11604,6,0,-1},{11605,6,1,-1},{11609,6,0,-1}, +{11610,6,1,-1},{11543,6,1,-1},{11613,6,0,-1},{11614,6,1,-1},{11617,6,0,-1}, +{11622,6,0,-1},{11623,6,1,-1},{11626,6,0,-1},{11627,6,1,-1},{11630,6,0,-1}, +{11631,6,1,-1},{11635,6,0,-1},{11636,6,1,-1},{11639,6,0,-1},{11640,6,1,-1}, +{11643,6,0,-1},{11644,6,1,-1},{11648,6,0,-1},{11649,6,1,-1},{11652,6,0,-1}, +{11653,6,1,-1},{11656,6,0,-1},{11657,6,1,-1},{11661,6,0,-1},{11662,6,1,-1}, +{11665,6,0,-1},{11666,6,1,-1},{11674,6,0,-1},{11675,6,1,-1},{11678,6,0,-1}, +{11679,6,1,-1},{11682,6,0,-1},{11683,6,1,-1},{11687,6,0,-1},{11688,6,1,-1}, +{11691,6,0,-1},{11692,6,1,-1},{11695,6,0,-1},{11696,6,1,-1},{11700,6,0,-1}, +{11701,6,1,-1},{11704,6,0,-1},{11705,6,1,-1},{11708,6,0,-1},{11709,6,1,-1}, +{11713,6,0,-1},{11717,6,0,-1},{11726,6,0,-1},{11730,6,0,-1},{11734,6,0,-1}}; + +/* Frame number data sampled from measurement.c:lchan_meas_check_compute() + * Call was made between to phones on half rate channels TS7, SS0 and SS1 */ +struct fn_sample test_fn_tch_h_ts_7_ss0_ss1[] = { +{11752,7,0,-1},{11760,7,0,-1},{11769,7,0,-1},{11778,7,0,-1},{11786,7,0,-1}, +{11795,7,0,-1},{11799,7,0,-1},{11804,7,0,-1},{11738,7,0,-1},{11808,7,0,-1}, +{11812,7,0,-1},{11817,7,0,-1},{11821,7,0,-1},{11825,7,0,-1},{11830,7,0,-1}, +{11834,7,0,-1},{11838,7,0,-1},{11843,7,0,-1},{11847,7,0,-1},{11851,7,0,-1}, +{11856,7,0,-1},{11860,7,0,-1},{11864,7,0,-1},{11869,7,0,-1},{11873,7,0,-1}, +{11877,7,0,-1},{11882,7,0,-1},{11886,7,0,-1},{11890,7,0,-1},{11895,7,0,-1}, +{11899,7,0,-1},{11903,7,0,-1},{11908,7,0,-1},{11842,7,0,-1},{11912,7,0,-1}, +{11916,7,0,-1},{11921,7,0,-1},{11925,7,0,-1},{11929,7,0,-1},{11934,7,0,-1}, +{11938,7,0,-1},{11942,7,0,-1},{11947,7,0,-1},{11951,7,0,-1},{11955,7,0,-1}, +{11960,7,0,-1},{11964,7,0,-1},{11968,7,0,-1},{11973,7,0,-1},{11977,7,0,-1}, +{11981,7,0,-1},{11986,7,0,-1},{11990,7,0,-1},{11994,7,0,-1},{11999,7,0,-1}, +{12003,7,0,-1},{12007,7,0,-1},{12012,7,0,-1},{11946,7,0,-1},{12016,7,0,-1}, +{12020,7,0,-1},{12025,7,0,-1},{12026,7,1,-1},{12029,7,0,-1},{12033,7,0,-1}, +{12034,7,1,-1},{12038,7,0,-1},{12042,7,0,-1},{12046,7,0,-1},{12047,7,1,-1}, +{12051,7,0,-1},{12055,7,0,-1},{12056,7,1,-1},{12059,7,0,-1},{12064,7,0,-1}, +{12065,7,1,-1},{12068,7,0,-1},{12072,7,0,-1},{12073,7,1,-1},{12077,7,0,-1}, +{12081,7,0,-1},{12082,7,1,-1},{12085,7,0,-1},{12090,7,0,-1},{12091,7,1,-1}, +{12094,7,0,-1},{12098,7,0,-1},{12099,7,1,-1},{12103,7,0,-1},{12107,7,0,-1}, +{12108,7,1,-1},{12111,7,0,-1},{12116,7,0,-1},{12117,7,1,-1},{12050,7,0,-1}, +{12120,7,0,-1},{12124,7,0,-1},{12125,7,1,-1},{12129,7,0,-1},{12063,7,1,-1}, +{12133,7,0,-1},{12134,7,1,-1},{12137,7,0,-1},{12142,7,0,-1},{12143,7,1,-1}, +{12146,7,0,-1},{12150,7,0,-1},{12151,7,1,-1},{12155,7,0,-1},{12159,7,0,-1}, +{12160,7,1,-1},{12163,7,0,-1},{12168,7,0,-1},{12169,7,1,-1},{12172,7,0,-1}, +{12176,7,0,-1},{12177,7,1,-1},{12181,7,0,-1},{12185,7,0,-1},{12186,7,1,-1}, +{12189,7,0,-1},{12190,7,1,-1},{12194,7,0,-1},{12195,7,1,-1},{12198,7,0,-1}, +{12199,7,1,-1},{12202,7,0,-1},{12203,7,1,-1},{12207,7,0,-1},{12208,7,1,-1}, +{12211,7,0,-1},{12212,7,1,-1},{12215,7,0,-1},{12220,7,0,-1},{12221,7,1,-1}, +{12154,7,0,-1},{12224,7,0,-1},{12225,7,1,-1},{12228,7,0,-1},{12229,7,1,-1}, +{12233,7,0,-1},{12234,7,1,-1},{12167,7,1,-1},{12237,7,0,-1},{12238,7,1,-1}, +{12241,7,0,-1},{12242,7,1,-1},{12246,7,0,-1},{12247,7,1,-1},{12250,7,0,-1}, +{12251,7,1,-1},{12254,7,0,-1},{12255,7,1,-1},{12260,7,1,-1},{12263,7,0,-1}, +{12264,7,1,-1},{12267,7,0,-1},{12268,7,1,-1},{12272,7,0,-1},{12273,7,1,-1}, +{12276,7,0,-1},{12277,7,1,-1},{12280,7,0,-1},{12281,7,1,-1},{12285,7,0,-1}, +{12286,7,1,-1},{12289,7,0,-1},{12290,7,1,-1},{12293,7,0,-1},{12294,7,1,-1}, +{12298,7,0,-1},{12299,7,1,-1},{12302,7,0,-1},{12303,7,1,-1},{12306,7,0,-1}, +{12307,7,1,-1},{12311,7,0,-1},{12312,7,1,-1},{12315,7,0,-1},{12316,7,1,-1}, +{12319,7,0,-1},{12320,7,1,-1},{12324,7,0,-1},{12325,7,1,-1},{12258,7,0,-1}, +{12328,7,0,-1},{12329,7,1,-1},{12332,7,0,-1},{12333,7,1,-1},{12337,7,0,-1}, +{12338,7,1,-1},{12271,7,1,-1},{12341,7,0,-1},{12342,7,1,-1},{12345,7,0,-1}, +{12346,7,1,-1},{12350,7,0,-1},{12351,7,1,-1},{12354,7,0,-1},{12355,7,1,-1}, +{12358,7,0,-1},{12359,7,1,-1},{12363,7,0,-1},{12367,7,0,-1},{12368,7,1,-1}, +{12371,7,0,-1},{12372,7,1,-1},{12376,7,0,-1},{12377,7,1,-1},{12380,7,0,-1}, +{12381,7,1,-1},{12384,7,0,-1},{12385,7,1,-1},{12389,7,0,-1},{12390,7,1,-1}, +{12393,7,0,-1},{12394,7,1,-1},{12397,7,0,-1},{12398,7,1,-1},{12402,7,0,-1}, +{12403,7,1,-1},{12407,7,1,-1},{12410,7,0,-1},{12411,7,1,-1},{12415,7,0,-1}, +{12419,7,0,-1},{12420,7,1,-1},{12423,7,0,-1},{12424,7,1,-1},{12428,7,0,-1}, +{12429,7,1,-1},{12362,7,0,-1},{12432,7,0,-1},{12433,7,1,-1},{12436,7,0,-1}, +{12437,7,1,-1},{12441,7,0,-1},{12442,7,1,-1},{12375,7,1,-1},{12445,7,0,-1}, +{12446,7,1,-1},{12449,7,0,-1},{12450,7,1,-1},{12454,7,0,-1},{12455,7,1,-1}, +{12458,7,0,-1},{12459,7,1,-1},{12462,7,0,-1},{12463,7,1,-1},{12467,7,0,-1}, +{12468,7,1,-1},{12471,7,0,-1},{12472,7,1,-1},{12475,7,0,-1},{12476,7,1,-1}, +{12480,7,0,-1},{12481,7,1,-1},{12484,7,0,-1},{12485,7,1,-1},{12488,7,0,-1}, +{12489,7,1,-1},{12493,7,0,-1},{12494,7,1,-1},{12497,7,0,-1},{12498,7,1,-1}, +{12501,7,0,-1},{12502,7,1,-1},{12506,7,0,-1},{12507,7,1,-1},{12510,7,0,-1}, +{12511,7,1,-1},{12514,7,0,-1},{12515,7,1,-1},{12519,7,0,-1},{12520,7,1,-1}, +{12523,7,0,-1},{12524,7,1,-1},{12527,7,0,-1},{12528,7,1,-1},{12532,7,0,-1}, +{12533,7,1,-1},{12466,7,0,-1},{12536,7,0,-1},{12537,7,1,-1},{12540,7,0,-1}, +{12541,7,1,-1},{12545,7,0,-1},{12546,7,1,-1},{12479,7,1,-1},{12549,7,0,-1}, +{12550,7,1,-1},{12553,7,0,-1},{12554,7,1,-1},{12558,7,0,-1},{12559,7,1,-1}, +{12562,7,0,-1},{12563,7,1,-1},{12566,7,0,-1},{12567,7,1,-1},{12571,7,0,-1}, +{12572,7,1,-1},{12575,7,0,-1},{12576,7,1,-1},{12579,7,0,-1},{12580,7,1,-1}, +{12584,7,0,-1},{12585,7,1,-1},{12588,7,0,-1},{12589,7,1,-1},{12592,7,0,-1}, +{12593,7,1,-1},{12597,7,0,-1},{12598,7,1,-1},{12601,7,0,-1},{12602,7,1,-1}, +{12605,7,0,-1},{12606,7,1,-1},{12610,7,0,-1},{12611,7,1,-1},{12614,7,0,-1}, +{12615,7,1,-1},{12618,7,0,-1},{12619,7,1,-1},{12623,7,0,-1},{12624,7,1,-1}, +{12627,7,0,-1},{12628,7,1,-1},{12631,7,0,-1},{12632,7,1,-1},{12636,7,0,-1}, +{12637,7,1,-1},{12570,7,0,-1},{12640,7,0,-1},{12641,7,1,-1},{12644,7,0,-1}, +{12645,7,1,-1},{12649,7,0,-1},{12650,7,1,-1},{12583,7,1,-1},{12653,7,0,-1}, +{12654,7,1,-1},{12657,7,0,-1},{12658,7,1,-1},{12662,7,0,-1},{12663,7,1,-1}, +{12666,7,0,-1},{12667,7,1,-1},{12670,7,0,-1},{12671,7,1,-1},{12675,7,0,-1}, +{12676,7,1,-1},{12679,7,0,-1},{12680,7,1,-1},{12683,7,0,-1},{12684,7,1,-1}, +{12688,7,0,-1},{12689,7,1,-1},{12692,7,0,-1},{12693,7,1,-1},{12696,7,0,-1}, +{12697,7,1,-1},{12701,7,0,-1},{12702,7,1,-1},{12705,7,0,-1},{12706,7,1,-1}, +{12709,7,0,-1},{12710,7,1,-1},{12714,7,0,-1},{12715,7,1,-1},{12718,7,0,-1}, +{12719,7,1,-1},{12722,7,0,-1},{12723,7,1,-1},{12727,7,0,-1},{12728,7,1,-1}, +{12731,7,0,-1},{12732,7,1,-1},{12735,7,0,-1},{12736,7,1,-1},{12740,7,0,-1}, +{12741,7,1,-1},{12674,7,0,-1},{12744,7,0,-1},{12745,7,1,-1},{12748,7,0,-1}, +{12749,7,1,-1},{12753,7,0,-1},{12754,7,1,-1},{12687,7,1,-1},{12757,7,0,-1}, +{12758,7,1,-1},{12761,7,0,-1},{12762,7,1,-1},{12766,7,0,-1},{12767,7,1,-1}, +{12770,7,0,-1},{12771,7,1,-1},{12774,7,0,-1},{12775,7,1,-1},{12779,7,0,-1}, +{12780,7,1,-1},{12783,7,0,-1},{12784,7,1,-1},{12787,7,0,-1},{12788,7,1,-1}, +{12792,7,0,-1},{12793,7,1,-1},{12796,7,0,-1},{12797,7,1,-1},{12800,7,0,-1}, +{12801,7,1,-1},{12805,7,0,-1},{12806,7,1,-1},{12809,7,0,-1},{12810,7,1,-1}, +{12813,7,0,-1},{12814,7,1,-1},{12818,7,0,-1},{12819,7,1,-1},{12822,7,0,-1}, +{12823,7,1,-1},{12826,7,0,-1},{12827,7,1,-1},{12831,7,0,-1},{12832,7,1,-1}, +{12835,7,0,-1},{12836,7,1,-1},{12839,7,0,-1},{12840,7,1,-1},{12844,7,0,-1}, +{12845,7,1,-1},{12778,7,0,-1},{12848,7,0,-1},{12849,7,1,-1},{12852,7,0,-1}, +{12853,7,1,-1},{12857,7,0,-1},{12858,7,1,-1},{12791,7,1,-1},{12861,7,0,-1}, +{12862,7,1,-1},{12865,7,0,-1},{12866,7,1,-1},{12870,7,0,-1},{12871,7,1,-1}, +{12874,7,0,-1},{12875,7,1,-1},{12878,7,0,-1},{12879,7,1,-1},{12883,7,0,-1}, +{12884,7,1,-1},{12887,7,0,-1},{12888,7,1,-1},{12891,7,0,-1},{12892,7,1,-1}, +{12896,7,0,-1},{12897,7,1,-1},{12900,7,0,-1},{12901,7,1,-1},{12904,7,0,-1}, +{12905,7,1,-1},{12909,7,0,-1},{12910,7,1,-1},{12913,7,0,-1},{12914,7,1,-1}, +{12917,7,0,-1},{12918,7,1,-1},{12922,7,0,-1},{12923,7,1,-1},{12926,7,0,-1}, +{12927,7,1,-1},{12930,7,0,-1},{12931,7,1,-1},{12935,7,0,-1},{12936,7,1,-1}, +{12939,7,0,-1},{12940,7,1,-1},{12943,7,0,-1},{12944,7,1,-1},{12948,7,0,-1}, +{12949,7,1,-1},{12882,7,0,-1},{12952,7,0,-1},{12953,7,1,-1},{12956,7,0,-1}, +{12957,7,1,-1},{12961,7,0,-1},{12962,7,1,-1},{12895,7,1,-1},{12965,7,0,-1}, +{12966,7,1,-1},{12969,7,0,-1},{12970,7,1,-1},{12974,7,0,-1},{12975,7,1,-1}, +{12978,7,0,-1},{12979,7,1,-1},{12982,7,0,-1},{12983,7,1,-1},{12987,7,0,-1}, +{12988,7,1,-1},{12991,7,0,-1},{12992,7,1,-1},{12995,7,0,-1},{12996,7,1,-1}, +{13000,7,0,-1},{13001,7,1,-1},{13004,7,0,-1},{13005,7,1,-1},{13008,7,0,-1}, +{13009,7,1,-1},{13013,7,0,-1},{13014,7,1,-1},{13017,7,0,-1},{13018,7,1,-1}, +{13021,7,0,-1},{13022,7,1,-1},{13026,7,0,-1},{13027,7,1,-1},{13030,7,0,-1}, +{13031,7,1,-1},{13034,7,0,-1},{13035,7,1,-1},{13039,7,0,-1},{13040,7,1,-1}, +{13043,7,0,-1},{13044,7,1,-1},{13047,7,0,-1},{13048,7,1,-1},{13052,7,0,-1}, +{13053,7,1,-1},{12986,7,0,-1},{13056,7,0,-1},{13057,7,1,-1},{13060,7,0,-1}, +{13061,7,1,-1},{13065,7,0,-1},{13066,7,1,-1},{12999,7,1,-1},{13069,7,0,-1}, +{13070,7,1,-1},{13073,7,0,-1},{13074,7,1,-1},{13078,7,0,-1},{13079,7,1,-1}, +{13082,7,0,-1},{13083,7,1,-1},{13086,7,0,-1},{13087,7,1,-1},{13091,7,0,-1}, +{13092,7,1,-1},{13095,7,0,-1},{13096,7,1,-1},{13099,7,0,-1},{13100,7,1,-1}, +{13104,7,0,-1},{13105,7,1,-1},{13108,7,0,-1},{13109,7,1,-1},{13112,7,0,-1}, +{13113,7,1,-1},{13117,7,0,-1},{13118,7,1,-1},{13121,7,0,-1},{13122,7,1,-1}, +{13125,7,0,-1},{13126,7,1,-1},{13130,7,0,-1},{13131,7,1,-1},{13134,7,0,-1}, +{13135,7,1,-1},{13138,7,0,-1},{13139,7,1,-1},{13143,7,0,-1},{13144,7,1,-1}, +{13147,7,0,-1},{13148,7,1,-1},{13151,7,0,-1},{13152,7,1,-1},{13156,7,0,-1}, +{13157,7,1,-1},{13090,7,0,-1},{13160,7,0,-1},{13161,7,1,-1},{13164,7,0,-1}, +{13165,7,1,-1},{13169,7,0,-1},{13170,7,1,-1},{13103,7,1,-1},{13173,7,0,-1}, +{13174,7,1,-1},{13177,7,0,-1},{13178,7,1,-1},{13182,7,0,-1},{13183,7,1,-1}, +{13186,7,0,-1},{13187,7,1,-1},{13190,7,0,-1},{13191,7,1,-1},{13195,7,0,-1}, +{13196,7,1,-1},{13199,7,0,-1},{13200,7,1,-1},{13203,7,0,-1},{13204,7,1,-1}, +{13208,7,0,-1},{13209,7,1,-1},{13212,7,0,-1},{13213,7,1,-1},{13216,7,0,-1}, +{13217,7,1,-1},{13221,7,0,-1},{13222,7,1,-1},{13225,7,0,-1},{13226,7,1,-1}, +{13229,7,0,-1},{13230,7,1,-1},{13234,7,0,-1},{13235,7,1,-1},{13238,7,0,-1}, +{13239,7,1,-1},{13242,7,0,-1},{13243,7,1,-1},{13247,7,0,-1},{13248,7,1,-1}, +{13251,7,0,-1},{13252,7,1,-1},{13255,7,0,-1},{13256,7,1,-1},{13260,7,0,-1}, +{13261,7,1,-1},{13194,7,0,-1},{13264,7,0,-1},{13265,7,1,-1},{13268,7,0,-1}, +{13269,7,1,-1},{13273,7,0,-1},{13274,7,1,-1},{13207,7,1,-1},{13277,7,0,-1}, +{13278,7,1,-1},{13281,7,0,-1},{13282,7,1,-1},{13286,7,0,-1},{13287,7,1,-1}, +{13290,7,0,-1},{13291,7,1,-1},{13294,7,0,-1},{13295,7,1,-1},{13299,7,0,-1}, +{13300,7,1,-1},{13303,7,0,-1},{13304,7,1,-1},{13307,7,0,-1},{13308,7,1,-1}, +{13312,7,0,-1},{13313,7,1,-1},{13316,7,0,-1},{13317,7,1,-1},{13320,7,0,-1}, +{13321,7,1,-1},{13325,7,0,-1},{13326,7,1,-1},{13329,7,0,-1},{13330,7,1,-1}, +{13333,7,0,-1},{13334,7,1,-1},{13338,7,0,-1},{13339,7,1,-1},{13342,7,0,-1}, +{13343,7,1,-1},{13346,7,0,-1},{13347,7,1,-1},{13351,7,0,-1},{13352,7,1,-1}, +{13355,7,0,-1},{13356,7,1,-1},{13359,7,0,-1},{13360,7,1,-1},{13364,7,0,-1}, +{13365,7,1,-1},{13298,7,0,-1},{13368,7,0,-1},{13369,7,1,-1},{13372,7,0,-1}, +{13373,7,1,-1},{13377,7,0,-1},{13378,7,1,-1},{13311,7,1,-1},{13381,7,0,-1}, +{13382,7,1,-1},{13385,7,0,-1},{13386,7,1,-1},{13390,7,0,-1},{13391,7,1,-1}, +{13394,7,0,-1},{13395,7,1,-1},{13398,7,0,-1},{13399,7,1,-1},{13403,7,0,-1}, +{13404,7,1,-1},{13407,7,0,-1},{13408,7,1,-1},{13411,7,0,-1},{13412,7,1,-1}, +{13416,7,0,-1},{13417,7,1,-1},{13420,7,0,-1},{13421,7,1,-1},{13424,7,0,-1}, +{13425,7,1,-1},{13429,7,0,-1},{13430,7,1,-1},{13433,7,0,-1},{13434,7,1,-1}, +{13437,7,0,-1},{13438,7,1,-1},{13442,7,0,-1},{13443,7,1,-1},{13446,7,0,-1}, +{13447,7,1,-1},{13450,7,0,-1},{13451,7,1,-1},{13455,7,0,-1},{13456,7,1,-1}, +{13459,7,0,-1},{13460,7,1,-1},{13463,7,0,-1},{13464,7,1,-1},{13468,7,0,-1}, +{13469,7,1,-1},{13402,7,0,-1},{13472,7,0,-1},{13473,7,1,-1},{13476,7,0,-1}, +{13477,7,1,-1},{13481,7,0,-1},{13482,7,1,-1},{13415,7,1,-1},{13485,7,0,-1}, +{13486,7,1,-1},{13489,7,0,-1},{13490,7,1,-1},{13494,7,0,-1},{13495,7,1,-1}, +{13498,7,0,-1},{13499,7,1,-1},{13502,7,0,-1},{13503,7,1,-1},{13507,7,0,-1}, +{13508,7,1,-1},{13511,7,0,-1},{13512,7,1,-1},{13515,7,0,-1},{13516,7,1,-1}, +{13520,7,0,-1},{13521,7,1,-1},{13524,7,0,-1},{13525,7,1,-1},{13528,7,0,-1}, +{13529,7,1,-1},{13533,7,0,-1},{13534,7,1,-1},{13537,7,0,-1},{13538,7,1,-1}, +{13541,7,0,-1},{13542,7,1,-1},{13546,7,0,-1},{13547,7,1,-1},{13550,7,0,-1}, +{13551,7,1,-1},{13554,7,0,-1},{13555,7,1,-1},{13559,7,0,-1},{13560,7,1,-1}, +{13563,7,0,-1},{13564,7,1,-1},{13567,7,0,-1},{13568,7,1,-1},{13572,7,0,-1}, +{13573,7,1,-1},{13506,7,0,-1},{13576,7,0,-1},{13577,7,1,-1},{13580,7,0,-1}, +{13581,7,1,-1},{13585,7,0,-1},{13586,7,1,-1},{13519,7,1,-1},{13589,7,0,-1}, +{13590,7,1,-1},{13593,7,0,-1},{13594,7,1,-1},{13598,7,0,-1},{13599,7,1,-1}, +{13602,7,0,-1},{13603,7,1,-1},{13606,7,0,-1},{13607,7,1,-1},{13611,7,0,-1}, +{13612,7,1,-1},{13615,7,0,-1},{13616,7,1,-1},{13619,7,0,-1},{13620,7,1,-1}, +{13624,7,0,-1},{13625,7,1,-1},{13628,7,0,-1},{13629,7,1,-1},{13632,7,0,-1}, +{13633,7,1,-1},{13637,7,0,-1},{13638,7,1,-1},{13641,7,0,-1},{13642,7,1,-1}, +{13645,7,0,-1},{13646,7,1,-1},{13650,7,0,-1},{13651,7,1,-1},{13654,7,0,-1}, +{13655,7,1,-1},{13658,7,0,-1},{13659,7,1,-1},{13663,7,0,-1},{13664,7,1,-1}, +{13667,7,0,-1},{13668,7,1,-1},{13671,7,0,-1},{13672,7,1,-1},{13676,7,0,-1}, +{13677,7,1,-1},{13610,7,0,-1},{13680,7,0,-1},{13681,7,1,-1},{13684,7,0,-1}, +{13685,7,1,-1},{13689,7,0,-1},{13690,7,1,-1},{13623,7,1,-1},{13693,7,0,-1}, +{13694,7,1,-1},{13697,7,0,-1},{13698,7,1,-1},{13702,7,0,-1},{13703,7,1,-1}, +{13706,7,0,-1},{13707,7,1,-1},{13710,7,0,-1},{13711,7,1,-1},{13715,7,0,-1}, +{13716,7,1,-1},{13719,7,0,-1},{13720,7,1,-1},{13723,7,0,-1},{13724,7,1,-1}, +{13728,7,0,-1},{13729,7,1,-1},{13732,7,0,-1},{13733,7,1,-1},{13736,7,0,-1}, +{13737,7,1,-1},{13741,7,0,-1},{13742,7,1,-1},{13745,7,0,-1},{13746,7,1,-1}, +{13749,7,0,-1},{13750,7,1,-1},{13754,7,0,-1},{13755,7,1,-1},{13758,7,0,-1}, +{13759,7,1,-1},{13762,7,0,-1},{13763,7,1,-1},{13767,7,0,-1},{13768,7,1,-1}, +{13771,7,0,-1},{13772,7,1,-1},{13775,7,0,-1},{13776,7,1,-1},{13780,7,0,-1}, +{13781,7,1,-1},{13714,7,0,-1},{13784,7,0,-1},{13785,7,1,-1},{13788,7,0,-1}, +{13789,7,1,-1},{13793,7,0,-1},{13794,7,1,-1},{13727,7,1,-1},{13797,7,0,-1}, +{13798,7,1,-1},{13801,7,0,-1},{13802,7,1,-1},{13806,7,0,-1},{13807,7,1,-1}, +{13810,7,0,-1},{13811,7,1,-1},{13814,7,0,-1},{13815,7,1,-1},{13819,7,0,-1}, +{13820,7,1,-1},{13823,7,0,-1},{13824,7,1,-1},{13827,7,0,-1},{13828,7,1,-1}, +{13832,7,0,-1},{13833,7,1,-1},{13836,7,0,-1},{13837,7,1,-1},{13840,7,0,-1}, +{13841,7,1,-1},{13845,7,0,-1},{13846,7,1,-1},{13849,7,0,-1},{13850,7,1,-1}, +{13853,7,0,-1},{13854,7,1,-1},{13858,7,0,-1},{13859,7,1,-1},{13862,7,0,-1}, +{13863,7,1,-1},{13866,7,0,-1},{13867,7,1,-1},{13871,7,0,-1},{13872,7,1,-1}, +{13875,7,0,-1},{13876,7,1,-1},{13879,7,0,-1},{13880,7,1,-1},{13884,7,0,-1}, +{13885,7,1,-1},{13818,7,0,-1},{13888,7,0,-1},{13889,7,1,-1},{13892,7,0,-1}, +{13893,7,1,-1},{13897,7,0,-1},{13898,7,1,-1},{13831,7,1,-1},{13901,7,0,-1}, +{13902,7,1,-1},{13905,7,0,-1},{13906,7,1,-1},{13910,7,0,-1},{13911,7,1,-1}, +{13914,7,0,-1},{13915,7,1,-1},{13918,7,0,-1},{13919,7,1,-1},{13923,7,0,-1}, +{13924,7,1,-1},{13927,7,0,-1},{13928,7,1,-1},{13931,7,0,-1},{13932,7,1,-1}, +{13936,7,0,-1},{13937,7,1,-1},{13940,7,0,-1},{13941,7,1,-1},{13944,7,0,-1}, +{13945,7,1,-1},{13949,7,0,-1},{13950,7,1,-1},{13953,7,0,-1},{13954,7,1,-1}, +{13957,7,0,-1},{13958,7,1,-1},{13962,7,0,-1},{13963,7,1,-1},{13966,7,0,-1}, +{13967,7,1,-1},{13970,7,0,-1},{13971,7,1,-1},{13975,7,0,-1},{13976,7,1,-1}, +{13979,7,0,-1},{13980,7,1,-1},{13983,7,0,-1},{13984,7,1,-1},{13988,7,0,-1}, +{13989,7,1,-1},{13922,7,0,-1},{13992,7,0,-1},{13993,7,1,-1},{13996,7,0,-1}, +{13997,7,1,-1},{14001,7,0,-1},{14002,7,1,-1},{13935,7,1,-1},{14005,7,0,-1}, +{14006,7,1,-1},{14009,7,0,-1},{14010,7,1,-1},{14014,7,0,-1},{14015,7,1,-1}, +{14018,7,0,-1},{14019,7,1,-1},{14022,7,0,-1},{14023,7,1,-1},{14027,7,0,-1}, +{14028,7,1,-1},{14031,7,0,-1},{14032,7,1,-1},{14035,7,0,-1},{14036,7,1,-1}, +{14040,7,0,-1},{14041,7,1,-1},{14044,7,0,-1},{14045,7,1,-1},{14048,7,0,-1}, +{14049,7,1,-1},{14053,7,0,-1},{14054,7,1,-1},{14057,7,0,-1},{14058,7,1,-1}, +{14061,7,0,-1},{14062,7,1,-1},{14066,7,0,-1},{14067,7,1,-1},{14070,7,0,-1}, +{14071,7,1,-1},{14074,7,0,-1},{14075,7,1,-1},{14079,7,0,-1},{14080,7,1,-1}, +{14083,7,0,-1},{14084,7,1,-1},{14087,7,0,-1},{14088,7,1,-1},{14092,7,0,-1}, +{14093,7,1,-1},{14026,7,0,-1},{14096,7,0,-1},{14097,7,1,-1},{14100,7,0,-1}, +{14101,7,1,-1},{14105,7,0,-1},{14106,7,1,-1},{14039,7,1,-1},{14109,7,0,-1}, +{14110,7,1,-1},{14113,7,0,-1},{14114,7,1,-1},{14118,7,0,-1},{14119,7,1,-1}, +{14122,7,0,-1},{14123,7,1,-1},{14126,7,0,-1},{14127,7,1,-1},{14131,7,0,-1}, +{14132,7,1,-1},{14135,7,0,-1},{14136,7,1,-1},{14139,7,0,-1},{14140,7,1,-1}, +{14144,7,0,-1},{14145,7,1,-1},{14148,7,0,-1},{14149,7,1,-1},{14152,7,0,-1}, +{14153,7,1,-1},{14157,7,0,-1},{14158,7,1,-1},{14161,7,0,-1},{14162,7,1,-1}, +{14165,7,0,-1},{14166,7,1,-1},{14170,7,0,-1},{14171,7,1,-1},{14174,7,0,-1}, +{14175,7,1,-1},{14178,7,0,-1},{14179,7,1,-1},{14183,7,0,-1},{14184,7,1,-1}, +{14187,7,0,-1},{14188,7,1,-1},{14191,7,0,-1},{14192,7,1,-1},{14196,7,0,-1}, +{14197,7,1,-1},{14130,7,0,-1},{14200,7,0,-1},{14201,7,1,-1},{14204,7,0,-1}, +{14205,7,1,-1},{14209,7,0,-1},{14210,7,1,-1},{14143,7,1,-1},{14213,7,0,-1}, +{14214,7,1,-1},{14217,7,0,-1},{14218,7,1,-1},{14222,7,0,-1},{14223,7,1,-1}, +{14226,7,0,-1},{14227,7,1,-1},{14230,7,0,-1},{14231,7,1,-1},{14235,7,0,-1}, +{14236,7,1,-1},{14239,7,0,-1},{14240,7,1,-1},{14243,7,0,-1},{14244,7,1,-1}, +{14248,7,0,-1},{14249,7,1,-1},{14252,7,0,-1},{14253,7,1,-1},{14256,7,0,-1}, +{14257,7,1,-1},{14261,7,0,-1},{14262,7,1,-1},{14265,7,0,-1},{14266,7,1,-1}, +{14269,7,0,-1},{14270,7,1,-1},{14274,7,0,-1},{14275,7,1,-1},{14278,7,0,-1}, +{14279,7,1,-1},{14282,7,0,-1},{14283,7,1,-1},{14287,7,0,-1},{14288,7,1,-1}, +{14291,7,0,-1},{14292,7,1,-1},{14295,7,0,-1},{14296,7,1,-1},{14300,7,0,-1}, +{14301,7,1,-1},{14234,7,0,-1},{14304,7,0,-1},{14305,7,1,-1},{14308,7,0,-1}, +{14309,7,1,-1},{14313,7,0,-1},{14314,7,1,-1},{14247,7,1,-1},{14317,7,0,-1}, +{14318,7,1,-1},{14321,7,0,-1},{14322,7,1,-1},{14326,7,0,-1},{14327,7,1,-1}, +{14330,7,0,-1},{14331,7,1,-1},{14334,7,0,-1},{14335,7,1,-1},{14339,7,0,-1}, +{14340,7,1,-1},{14343,7,0,-1},{14344,7,1,-1},{14347,7,0,-1},{14348,7,1,-1}, +{14352,7,0,-1},{14353,7,1,-1},{14356,7,0,-1},{14357,7,1,-1},{14360,7,0,-1}, +{14361,7,1,-1},{14365,7,0,-1},{14366,7,1,-1},{14369,7,0,-1},{14370,7,1,-1}, +{14373,7,0,-1},{14374,7,1,-1},{14378,7,0,-1},{14379,7,1,-1},{14382,7,0,-1}, +{14383,7,1,-1},{14386,7,0,-1},{14387,7,1,-1},{14391,7,0,-1},{14392,7,1,-1}, +{14395,7,0,-1},{14396,7,1,-1},{14399,7,0,-1},{14400,7,1,-1},{14404,7,0,-1}, +{14405,7,1,-1},{14338,7,0,-1},{14408,7,0,-1},{14409,7,1,-1},{14412,7,0,-1}, +{14413,7,1,-1},{14417,7,0,-1},{14418,7,1,-1},{14351,7,1,-1},{14421,7,0,-1}, +{14422,7,1,-1},{14425,7,0,-1},{14426,7,1,-1},{14430,7,0,-1},{14431,7,1,-1}, +{14434,7,0,-1},{14435,7,1,-1},{14438,7,0,-1},{14439,7,1,-1},{14443,7,0,-1}, +{14444,7,1,-1},{14447,7,0,-1},{14448,7,1,-1},{14451,7,0,-1},{14452,7,1,-1}, +{14456,7,0,-1},{14457,7,1,-1},{14460,7,0,-1},{14461,7,1,-1},{14464,7,0,-1}, +{14465,7,1,-1},{14469,7,0,-1},{14470,7,1,-1},{14473,7,0,-1},{14474,7,1,-1}, +{14477,7,0,-1},{14478,7,1,-1},{14482,7,0,-1},{14483,7,1,-1},{14486,7,0,-1}, +{14487,7,1,-1},{14490,7,0,-1},{14491,7,1,-1},{14495,7,0,-1},{14496,7,1,-1}, +{14499,7,0,-1},{14500,7,1,-1},{14503,7,0,-1},{14504,7,1,-1},{14508,7,0,-1}, +{14509,7,1,-1},{14442,7,0,-1},{14512,7,0,-1},{14513,7,1,-1},{14516,7,0,-1}, +{14517,7,1,-1},{14521,7,0,-1},{14522,7,1,-1},{14455,7,1,-1},{14525,7,0,-1}, +{14526,7,1,-1},{14529,7,0,-1},{14530,7,1,-1},{14534,7,0,-1},{14535,7,1,-1}, +{14538,7,0,-1},{14539,7,1,-1},{14542,7,0,-1},{14543,7,1,-1},{14547,7,0,-1}, +{14548,7,1,-1},{14551,7,0,-1},{14552,7,1,-1},{14555,7,0,-1},{14556,7,1,-1}, +{14560,7,0,-1},{14561,7,1,-1},{14564,7,0,-1},{14565,7,1,-1},{14568,7,0,-1}, +{14569,7,1,-1},{14573,7,0,-1},{14574,7,1,-1},{14577,7,0,-1},{14578,7,1,-1}, +{14581,7,0,-1},{14582,7,1,-1},{14586,7,0,-1},{14587,7,1,-1},{14590,7,0,-1}, +{14591,7,1,-1},{14594,7,0,-1},{14595,7,1,-1},{14599,7,0,-1},{14600,7,1,-1}, +{14603,7,0,-1},{14604,7,1,-1},{14607,7,0,-1},{14608,7,1,-1},{14612,7,0,-1}, +{14613,7,1,-1},{14546,7,0,-1},{14616,7,0,-1},{14617,7,1,-1},{14620,7,0,-1}, +{14621,7,1,-1},{14625,7,0,-1},{14626,7,1,-1},{14559,7,1,-1},{14629,7,0,-1}, +{14630,7,1,-1},{14633,7,0,-1},{14634,7,1,-1},{14638,7,0,-1},{14639,7,1,-1}, +{14642,7,0,-1},{14643,7,1,-1},{14646,7,0,-1},{14647,7,1,-1},{14651,7,0,-1}, +{14652,7,1,-1},{14655,7,0,-1},{14656,7,1,-1},{14659,7,0,-1},{14660,7,1,-1}, +{14664,7,0,-1},{14665,7,1,-1},{14668,7,0,-1},{14669,7,1,-1},{14672,7,0,-1}, +{14673,7,1,-1},{14677,7,0,-1},{14678,7,1,-1},{14681,7,0,-1},{14682,7,1,-1}, +{14685,7,0,-1},{14686,7,1,-1},{14690,7,0,-1},{14691,7,1,-1},{14694,7,0,-1}, +{14695,7,1,-1},{14698,7,0,-1},{14699,7,1,-1},{14703,7,0,-1},{14704,7,1,-1}, +{14707,7,0,-1},{14708,7,1,-1},{14711,7,0,-1},{14712,7,1,-1},{14716,7,0,-1}, +{14717,7,1,-1},{14650,7,0,-1},{14720,7,0,-1},{14721,7,1,-1},{14724,7,0,-1}, +{14725,7,1,-1},{14729,7,0,-1},{14730,7,1,-1},{14663,7,1,-1},{14733,7,0,-1}, +{14734,7,1,-1},{14737,7,0,-1},{14738,7,1,-1},{14742,7,0,-1},{14743,7,1,-1}, +{14746,7,0,-1},{14747,7,1,-1},{14750,7,0,-1},{14751,7,1,-1},{14755,7,0,-1}, +{14756,7,1,-1},{14759,7,0,-1},{14760,7,1,-1},{14763,7,0,-1},{14764,7,1,-1}, +{14768,7,0,-1},{14769,7,1,-1},{14772,7,0,-1},{14773,7,1,-1},{14776,7,0,-1}, +{14777,7,1,-1},{14781,7,0,-1},{14782,7,1,-1},{14785,7,0,-1},{14786,7,1,-1}, +{14789,7,0,-1},{14790,7,1,-1},{14794,7,0,-1},{14795,7,1,-1},{14798,7,0,-1}, +{14799,7,1,-1},{14802,7,0,-1},{14803,7,1,-1},{14807,7,0,-1},{14808,7,1,-1}, +{14811,7,0,-1},{14812,7,1,-1},{14815,7,0,-1},{14816,7,1,-1},{14820,7,0,-1}, +{14821,7,1,-1},{14754,7,0,-1},{14824,7,0,-1},{14825,7,1,-1},{14828,7,0,-1}, +{14829,7,1,-1},{14833,7,0,-1},{14834,7,1,-1},{14767,7,1,-1},{14837,7,0,-1}, +{14838,7,1,-1},{14841,7,0,-1},{14842,7,1,-1},{14846,7,0,-1},{14847,7,1,-1}, +{14850,7,0,-1},{14851,7,1,-1},{14854,7,0,-1},{14855,7,1,-1},{14859,7,0,-1}, +{14860,7,1,-1},{14863,7,0,-1},{14864,7,1,-1},{14867,7,0,-1},{14868,7,1,-1}, +{14872,7,0,-1},{14873,7,1,-1},{14876,7,0,-1},{14877,7,1,-1},{14880,7,0,-1}, +{14881,7,1,-1},{14885,7,0,-1},{14886,7,1,-1},{14889,7,0,-1},{14890,7,1,-1}, +{14893,7,0,-1},{14894,7,1,-1},{14898,7,0,-1},{14899,7,1,-1},{14902,7,0,-1}, +{14903,7,1,-1},{14906,7,0,-1},{14907,7,1,-1},{14911,7,0,-1},{14912,7,1,-1}, +{14915,7,0,-1},{14916,7,1,-1},{14919,7,0,-1},{14920,7,1,-1},{14924,7,0,-1}, +{14925,7,1,-1},{14858,7,0,-1},{14928,7,0,-1},{14929,7,1,-1},{14932,7,0,-1}, +{14933,7,1,-1},{14937,7,0,-1},{14938,7,1,-1},{14871,7,1,-1},{14941,7,0,-1}, +{14942,7,1,-1},{14945,7,0,-1},{14946,7,1,-1},{14950,7,0,-1},{14951,7,1,-1}, +{14954,7,0,-1},{14955,7,1,-1},{14958,7,0,-1},{14959,7,1,-1},{14963,7,0,-1}, +{14964,7,1,-1},{14967,7,0,-1},{14968,7,1,-1},{14971,7,0,-1},{14972,7,1,-1}, +{14976,7,0,-1},{14977,7,1,-1},{14980,7,0,-1},{14981,7,1,-1},{14984,7,0,-1}, +{14985,7,1,-1},{14989,7,0,-1},{14990,7,1,-1},{14993,7,0,-1},{14994,7,1,-1}, +{14997,7,0,-1},{14998,7,1,-1},{15002,7,0,-1},{15003,7,1,-1},{15006,7,0,-1}, +{15007,7,1,-1},{15010,7,0,-1},{15011,7,1,-1},{15015,7,0,-1},{15016,7,1,-1}, +{15019,7,0,-1},{15020,7,1,-1},{15023,7,0,-1},{15024,7,1,-1},{15028,7,0,-1}, +{15029,7,1,-1},{14962,7,0,-1},{15032,7,0,-1},{15033,7,1,-1},{15036,7,0,-1}, +{15037,7,1,-1},{15041,7,0,-1},{15042,7,1,-1},{14975,7,1,-1},{15045,7,0,-1}, +{15046,7,1,-1},{15049,7,0,-1},{15050,7,1,-1},{15054,7,0,-1},{15055,7,1,-1}, +{15058,7,0,-1},{15059,7,1,-1},{15062,7,0,-1},{15063,7,1,-1},{15067,7,0,-1}, +{15068,7,1,-1},{15071,7,0,-1},{15072,7,1,-1},{15075,7,0,-1},{15076,7,1,-1}, +{15080,7,0,-1},{15081,7,1,-1},{15084,7,0,-1},{15085,7,1,-1},{15088,7,0,-1}, +{15089,7,1,-1},{15093,7,0,-1},{15094,7,1,-1},{15097,7,0,-1},{15098,7,1,-1}, +{15101,7,0,-1},{15102,7,1,-1},{15106,7,0,-1},{15107,7,1,-1},{15110,7,0,-1}, +{15111,7,1,-1},{15114,7,0,-1},{15115,7,1,-1},{15119,7,0,-1},{15120,7,1,-1}, +{15123,7,0,-1},{15124,7,1,-1},{15127,7,0,-1},{15128,7,1,-1},{15132,7,0,-1}, +{15133,7,1,-1},{15066,7,0,-1},{15136,7,0,-1},{15137,7,1,-1},{15140,7,0,-1}, +{15141,7,1,-1},{15145,7,0,-1},{15146,7,1,-1},{15079,7,1,-1},{15149,7,0,-1}, +{15150,7,1,-1},{15153,7,0,-1},{15154,7,1,-1},{15158,7,0,-1},{15159,7,1,-1}, +{15162,7,0,-1},{15163,7,1,-1},{15166,7,0,-1},{15167,7,1,-1},{15171,7,0,-1}, +{15172,7,1,-1},{15175,7,0,-1},{15176,7,1,-1},{15179,7,0,-1},{15180,7,1,-1}, +{15184,7,0,-1},{15185,7,1,-1},{15188,7,0,-1},{15189,7,1,-1},{15192,7,0,-1}, +{15193,7,1,-1},{15197,7,0,-1},{15198,7,1,-1},{15201,7,0,-1},{15202,7,1,-1}, +{15205,7,0,-1},{15206,7,1,-1},{15210,7,0,-1},{15211,7,1,-1},{15214,7,0,-1}, +{15215,7,1,-1},{15218,7,0,-1},{15219,7,1,-1},{15223,7,0,-1},{15224,7,1,-1}, +{15227,7,0,-1},{15228,7,1,-1},{15231,7,0,-1},{15232,7,1,-1},{15236,7,0,-1}, +{15237,7,1,-1},{15170,7,0,-1},{15240,7,0,-1},{15241,7,1,-1},{15244,7,0,-1}, +{15245,7,1,-1},{15249,7,0,-1},{15250,7,1,-1},{15183,7,1,-1},{15253,7,0,-1}, +{15254,7,1,-1},{15257,7,0,-1},{15258,7,1,-1},{15262,7,0,-1},{15263,7,1,-1}, +{15266,7,0,-1},{15267,7,1,-1},{15270,7,0,-1},{15271,7,1,-1},{15275,7,0,-1}, +{15276,7,1,-1},{15279,7,0,-1},{15280,7,1,-1},{15284,7,1,-1},{15288,7,0,-1}, +{15289,7,1,-1},{15292,7,0,-1},{15293,7,1,-1},{15296,7,0,-1},{15297,7,1,-1}, +{15301,7,0,-1},{15302,7,1,-1},{15305,7,0,-1},{15306,7,1,-1},{15309,7,0,-1}, +{15310,7,1,-1},{15314,7,0,-1},{15315,7,1,-1},{15318,7,0,-1},{15319,7,1,-1}, +{15322,7,0,-1},{15323,7,1,-1},{15327,7,0,-1},{15328,7,1,-1},{15331,7,0,-1}, +{15332,7,1,-1},{15336,7,1,-1},{15340,7,0,-1},{15341,7,1,-1},{15344,7,0,-1}, +{15345,7,1,-1},{15348,7,0,-1},{15349,7,1,-1},{15353,7,0,-1},{15354,7,1,-1}, +{15357,7,0,-1},{15361,7,0,-1},{15366,7,0,-1},{15370,7,0,-1},{15374,7,0,-1}}; diff --git a/tests/testsuite.at b/tests/testsuite.at index fed0018..0efd333 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -37,3 +37,9 @@ cat $abs_srcdir/tx_power/tx_power_test.err > experr AT_CHECK([$abs_top_builddir/tests/tx_power/tx_power_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([meas]) +AT_KEYWORDS([meas]) +cat $abs_srcdir/meas/meas_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/meas/meas_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 26 12:45:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 12:45:42 +0000 Subject: libosmocore[master]: utils: add function gsm_print_fn2gsmtime() In-Reply-To: References: Message-ID: Patch Set 3: Please change commit message to reflect function name properly - or use some text instead of function name. -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 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 Mon Jun 26 13:20:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 13:20:10 +0000 Subject: [PATCH] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3008 to look at the new patch set (#5). Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- 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, 36 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/5 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4ff..559b53a 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -15,26 +15,9 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-trx" "$deps" "$base" "$configure_flags" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43..ee3ed17 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -16,9 +16,32 @@ # Get libosmocore for verify_value_string_arrays_are_terminated.py osmo-deps.sh libosmocore -# Get OpenBSC for gsm_data_shared.* -osmo-deps.sh openbsc - cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "DEPENDENCIES_DIR_PATH" "BASE_DIR_PATH" "CONFIGURE OPTIONS" +build_bts() { + set +x + echo + echo + echo + echo " =============================== $1 ===============================" + echo + set -x + + shift + cd "$1" + osmo-deps.sh openbsc + conf_flags="--with-openbsc=$1/openbsc/openbsc/include" + shift + cd "$1" + shift + conf_flags="$conf_flags $*" + autoreconf --install --force + ./configure $conf_flags + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d5..4a30e1c 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -12,18 +12,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build_bts "osmo-bts-lc15" "$deps" "$base" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad5358..ffc448a 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -12,21 +12,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-octphy" "$deps" "$base" "$configure_flags" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004..942400e 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -17,28 +17,11 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-octphy+trx" "$deps" "$base" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249..8bbfc70 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -14,24 +14,10 @@ osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x +configure_flags="--enable-sysmocom-bts" -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-sysmo" "$deps" "$base" "$configure_flags" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jun 26 13:48:10 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 13:48:10 +0000 Subject: [MERGED] osmo-bts[master]: measurement: improve log output In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: measurement: improve log output ...................................................................... measurement: improve log output The code that receives the uplink measurement data from L1 does not print the number of already received uplink measurements. Since this is a valuable information when debugging the log output will now print this information as well. (Patch by Octasic Inc.) Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 --- M src/common/measurement.c 1 file changed, 7 insertions(+), 4 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve 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/common/measurement.c b/src/common/measurement.c index 6050001..dba3543 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -146,13 +146,16 @@ gsm_lchan_name(lchan), lchan->meas.num_ul_meas); if (lchan->state != LCHAN_S_ACTIVE) { - LOGP(DMEAS, LOGL_NOTICE, "%s measurement during state: %s\n", - gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + LOGP(DMEAS, LOGL_NOTICE, + "%s measurement during state: %s, num_ul_meas=%d\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), + lchan->meas.num_ul_meas); } if (lchan->meas.num_ul_meas >= ARRAY_SIZE(lchan->meas.uplink)) { - LOGP(DMEAS, LOGL_NOTICE, "%s no space for uplink measurement\n", - gsm_lchan_name(lchan)); + LOGP(DMEAS, LOGL_NOTICE, + "%s no space for uplink measurement, num_ul_meas=%d\n", + gsm_lchan_name(lchan), lchan->meas.num_ul_meas); return -ENOSPC; } -- To view, visit https://gerrit.osmocom.org/2930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 13:58:51 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 13:58:51 +0000 Subject: [PATCH] libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3048 to look at the new patch set (#4). utils: add function gsm_fn_as_gsmtime_str() Convert a given frame number into a printable string that displays the sub components of the frame number. Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 --- M include/osmocom/gsm/gsm_utils.h M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/3048/4 diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index 998f681..b218331 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -165,6 +165,9 @@ /* Convert from frame number to GSM time */ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); +/* Parse GSM Frame Number into printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn); + /* Convert from GSM time to frame number */ uint32_t gsm_gsmtime2fn(struct gsm_time *time); diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 61d3f83..7da02f7 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -749,6 +749,21 @@ time->tc = (time->fn / 51) % 8; } +/*! Parse GSM Frame Number into printable string + * \param[in] fn GSM Frame Number + * \returns pointer to printable string */ +char *gsm_fn_as_gsmtime_str(uint32_t fn) +{ + static char result[256]; + struct gsm_time time; + + gsm_fn2gsmtime(&time, fn); + snprintf(result, sizeof(result), "%02u/%02u/%02u/%02u", time.t1, time.t2, + time.t3, time.tc); + + return result; +} + /*! Encode decoded \ref gsm_time to Frame Number * \param[in] time GSM Time in decoded structure * \returns GSM Frame Number */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index e992a4f..29e023c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -272,6 +272,7 @@ gsm_band_name; gsm_band_parse; gsm_fn2gsmtime; +gsm_fn_as_gsmtime_str; gsm_get_octet_len; gsm_gsmtime2fn; -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 26 14:49:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 26 Jun 2017 14:49:05 +0000 Subject: osmo-bts[master]: osmo-bts-sysmo: Include frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 you also have a revert of this pushed as a patch?? -- To view, visit https://gerrit.osmocom.org/3052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 26 14:50:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 14:50:23 +0000 Subject: libosmocore[master]: utils: add function gsm_fn_as_gsmtime_str() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8015d2ded3940b01b35df7b72fc35c70c25e9926 Gerrit-PatchSet: 4 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 Mon Jun 26 14:52:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 26 Jun 2017 14:52:39 +0000 Subject: osmo-bts[master]: osmo-bts-sysmo: Include frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 1: ah, the revert is for an older version of this change? we'd usually just submit a fix for it, which makes it easier to see the actual difference between the two implementations. -- To view, visit https://gerrit.osmocom.org/3052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 26 14:54:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 26 Jun 2017 14:54:04 +0000 Subject: osmo-pcu[master]: Remove comment warning In-Reply-To: References: Message-ID: Patch Set 1: -Code-Review AFAIK, he's not registered in gerrit and the code is part of huge patch from 5 years ago so chances to get that explanation are rather slim. I think we should just either enable it or drop it and git rid of associated warning. -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 14:59:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 26 Jun 2017 14:59:50 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc Message-ID: Review at https://gerrit.osmocom.org/3054 osmo-bts-trx config: remove settsc In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config item is being removed. To be able to test it, drop the settsc option from the config. Change-Id: I89b35fc587bbac6810511b2317eed24368858f37 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/54/3054/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 452b920..c82f367 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -20,7 +20,6 @@ band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} - settsc gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach -- To view, visit https://gerrit.osmocom.org/3054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89b35fc587bbac6810511b2317eed24368858f37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 26 15:07:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 15:07:19 +0000 Subject: osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89b35fc587bbac6810511b2317eed24368858f37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 15:08:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 26 Jun 2017 15:08:09 +0000 Subject: osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) clarify: setbsic is moved, but settsc is actually dropped entirely, which doesn't match the commit log. https://gerrit.osmocom.org/#/c/3044/1/src/osmo-bts-trx/trx_vty.c File src/osmo-bts-trx/trx_vty.c: Line 506: vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); typo: legacy -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 26 15:08:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 26 Jun 2017 15:08:25 +0000 Subject: [MERGED] osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-bts-trx config: remove settsc ...................................................................... osmo-bts-trx config: remove settsc In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config item is being removed. To be able to test it, drop the settsc option from the config. Change-Id: I89b35fc587bbac6810511b2317eed24368858f37 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 452b920..c82f367 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -20,7 +20,6 @@ band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} - settsc gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach -- To view, visit https://gerrit.osmocom.org/3054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89b35fc587bbac6810511b2317eed24368858f37 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 Mon Jun 26 15:58:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 15:58:39 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Holger, Neels:Any input on this? For me it's really hard. I personally believe it makes code less readable, but Max and Pau claim it is helpful for them... -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 15:59:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 15:59:54 +0000 Subject: osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 not ready for merge -- To view, visit https://gerrit.osmocom.org/3038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af 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 Mon Jun 26 16:00:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:00:14 +0000 Subject: osmo-bts[master]: TRX: trx_if: Improve code description / comments In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3039 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c 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 Mon Jun 26 16:00:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:00:25 +0000 Subject: osmo-bts[master]: trx_if: Improve error handling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3040 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da 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 Mon Jun 26 16:00:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:00:33 +0000 Subject: osmo-bts[master]: TRX: Rename trx_if_data() -> trx_if_send_burst() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:00:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:00:53 +0000 Subject: osmo-bts[master]: TRX: merge/simplify l1_if and trx_if code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d 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 Mon Jun 26 16:00:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:00:58 +0000 Subject: osmo-bts[master]: TRX: don't free l1h in trx_phy_inst_close() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:01:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:01:12 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:02:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:02:43 +0000 Subject: osmo-pcu[master]: Remove comment warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae 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-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:02:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:02:45 +0000 Subject: [MERGED] osmo-pcu[master]: Remove comment warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove comment warning ...................................................................... Remove comment warning It's unclear why the warning was placed next to commented log statement to begin with, so let's just follow that warning's advice and drop it. Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae --- M src/pcu_l1_if.cpp 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index c16ac0c..c2c6cc6 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -549,9 +549,8 @@ /* omit frame numbers not starting at a MAC block */ if (fn13 != 0 && fn13 != 4 && fn13 != 8) return 0; -#warning uncomment -// LOGP(DL1IF, LOGL_DEBUG, "Time indication received: %d\n", -// time_ind->fn % 52); + + LOGP(DL1IF, LOGL_DEBUG, "Time indication received: %d\n", time_ind->fn % 52); BTS::main_bts()->set_current_frame_number(time_ind->fn); return 0; -- To view, visit https://gerrit.osmocom.org/3049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ef7a45d015a28fdadf75f97294bc5d4f825b8ae 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-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:03:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:03:35 +0000 Subject: osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:05:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:05:38 +0000 Subject: osmo-bts[master]: measurement: fix measurment report In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts 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 Jun 26 16:06:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:06:05 +0000 Subject: osmo-bts[master]: osmo-bts-sysmo: Include frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 26 16:06:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:06:15 +0000 Subject: osmo-bts[master]: Revert "sysmobts: normalize frame number in measurement indi... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30f37a9feef24a45e254377502615d717dba9765 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 26 16:06:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:06:18 +0000 Subject: osmo-bts[master]: Revert "osmo-bts-sysmo: Include frame number in MEAS IND" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 26 16:08:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:08:31 +0000 Subject: libosmo-sccp[master]: sccp_user.c: add missing error logging In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c Gerrit-PatchSet: 2 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 Mon Jun 26 16:09:38 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:09:38 +0000 Subject: [ABANDON] osmo-bts[master]: osmo-bts-octphy: normalize frame number in MEAS IND In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: osmo-bts-octphy: normalize frame number in MEAS IND ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0d369ff9e6da34f4bd98afd3c5d030cac73e54c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 26 16:11:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:11:20 +0000 Subject: libosmo-sccp[master]: add/tweak various logging to help figure out complex routing In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 26 16:11:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:11:36 +0000 Subject: [MERGED] libosmo-sccp[master]: add/tweak various logging to help figure out complex routing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add/tweak various logging to help figure out complex routing ...................................................................... add/tweak various logging to help figure out complex routing Add function osmo_ss7_point_code_print2() to be able to print two point codes in the same log message. Change signatures of two static functions to aid logging: add invalid ref arg to sccp_scoc_rx_inval_src_ref(), pass conn instead of inst to sccp_scoc_rx_inval_opc(). Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd --- M include/osmocom/sigtran/osmo_ss7.h M src/m3ua.c M src/osmo_ss7.c M src/osmo_ss7_hmrt.c M src/sccp_scoc.c 5 files changed, 85 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 4e04352..caf12f5 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -24,6 +24,7 @@ int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str); int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in); const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc); +const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc); /*********************************************************************** * SS7 Routing Tables diff --git a/src/m3ua.c b/src/m3ua.c index d96bd18..c43dfa4 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -536,18 +536,34 @@ struct m3ua_data_hdr *dh; struct osmo_ss7_as *as; - if (xua->hdr.msg_type != M3UA_XFER_DATA) + LOGPASP(asp, DLM3UA, LOGL_DEBUG, "m3ua_rx_xfer\n"); + + if (xua->hdr.msg_type != M3UA_XFER_DATA) { + LOGPASP(asp, DLM3UA, LOGL_ERROR, + "%s(): unsupported message type: %s\n", + __func__, + get_value_string(m3ua_xfer_msgt_names, xua->hdr.msg_type)); return M3UA_ERR_UNSUPP_MSG_TYPE; + } /* Use routing context IE to look up the AS for which the * message was received. */ as = osmo_ss7_as_find_by_rctx(asp->inst, rctx); - if (!as) + if (!as) { + LOGPASP(asp, DLM3UA, LOGL_ERROR, + "%s(): invalid routing context: %u\n", + __func__, rctx); return M3UA_ERR_INVAL_ROUT_CTX; + } - /* Verify that this ASP ix part of the AS. */ - if (!osmo_ss7_as_has_asp(as, asp)) + /* Verify that this ASP is part of the AS. */ + if (!osmo_ss7_as_has_asp(as, asp)) { + LOGPASP(asp, DLM3UA, LOGL_ERROR, + "%s(): This Application Server Process is not part of the AS resolved by" + " routing context %u\n", + __func__, rctx); return M3UA_ERR_NO_CONFGD_AS_FOR_ASP; + } /* FIXME: check for AS state == ACTIVE */ @@ -556,6 +572,10 @@ dh = data_hdr_from_m3ua(xua); OSMO_ASSERT(dh); m3ua_dh_to_xfer_param(&xua->mtp, dh); + LOGPASP(asp, DLM3UA, LOGL_DEBUG, + "%s(): M3UA data header: opc=%u=%s dpc=%u=%s\n", + __func__, xua->mtp.opc, osmo_ss7_pointcode_print(asp->inst, xua->mtp.opc), + xua->mtp.dpc, osmo_ss7_pointcode_print2(asp->inst, xua->mtp.dpc)); /* remove ROUTE_CTX as in the routing case we want to add a new * routing context on the outbound side */ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 9477543..c13c588 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -245,22 +245,36 @@ return -EINVAL; } -/* print a pointcode according to the structure configured for this - * ss7_instance */ -const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc) +const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc) { - static char buf[MAX_PC_STR_LEN]; const struct osmo_ss7_pc_fmt *pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; unsigned int num_comp_exp = num_pc_comp_exp(pc_fmt); const char *fmtstr = gen_pc_fmtstr(pc_fmt, &num_comp_exp); OSMO_ASSERT(fmtstr); - snprintf(buf, sizeof(buf), fmtstr, + snprintf(buf, len, fmtstr, pc_comp_shift_and_mask(pc_fmt, 0, pc), pc_comp_shift_and_mask(pc_fmt, 1, pc), pc_comp_shift_and_mask(pc_fmt, 2, pc)); return buf; +} + + +/* print a pointcode according to the structure configured for this + * ss7_instance */ +const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc) +{ + static char buf[MAX_PC_STR_LEN]; + return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); +} + +/* same as osmo_ss7_pointcode_print() but using a separate buffer, useful for multiple point codes in the + * same LOGP/printf. */ +const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc) +{ + static char buf[MAX_PC_STR_LEN]; + return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); } int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in) @@ -740,10 +754,15 @@ rt->cfg.pc = pc; rt->cfg.mask = mask; rt->cfg.linkset_name = talloc_strdup(rt, linkset_name); - if (lset) + if (lset) { rt->dest.linkset = lset; - else + LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via linkset '%s'\n", + pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, lset->cfg.name); + } else { rt->dest.as = as; + LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via AS '%s'\n", + pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, as->cfg.name); + } rt->rtable = rtbl; route_insert_sorted(rtbl, rt); diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c index e66762d..8165a36 100644 --- a/src/osmo_ss7_hmrt.c +++ b/src/osmo_ss7_hmrt.c @@ -138,20 +138,33 @@ /* FIXME: Transmit over respective Link */ if (rt->dest.as) { struct osmo_ss7_as *as = rt->dest.as; + DEBUGP(DLSS7, + "Found route for dpc=%u=%s: pc=%u=%s mask=0x%x" + " via AS %s proto=%s\n", + dpc, osmo_ss7_pointcode_print(inst, dpc), + rt->cfg.pc, osmo_ss7_pointcode_print2(inst, rt->cfg.pc), rt->cfg.mask, + as->cfg.name, osmo_ss7_asp_protocol_name(as->cfg.proto)); + switch (as->cfg.proto) { case OSMO_SS7_ASP_PROT_M3UA: + DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc=%u=%s\n", + dpc, osmo_ss7_pointcode_print(inst, dpc)); return m3ua_tx_xua_as(as,xua); case OSMO_SS7_ASP_PROT_IPA: return ipa_tx_xua_as(as, xua); default: LOGP(DLSS7, LOGL_ERROR, "MTP message " - "for ASP of unknown protocol%u\n", + "for ASP of unknown protocol %u\n", as->cfg.proto); break; } } else if (rt->dest.linkset) { - LOGP(DLSS7, LOGL_ERROR, "MTP-TRANSFER.req for linkset" - "%s unsupported\n",rt->dest.linkset->cfg.name); + LOGP(DLSS7, LOGL_ERROR, + "Found route for dpc=%u=%s: pc=%u=%s mask=0x%x" + " via linkset %s, but MTP-TRANSFER.req unsupported for linkset.\n", + dpc, osmo_ss7_pointcode_print(inst, dpc), + rt->cfg.pc, osmo_ss7_pointcode_print2(inst, rt->cfg.pc), rt->cfg.mask, + rt->dest.linkset->cfg.name); } else OSMO_ASSERT(0); } else { @@ -171,8 +184,12 @@ { uint32_t dpc = xua->mtp.dpc; if (osmo_ss7_pc_is_local(inst, dpc)) { + DEBUGP(DLSS7, "%s(): found dpc=%u=%s as local\n", __func__, + dpc, osmo_ss7_pointcode_print(inst, dpc)); return hmdt_message_for_distribution(inst, xua); } else { + DEBUGP(DLSS7, "%s(): dpc=%u=%s not local, message is for routing\n", __func__, + dpc, osmo_ss7_pointcode_print(inst, dpc)); return hmrt_message_for_routing(inst, xua); } } diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index fbb6ef8..9502953 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1436,8 +1436,13 @@ /* process received message for invalid source local reference */ static void sccp_scoc_rx_inval_src_ref(struct sccp_connection *conn, - struct xua_msg *xua) + struct xua_msg *xua, + uint32_t inval_src_ref) { + LOGP(DLSCCP, LOGL_NOTICE, + "Received message for source ref %u on conn with mismatching remote ref %u\n", + inval_src_ref, conn->remote_ref); + /* we have received a message with invalid source local * reference and thus apply the action indicated in Table * B.2/Q.714 */ @@ -1463,9 +1468,13 @@ } /* process received message for invalid origin point code */ -static void sccp_scoc_rx_inval_opc(struct osmo_sccp_instance *inst, +static void sccp_scoc_rx_inval_opc(struct sccp_connection *conn, struct xua_msg *xua) { + LOGP(DLSCCP, LOGL_NOTICE, + "Received message for opc=%u=%s on conn with mismatching remote pc=%u=%s\n", + xua->mtp.opc, osmo_ss7_pointcode_print(conn->inst->ss7, xua->mtp.opc), + conn->remote_pc, osmo_ss7_pointcode_print2(conn->inst->ss7, conn->remote_pc)); /* we have received a message with invalid origin PC and thus * apply the action indiacted in Table B.2/Q.714 */ switch (xua->hdr.msg_type) { @@ -1473,7 +1482,7 @@ case SUA_CO_RESRE: /* RSR */ case SUA_CO_RESCO: /* RSC */ /* Send ERR */ - tx_coerr_from_xua(inst, xua, SCCP_ERROR_POINT_CODE_MISMATCH); + tx_coerr_from_xua(conn->inst, xua, SCCP_ERROR_POINT_CODE_MISMATCH); break; case SUA_CO_RELCO: /* RLC */ case SUA_CO_CODT: /* DT1 */ @@ -1544,14 +1553,14 @@ * the one we saved in local state */ src_loc_ref = xua_msg_get_u32(xua, SUA_IEI_SRC_REF); if (src_loc_ref != conn->remote_ref) { - sccp_scoc_rx_inval_src_ref(conn, xua); + sccp_scoc_rx_inval_src_ref(conn, xua, src_loc_ref); return; } } /* Check if received OPC != the remote_pc we stored locally */ if (xua->mtp.opc != conn->remote_pc) { - sccp_scoc_rx_inval_opc(inst, xua); + sccp_scoc_rx_inval_opc(conn, xua); return; } } -- To view, visit https://gerrit.osmocom.org/3012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 26 16:11:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:11:36 +0000 Subject: [MERGED] libosmo-sccp[master]: gen_mtp_transfer_req_xua(): add addr to error log for missin... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gen_mtp_transfer_req_xua(): add addr to error log for missing DPC ...................................................................... gen_mtp_transfer_req_xua(): add addr to error log for missing DPC Change-Id: Icfd45bcbecc440b94893db2aca537a162f210abd --- M src/sccp_scrc.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index a4ce34c..e44201a 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -125,7 +126,8 @@ xua->mtp.dpc = called->pc; if (!xua->mtp.dpc) { LOGP(DLSCCP, LOGL_ERROR, "MTP-TRANSFER.req from SCCP " - "without DPC?!?\n"); + "without DPC?!? called=%s\n", + osmo_sccp_addr_dump(called)); return -1; } -- To view, visit https://gerrit.osmocom.org/3013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icfd45bcbecc440b94893db2aca537a162f210abd 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 Mon Jun 26 16:11:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 16:11:46 +0000 Subject: [PATCH] osmo-bts[master]: sysmo/tch.c: Clean up use of empty buffer Message-ID: Review at https://gerrit.osmocom.org/3055 sysmo/tch.c: Clean up use of empty buffer Make code easier to read and avoid reading first byte of the buffer if size is 0. Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a --- M src/osmo-bts-sysmo/tch.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/3055/1 diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 475652e..a12b1a7 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -506,9 +506,7 @@ { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; - uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; - uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len, sid_first[9] = { 0 }; + uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 }; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -520,6 +518,9 @@ chan_nr); return -EINVAL; } + + payload_type = data_ind->msgUnitParam.u8Buffer[0]; + payload = data_ind->msgUnitParam.u8Buffer + 1; payload_len = data_ind->msgUnitParam.u8Size - 1; switch (payload_type) { -- To view, visit https://gerrit.osmocom.org/3055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:11:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 16:11:46 +0000 Subject: [PATCH] osmo-bts[master]: sysmo/l1_if.c: Allow passing low quality buffers to l1if_tch_rx Message-ID: Review at https://gerrit.osmocom.org/3056 sysmo/l1_if.c: Allow passing low quality buffers to l1if_tch_rx We want to always call l1if_tch_rx in order to avoid losing triggering events on the upper layers. Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/3056/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f564836..9666425 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -951,12 +951,6 @@ process_meas_res(trx, chan_nr, fn, data_ind); - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, @@ -973,6 +967,12 @@ return rc; } + if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm + && data_ind->msgUnitParam.u8Size != 0) { + msgb_free(l1p_msg); + return 0; + } + /* fill L1SAP header */ sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size); l1sap = msgb_l1sap_prim(sap_msg); -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:11:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 16:11:53 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_user.c: add missing error logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_user.c: add missing error logging ...................................................................... sccp_user.c: add missing error logging Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c --- M src/sccp_user.c 1 file changed, 12 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index 5f89f71..93b03f6 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -74,11 +74,17 @@ if (!pc_valid) pc = 0; - if (sccp_user_find(inst, ssn, pc)) + scu = sccp_user_find(inst, ssn, pc); + if (scu) { + LOGP(DLSCCP, LOGL_ERROR, + "Cannot bind user '%s' to SSN=%u PC=%u=%s (pc_valid=%u), this SSN and PC" + " is already bound by '%s'\n", + name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid, scu->name); return NULL; + } - LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u (pc_valid=%u)\n", - name, ssn, pc, pc_valid); + LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u=%s (pc_valid=%u)\n", + name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid); scu = talloc_zero(inst, struct osmo_sccp_user); scu->name = talloc_strdup(scu, name); @@ -247,8 +253,10 @@ /* allocate + initialize SS7 instance */ ss7 = osmo_ss7_instance_find_or_create(ctx, 1); - if (!ss7) + if (!ss7) { + LOGP(DLSCCP, LOGL_ERROR, "Failed to find or create SS7 instance\n"); return NULL; + } ss7->cfg.primary_pc = pc; as_name = talloc_asprintf(ctx, "as-clnt-%s", name); -- To view, visit https://gerrit.osmocom.org/3014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c 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 Mon Jun 26 16:26:11 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 26 Jun 2017 16:26:11 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: > Holger, Neels:Any input on this? For me it's really hard. I > personally believe it makes code less readable, but Max and Pau > claim it is helpful for them... Doesn't the Linux kernel have macros? The current macro seems to limit us to signed int and not 64bit numbers? (1u << vs. 1 << ). My personal opinion.. not a big gain... but I see how bit set/bit clear can make it easier for some. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:28:43 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:28:43 +0000 Subject: [PATCH] openbsc[master]: lchan: add members for BFI 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/2934 to look at the new patch set (#2). lchan: add members for BFI The lchan struct lacks structures to keep track of the BFI (Bad Frame Indication) counters. There are independed counters for SACCH and TCH. When a bad block is received, the corresponding counter is incremented. A good block will decrement the counter again. This commit is required by osmo-bts changes: Change-Id I02edc4724f3d272905bee13384628aca18ea9781 Change-Id Idf044e58863aeab7239ba420b71e1676be62cacb (Patch by Octasic Inc.) Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/2934/2 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index d3fd757..6cecc78 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -314,6 +314,8 @@ uint8_t bts_tx_pwr; /* number of measurements stored in array below */ uint8_t num_ul_meas; + uint32_t num_sacch_bfi; + uint32_t num_tch_bfi; struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; /* last L1 header from the MS */ uint8_t l1_info[2]; -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Jun 26 16:32:10 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:32:10 +0000 Subject: [PATCH] osmo-bts[master]: measurement: initalize lchan properly In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2931 to look at the new patch set (#2). measurement: initalize lchan properly When the TX channel is activated, the measurement related struct members are not properly reset. To ensure all flags are initalized properly we set the measurement related flags zu zero. This commit depends on openbsc change: Change-Id I2ed78a9dd8747736d01ccf700396d7996f9f4e5d (Patch by Octasic Inc.) Change-Id: I02edc4724f3d272905bee13384628aca18ea9781 --- M src/common/rsl.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/31/2931/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index eab9379..5972c15 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -590,8 +590,13 @@ rsl_dch_push_hdr(msg, RSL_MT_CHAN_ACTIV_ACK, chan_nr); msg->trx = lchan->ts->trx; - /* since activation was successful, do some lchan initialization */ + /* since activation was successful, do some + * lchan initialization for measurement */ lchan->meas.res_nr = 0; + lchan->meas.flags = 0; + lchan->meas.num_ul_meas = 0; + lchan->meas.num_sacch_bfi = 0; + lchan->meas.num_tch_bfi = 0; return abis_bts_rsl_sendmsg(msg); } -- To view, visit https://gerrit.osmocom.org/2931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02edc4724f3d272905bee13384628aca18ea9781 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:32:11 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:32:11 +0000 Subject: [PATCH] osmo-bts[master]: octphy: initalize l1msg and only when needed Message-ID: Review at https://gerrit.osmocom.org/3057 octphy: initalize l1msg and only when needed l1msg is initalized when the variable is declared. This means the allocation always runs right on the beginning. Even when the buffer is not needed at all. do a prober l1msg initalization only when needed and check the return code. (Patch by Octasic Inc.) Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/3057/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 85b5a86..9b348a9 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -451,7 +451,7 @@ { struct phy_instance *pinst = trx_phy_instance(trx); struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; - struct msgb *l1msg = l1p_msgb_alloc(); + struct msgb *l1msg = NULL; uint32_t u32Fn; uint8_t u8Tn, subCh, sapi = 0; uint8_t chan_nr, link_id; @@ -510,6 +510,14 @@ if (len) { /* create new PHY primitive in l1msg, copying payload */ + + l1msg = l1p_msgb_alloc(); + if (!l1msg) { + LOGP(DL1C, LOGL_FATAL, "L1SAP PH-DATA.req msg alloc failed\n"); + rc = -ENOMEM; + goto done; + } + tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *data_req = (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *) msgb_put(l1msg, sizeof(*data_req)); -- To view, visit https://gerrit.osmocom.org/3057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:32:11 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:32:11 +0000 Subject: [PATCH] osmo-bts[master]: octphy: initalize nmsg only when needed Message-ID: Review at https://gerrit.osmocom.org/3058 octphy: initalize nmsg only when needed nmsg is initalized every time the function runs, even when it is not needed. Move the initalization into the if (msg) body so that nmsg is only initalized when we really need it. (Patch by Octasic Inc.) Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/3058/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 9b348a9..0efc4bb 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -584,13 +584,14 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); - /* create new message */ - nmsg = l1p_msgb_alloc(); - if (!nmsg) - return -ENOMEM; - /* create new message and fill data */ if (msg) { + nmsg = l1p_msgb_alloc(); + if (!nmsg) { + LOGP(DL1C, LOGL_FATAL, "L1SAP PH-TCH.req msg alloc failed\n"); + return -ENOMEM; + } + msgb_pull(msg, sizeof(*l1sap)); tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *data_req = (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *) -- To view, visit https://gerrit.osmocom.org/3058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:32:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:32:12 +0000 Subject: [PATCH] osmo-bts[master]: octphy: remove log output Message-ID: Review at https://gerrit.osmocom.org/3059 octphy: remove log output When handle_ph_data_ind() runs BER and RSSI is logged. Remove this log output by removing the call to dump_meas_res (Patch by Octasic Inc.) Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/59/3059/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 0efc4bb..8b31630 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1058,8 +1058,6 @@ data_ind->Data.ulDataLength), data_ind->Data.ulDataLength); - dump_meas_res(LOGL_DEBUG, &data_ind->MeasurementInfo); - /* check for TCH */ if (sapi == cOCTVC1_GSM_SAPI_ENUM_TCHF || sapi == cOCTVC1_GSM_SAPI_ENUM_TCHH) { -- To view, visit https://gerrit.osmocom.org/3059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:32:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:32:12 +0000 Subject: [PATCH] osmo-bts[master]: octphy: do not send empty frames to phy Message-ID: Review at https://gerrit.osmocom.org/3060 octphy: do not send empty frames to phy ph_data_req() and ph_tch_req() are generating empty frames when no data (msg == NULL) is available. Remove the empty frame generation and exit the function cleanly. (Patch by Octasic Inc.) Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 5 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/3060/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8b31630..c36b701 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -536,22 +536,9 @@ mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req); } else { - /* No data available, generate Empty frame Req in l1msg */ - tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *empty_frame_req = - (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *) - msgb_put(l1msg, sizeof(*empty_frame_req)); - - l1if_fill_msg_hdr(&empty_frame_req->Header, l1msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, - cOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CID); - - empty_frame_req->TrxId.byTrxId = pinst->u.octphy.trx_id; - empty_frame_req->LchId.byTimeslotNb = u8Tn; - empty_frame_req->LchId.bySAPI = sapi; - empty_frame_req->LchId.bySubChannelNb = subCh; - empty_frame_req->LchId.byDirection = cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS; - empty_frame_req->ulFrameNumber = u32Fn; - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_SWAP(empty_frame_req); + /* No data available, Don't send Empty frame to PHY */ + rc = 0; + goto done; } rc = l1if_req_compl(fl1h, l1msg, NULL, NULL); @@ -618,24 +605,8 @@ mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD_SWAP(data_req); } else { - tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *empty_frame_req = - (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD *) - msgb_put(nmsg, sizeof(*empty_frame_req)); - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_DEF(empty_frame_req); - - l1if_fill_msg_hdr(&empty_frame_req->Header, nmsg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, - cOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CID); - - empty_frame_req->TrxId.byTrxId = pinst->u.octphy.trx_id; - empty_frame_req->LchId.byTimeslotNb = u8Tn; - empty_frame_req->LchId.bySAPI = sapi; - empty_frame_req->LchId.bySubChannelNb = subCh; - empty_frame_req->LchId.byDirection = - cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS; - empty_frame_req->ulFrameNumber = u32Fn; - - mOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_EMPTY_FRAME_CMD_SWAP(empty_frame_req); + /* No data available, Don't send Empty frame to PHY */ + return 0; } return l1if_req_compl(fl1h, nmsg, NULL, NULL); -- To view, visit https://gerrit.osmocom.org/3060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 16:32:12 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 26 Jun 2017 16:32:12 +0000 Subject: [PATCH] osmo-bts[master]: octphy: record SAACH and TCH BFI Message-ID: Review at https://gerrit.osmocom.org/3061 octphy: record SAACH and TCH BFI Check for bad blocks. If a bad block is detected, increment the block failure indicator (BFI). If a good block is detected, decrement the BFI again. Both happends independently for SACCH and TCH. The data is recored in the lchan struct. This commit depends on openbsc change: Change-Id I2ed78a9dd8747736d01ccf700396d7996f9f4e5d (Patch by Octasic Inc.) Change-Id: Idf044e58863aeab7239ba420b71e1676be62cacb --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/3061/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index c36b701..3a0c055 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -993,6 +993,7 @@ int16_t snr; int8_t rssi; int rc; + struct gsm_lchan *lchan; uint8_t sapi = (uint8_t) data_ind->LchId.bySAPI; uint8_t ts_num = (uint8_t) data_ind->LchId.byTimeslotNb; @@ -1029,12 +1030,41 @@ data_ind->Data.ulDataLength), data_ind->Data.ulDataLength); + lchan = get_lchan_by_chan_nr(trx, chan_nr); + if (!lchan) + return -EINVAL; + /* check for TCH */ if (sapi == cOCTVC1_GSM_SAPI_ENUM_TCHF || sapi == cOCTVC1_GSM_SAPI_ENUM_TCHH) { /* TCH speech frame handling */ rc = l1if_tch_rx(trx, chan_nr, data_ind); - return rc; + + if (data_ind->Data.ulDataLength == 0) { + lchan->meas.num_tch_bfi++; + } else { + if (lchan->meas.num_tch_bfi > 0) + lchan->meas.num_tch_bfi--; + return rc; + } + + } + + /*check for SACCH BFI count for radio link failure */ + else if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) { + if (data_ind->Data.ulDataLength == 0) { + lchan->meas.num_sacch_bfi++; + + LOGP(DL1C, LOGL_NOTICE, + "%s UL RLF meas, num_ul_meas=%d, meas_res_num=%d " + "num_tch_bfi=%d, num_sacch_bfi=%d, fn=%u\n", + gsm_lchan_name(lchan), lchan->meas.num_ul_meas, + lchan->meas.res_nr, lchan->meas.num_tch_bfi, + lchan->meas.num_sacch_bfi, fn); + } else { + if (lchan->meas.num_sacch_bfi > 0) + lchan->meas.num_sacch_bfi--; + } } /* get rssi, rssi is in q8 format */ -- To view, visit https://gerrit.osmocom.org/3061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf044e58863aeab7239ba420b71e1676be62cacb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jun 26 17:26:56 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Mon, 26 Jun 2017 17:26:56 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup Message-ID: Review at https://gerrit.osmocom.org/3062 uhd: Always specify samples-per-symbol for device lookup Fix MCBTS device setup where the map access was failing on the wrong assumption that all devices support 1-SPS TX-RX operation. Some devices and/or configurations such as LIMESDR and MCBTS only support running at 4-SPS. Even though certain settings (e.g. number of physical channels or the FPGA clocking rate) are not dependent on the SPS value, we still need to specify because we use SPS as a parameter for device classification. Fixes: Bug #2341 "osmo-trx-m is broken" Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/3062/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 833f02f..a766ddc 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -576,7 +576,7 @@ chans = 1; } - if (chans > dev_param_map.at(dev_key(dev_type, 1, 1)).channels) + if (chans > dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)).channels) throw std::invalid_argument("Device does not support number of requested channels"); std::string subdev_string; @@ -1069,7 +1069,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { + if (rf_spread > dev_param_map.at(dev_key(B210, tx_sps, rx_sps)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou From gerrit-no-reply at lists.osmocom.org Mon Jun 26 17:39:07 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 17:39:07 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 I run it manually with osmo-gsm-tester and jenkins and it seems to be failing with this patch applied: http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_manual-run-all/2/console I built everything using master and osmo-bts with branch pespin/osmo-gsm-tester which is basically master + this branch: http://git.osmocom.org/osmo-bts/log/?h=pespin/osmo-gsm-tester -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 26 18:17:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 18:17:00 +0000 Subject: [PATCH] libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer Message-ID: Review at https://gerrit.osmocom.org/3063 tests: osmo-pcap: Fix per packet timer Before this commit, the gap time between 2 packets {n-1, n} was being applied to {n, n+1}. Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea --- M tests/osmo-pcap-test/osmo_pcap.h M tests/osmo-pcap-test/pcap.c 2 files changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/63/3063/1 diff --git a/tests/osmo-pcap-test/osmo_pcap.h b/tests/osmo-pcap-test/osmo_pcap.h index cff638b..171360d 100644 --- a/tests/osmo-pcap-test/osmo_pcap.h +++ b/tests/osmo-pcap-test/osmo_pcap.h @@ -12,6 +12,7 @@ pcap_t *h; struct osmo_timer_list timer; struct timeval last; + struct msgb *deliver_msg; }; pcap_t *osmo_pcap_test_open(const char *pcapfile); diff --git a/tests/osmo-pcap-test/pcap.c b/tests/osmo-pcap-test/pcap.c index 8fa8e0f..6ecb90d 100644 --- a/tests/osmo-pcap-test/pcap.c +++ b/tests/osmo-pcap-test/pcap.c @@ -39,7 +39,8 @@ } osmo_pcap_test_stats; static int -osmo_pcap_process_packet(const uint8_t *pkt, uint32_t pktlen, +osmo_pcap_process_packet(struct msgb **msgptr, + const uint8_t *pkt, uint32_t pktlen, struct osmo_pcap_proto_l2l3 *l3h, struct osmo_pcap_proto_l4 *l4h, int (*cb)(struct msgb *msgb)) @@ -56,7 +57,7 @@ /* This packet contains no data, skip it. */ if (l4h->l4pkt_no_data(pkt + l3hdr_len + ETH_HLEN)) { osmo_pcap_test_stats.skip++; - return 0; + return -1; } /* get application layer data. */ @@ -72,11 +73,9 @@ memcpy(msgb->data, pkt, pktlen); msgb_put(msgb, pktlen); - ret = cb(msgb); + *msgptr = msgb; - osmo_pcap_test_stats.processed++; - - return ret; + return 0; } pcap_t *osmo_pcap_test_open(const char *pcapfile) @@ -109,6 +108,13 @@ struct timeval res; uint8_t l4protonum; + + if(p->deliver_msg) { + if (cb(p->deliver_msg) == 0) + osmo_pcap_test_stats.processed++; + p->deliver_msg = 0; + } + retry: pkt = pcap_next(p->h, &pcaph); if (pkt == NULL) @@ -140,7 +146,7 @@ memcpy(&p->last, &pcaph.ts, sizeof(struct timeval)); /* retry with next packet if this has been skipped. */ - if (osmo_pcap_process_packet(pkt, pcaph.caplen, l3h, l4h, cb) < 0) + if (osmo_pcap_process_packet(&p->deliver_msg, pkt, pcaph.caplen, l3h, l4h, cb) < 0) goto retry; /* calculate waiting time */ -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 26 18:17:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 18:17:00 +0000 Subject: [PATCH] libosmo-netif[master]: tests: osmo-pcap: Allow different l2 pkts Message-ID: Review at https://gerrit.osmocom.org/3064 tests: osmo-pcap: Allow different l2 pkts Before this patch, ETH was assumed and other types were not supported. This patch also adds Linux cooked packet support for L2. Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f --- M tests/osmo-pcap-test/Makefile.am A tests/osmo-pcap-test/l2_eth.c A tests/osmo-pcap-test/l2_sll.c M tests/osmo-pcap-test/l3_ipv4.c M tests/osmo-pcap-test/l4_tcp.c M tests/osmo-pcap-test/l4_udp.c M tests/osmo-pcap-test/pcap.c M tests/osmo-pcap-test/proto.c M tests/osmo-pcap-test/proto.h 9 files changed, 189 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/64/3064/1 diff --git a/tests/osmo-pcap-test/Makefile.am b/tests/osmo-pcap-test/Makefile.am index a256005..3e5bdf1 100644 --- a/tests/osmo-pcap-test/Makefile.am +++ b/tests/osmo-pcap-test/Makefile.am @@ -3,6 +3,8 @@ check_PROGRAMS = osmo-pcap-test osmo_pcap_test_SOURCES = proto.c \ + l2_eth.c \ + l2_sll.c \ l3_ipv4.c \ l4_tcp.c \ l4_udp.c \ diff --git a/tests/osmo-pcap-test/l2_eth.c b/tests/osmo-pcap-test/l2_eth.c new file mode 100644 index 0000000..3171fd7 --- /dev/null +++ b/tests/osmo-pcap-test/l2_eth.c @@ -0,0 +1,48 @@ +/* + * (C) 2012 by Pablo Neira Ayuso + * (C) 2012 by On Waves ehf + * + * 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 vers + */ + +#include +#include +#include +#include +#include + +#include "proto.h" + +#define PRINT_CMP(...) + +static int unsigned l2_eth_pkt_l3proto_num(const uint8_t *pkt) +{ + const struct ethhdr *eh = (const struct ethhdr *)pkt; + switch(ntohs(eh->h_proto)) { + case ETH_P_IP: + return htons(AF_INET); + default: + return eh->h_proto; + } +} + +static unsigned int l2_eth_pkt_l2hdr_len(const uint8_t *pkt) +{ + + return ETH_HLEN; +} + +static struct osmo_pcap_proto_l2 eth = { + //.l2protonum = ETH_P_IP, + .l2protonum = DLT_EN10MB, + .l2pkt_hdr_len = l2_eth_pkt_l2hdr_len, + .l3pkt_proto = l2_eth_pkt_l3proto_num, +}; + +void l2_eth_init(void) +{ + osmo_pcap_proto_l2_register(ð); +} diff --git a/tests/osmo-pcap-test/l2_sll.c b/tests/osmo-pcap-test/l2_sll.c new file mode 100644 index 0000000..5a600ff --- /dev/null +++ b/tests/osmo-pcap-test/l2_sll.c @@ -0,0 +1,47 @@ +/* + * (C) 2012 by Pablo Neira Ayuso + * (C) 2012 by On Waves ehf + * + * 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 vers + */ + +#include +#include +#include +#include +#include + +#include "proto.h" + +#define PRINT_CMP(...) + +static unsigned int l2_sll_pkt_l3proto_num(const uint8_t *pkt) +{ + const struct sll_header *lh = (const struct sll_header *)pkt; + switch(ntohs(lh->sll_protocol)) { + case ETH_P_IP: + return htons(AF_INET); + default: + return lh->sll_protocol; + } +} + +static unsigned int l2_sll_pkt_l2hdr_len(const uint8_t *pkt) +{ + + return SLL_HDR_LEN; +} + +static struct osmo_pcap_proto_l2 sll = { + .l2protonum = DLT_LINUX_SLL, + .l2pkt_hdr_len = l2_sll_pkt_l2hdr_len, + .l3pkt_proto = l2_sll_pkt_l3proto_num, +}; + +void l2_sll_init(void) +{ + osmo_pcap_proto_l2_register(&sll); +} diff --git a/tests/osmo-pcap-test/l3_ipv4.c b/tests/osmo-pcap-test/l3_ipv4.c index 83e3479..521a803 100644 --- a/tests/osmo-pcap-test/l3_ipv4.c +++ b/tests/osmo-pcap-test/l3_ipv4.c @@ -16,29 +16,27 @@ #define PRINT_CMP(...) -static int l3_ipv4_pkt_l4proto_num(const uint8_t *pkt) +static unsigned int l3_ipv4_pkt_l4proto_num(const uint8_t *pkt) { const struct iphdr *iph = (const struct iphdr *)pkt; return iph->protocol; } -static int l3_ipv4_pkt_l3hdr_len(const uint8_t *pkt) +static unsigned int l3_ipv4_pkt_l3hdr_len(const uint8_t *pkt) { const struct iphdr *iph = (const struct iphdr *)pkt; return iph->ihl << 2; } -static struct osmo_pcap_proto_l2l3 ipv4 = { - .l2protonum = ETH_P_IP, +static struct osmo_pcap_proto_l3 ipv4 = { .l3protonum = AF_INET, - .l2hdr_len = ETH_HLEN, .l3pkt_hdr_len = l3_ipv4_pkt_l3hdr_len, .l4pkt_proto = l3_ipv4_pkt_l4proto_num, }; -void l2l3_ipv4_init(void) +void l3_ipv4_init(void) { - osmo_pcap_proto_l2l3_register(&ipv4); + osmo_pcap_proto_l3_register(&ipv4); } diff --git a/tests/osmo-pcap-test/l4_tcp.c b/tests/osmo-pcap-test/l4_tcp.c index 1e024b5..f7aedbd 100644 --- a/tests/osmo-pcap-test/l4_tcp.c +++ b/tests/osmo-pcap-test/l4_tcp.c @@ -13,14 +13,14 @@ #include "proto.h" -static int l4_tcp_pkt_hdr_len(const uint8_t *pkt) +static unsigned int l4_tcp_pkt_hdr_len(const uint8_t *pkt) { const struct tcphdr *tcph = (const struct tcphdr *)pkt; return tcph->doff << 2; } -static int l4_tcp_pkt_no_data(const uint8_t *pkt) +static unsigned int l4_tcp_pkt_no_data(const uint8_t *pkt) { const struct tcphdr *tcph = (const struct tcphdr *)pkt; return tcph->syn || tcph->fin || tcph->rst || !tcph->psh; diff --git a/tests/osmo-pcap-test/l4_udp.c b/tests/osmo-pcap-test/l4_udp.c index 9ffa77b..1733908 100644 --- a/tests/osmo-pcap-test/l4_udp.c +++ b/tests/osmo-pcap-test/l4_udp.c @@ -13,12 +13,12 @@ #include "proto.h" -static int l4_udp_pkt_hdr_len(const uint8_t *pkt) +static unsigned int l4_udp_pkt_hdr_len(const uint8_t *pkt) { return sizeof(struct udphdr); } -static int l4_udp_pkt_no_data(const uint8_t *pkt) +static unsigned int l4_udp_pkt_no_data(const uint8_t *pkt) { /* UDP has no control packets. */ return 0; diff --git a/tests/osmo-pcap-test/pcap.c b/tests/osmo-pcap-test/pcap.c index 6ecb90d..196e5e9 100644 --- a/tests/osmo-pcap-test/pcap.c +++ b/tests/osmo-pcap-test/pcap.c @@ -34,6 +34,7 @@ uint32_t pkts; uint32_t skip; uint32_t processed; + uint32_t unsupported_l2; uint32_t unsupported_l3; uint32_t unsupported_l4; } osmo_pcap_test_stats; @@ -41,21 +42,22 @@ static int osmo_pcap_process_packet(struct msgb **msgptr, const uint8_t *pkt, uint32_t pktlen, - struct osmo_pcap_proto_l2l3 *l3h, + struct osmo_pcap_proto_l2 *l2h, + struct osmo_pcap_proto_l3 *l3h, struct osmo_pcap_proto_l4 *l4h, int (*cb)(struct msgb *msgb)) { - unsigned int l3hdr_len, skip_hdr_len; + unsigned int l2hdr_len, l3hdr_len, skip_hdr_len; struct msgb *msgb; - int ret; /* skip layer 2, 3 and 4 headers */ - l3hdr_len = l3h->l3pkt_hdr_len(pkt + ETH_HLEN); - skip_hdr_len = l3h->l2hdr_len + l3hdr_len + - l4h->l4pkt_hdr_len(pkt + ETH_HLEN + l3hdr_len); + l2hdr_len = l2h->l2pkt_hdr_len(pkt); + l3hdr_len = l3h->l3pkt_hdr_len(pkt + l2hdr_len); + skip_hdr_len = l2hdr_len + l3hdr_len + + l4h->l4pkt_hdr_len(pkt + l2hdr_len + l3hdr_len); /* This packet contains no data, skip it. */ - if (l4h->l4pkt_no_data(pkt + l3hdr_len + ETH_HLEN)) { + if (l4h->l4pkt_no_data(pkt + l2hdr_len + l3hdr_len)) { osmo_pcap_test_stats.skip++; return -1; } @@ -101,10 +103,11 @@ int osmo_pcap_test_run(struct osmo_pcap *p, uint8_t pnum, int (*cb)(struct msgb *msgb)) { - struct osmo_pcap_proto_l2l3 *l3h; + struct osmo_pcap_proto_l2 *l2h; + struct osmo_pcap_proto_l3 *l3h; struct osmo_pcap_proto_l4 *l4h; struct pcap_pkthdr pcaph; - const u_char *pkt; + const u_char *l2pkt, *l3pkt; struct timeval res; uint8_t l4protonum; @@ -116,26 +119,34 @@ } retry: - pkt = pcap_next(p->h, &pcaph); - if (pkt == NULL) + l2pkt = pcap_next(p->h, &pcaph); + if (l2pkt == NULL) return -1; osmo_pcap_test_stats.pkts++; - l3h = osmo_pcap_proto_l2l3_find(pkt); + int linktype = pcap_datalink(p->h); + l2h = osmo_pcap_proto_l2_find(linktype); + if(l2h == NULL) { + osmo_pcap_test_stats.unsupported_l2++; + goto retry; + } + + l3h = osmo_pcap_proto_l3_find(l2h->l3pkt_proto(l2pkt)); if (l3h == NULL) { osmo_pcap_test_stats.unsupported_l3++; goto retry; } - l4protonum = l3h->l4pkt_proto(pkt + ETH_HLEN); + l3pkt = l2pkt + l2h->l2pkt_hdr_len(l2pkt); + l4protonum = l3h->l4pkt_proto(l3pkt); /* filter l4 protocols we are not interested in */ if (l4protonum != pnum) { osmo_pcap_test_stats.skip++; goto retry; } - l4h = osmo_pcap_proto_l4_find(pkt, l4protonum); + l4h = osmo_pcap_proto_l4_find(l4protonum); if (l4h == NULL) { osmo_pcap_test_stats.unsupported_l4++; goto retry; @@ -146,7 +157,7 @@ memcpy(&p->last, &pcaph.ts, sizeof(struct timeval)); /* retry with next packet if this has been skipped. */ - if (osmo_pcap_process_packet(&p->deliver_msg, pkt, pcaph.caplen, l3h, l4h, cb) < 0) + if (osmo_pcap_process_packet(&p->deliver_msg, l2pkt, pcaph.caplen, l2h, l3h, l4h, cb) < 0) goto retry; /* calculate waiting time */ @@ -162,19 +173,22 @@ void osmo_pcap_stats_printf(void) { - printf("pkts=%d processed=%d skip=%d " + printf("pkts=%d processed=%d skip=%d unsupported_l2=%d " "unsupported_l3=%d unsupported_l4=%d\n", osmo_pcap_test_stats.pkts, osmo_pcap_test_stats.processed, osmo_pcap_test_stats.skip, + osmo_pcap_test_stats.unsupported_l2, osmo_pcap_test_stats.unsupported_l3, osmo_pcap_test_stats.unsupported_l4); } void osmo_pcap_init(void) { - /* Initialization of supported layer 3 and 4 protocols here. */ - l2l3_ipv4_init(); + /* Initialization of supported layer 2, 3 and 4 protocols here. */ + l2_eth_init(); + l2_sll_init(); + l3_ipv4_init(); l4_tcp_init(); l4_udp_init(); } diff --git a/tests/osmo-pcap-test/proto.c b/tests/osmo-pcap-test/proto.c index f90f07c..085ca25 100644 --- a/tests/osmo-pcap-test/proto.c +++ b/tests/osmo-pcap-test/proto.c @@ -15,28 +15,46 @@ #include #include "proto.h" -static LLIST_HEAD(l2l3_proto_list); +static LLIST_HEAD(l2_proto_list); +static LLIST_HEAD(l3_proto_list); static LLIST_HEAD(l4_proto_list); +#include -struct osmo_pcap_proto_l2l3 *osmo_pcap_proto_l2l3_find(const uint8_t *pkt) +struct osmo_pcap_proto_l2 *osmo_pcap_proto_l2_find(unsigned int pcap_linktype) { - const struct ethhdr *eh = (const struct ethhdr *)pkt; - struct osmo_pcap_proto_l2l3 *cur; + struct osmo_pcap_proto_l2 *cur; - llist_for_each_entry(cur, &l2l3_proto_list, head) { - if (ntohs(cur->l2protonum) == eh->h_proto) + llist_for_each_entry(cur, &l2_proto_list, head) { + if (cur->l2protonum == pcap_linktype) return cur; } return NULL; } -void osmo_pcap_proto_l2l3_register(struct osmo_pcap_proto_l2l3 *h) +void osmo_pcap_proto_l2_register(struct osmo_pcap_proto_l2 *h) { - llist_add(&h->head, &l2l3_proto_list); + llist_add(&h->head, &l2_proto_list); +} + + +struct osmo_pcap_proto_l3 *osmo_pcap_proto_l3_find(unsigned int l3protocol) +{ + struct osmo_pcap_proto_l3 *cur; + + llist_for_each_entry(cur, &l3_proto_list, head) { + if (ntohs(cur->l3protonum) == l3protocol) + return cur; + } + return NULL; +} + +void osmo_pcap_proto_l3_register(struct osmo_pcap_proto_l3 *h) +{ + llist_add(&h->head, &l3_proto_list); } struct osmo_pcap_proto_l4 * -osmo_pcap_proto_l4_find(const uint8_t *pkt, unsigned int l4protocol) +osmo_pcap_proto_l4_find(unsigned int l4protocol) { struct osmo_pcap_proto_l4 *cur; diff --git a/tests/osmo-pcap-test/proto.h b/tests/osmo-pcap-test/proto.h index 8cb41ed..2580058 100644 --- a/tests/osmo-pcap-test/proto.h +++ b/tests/osmo-pcap-test/proto.h @@ -10,30 +10,42 @@ unsigned int l4protonum; - int (*l4pkt_hdr_len)(const uint8_t *pkt); - int (*l4pkt_no_data)(const uint8_t *pkt); + unsigned int (*l4pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l4pkt_no_data)(const uint8_t *pkt); }; -struct osmo_pcap_proto_l2l3 { +struct osmo_pcap_proto_l3 { struct llist_head head; - - unsigned int l2protonum; - unsigned int l2hdr_len; unsigned int l3protonum; - int (*l3pkt_hdr_len)(const uint8_t *pkt); - int (*l4pkt_proto)(const uint8_t *pkt); + unsigned int (*l3pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l4pkt_proto)(const uint8_t *pkt); }; -struct osmo_pcap_proto_l2l3 *osmo_pcap_proto_l2l3_find(const uint8_t *pkt); -void osmo_pcap_proto_l2l3_register(struct osmo_pcap_proto_l2l3 *h); +struct osmo_pcap_proto_l2 { + struct llist_head head; -struct osmo_pcap_proto_l4 *osmo_pcap_proto_l4_find(const uint8_t *pkt, unsigned int l4protonum); + unsigned int l2protonum; + + unsigned int (*l2pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l3pkt_proto)(const uint8_t *pkt); +}; + + +struct osmo_pcap_proto_l2 *osmo_pcap_proto_l2_find(unsigned int pcap_linktype); +void osmo_pcap_proto_l2_register(struct osmo_pcap_proto_l2 *h); + +struct osmo_pcap_proto_l3 *osmo_pcap_proto_l3_find(unsigned int l3protonum); +void osmo_pcap_proto_l3_register(struct osmo_pcap_proto_l3 *h); + +struct osmo_pcap_proto_l4 *osmo_pcap_proto_l4_find(unsigned int l4protonum); void osmo_pcap_proto_l4_register(struct osmo_pcap_proto_l4 *h); /* Initialization of supported protocols here. */ -void l2l3_ipv4_init(void); +void l2_sll_init(void); +void l2_eth_init(void); +void l3_ipv4_init(void); void l4_tcp_init(void); void l4_udp_init(void); -- To view, visit https://gerrit.osmocom.org/3064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jun 26 18:19:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 26 Jun 2017 18:19:44 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Patch Set 1: This patch and the other in the same series have been laying in my pespin/jitterbuffer for a long time. They are not directly related to jitterbuffer but contain features needed/used by that branch, and which may be also useful to others. As I have been waiting to push the jitter buffer implementation for several reasons, let's push this so that other people can already use these parts. -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif 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 Mon Jun 26 20:00:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 20:00:48 +0000 Subject: openbsc[master]: lchan: add members for BFI In-Reply-To: References: Message-ID: Patch Set 2: Isn't this basically the link failure counter "s" ? which we also already have in lchan->s ? If there's something mandate by specs but we're missing it, pleaes include relevant spec references in the commit log. -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Jun 26 20:04:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 26 Jun 2017 20:04:32 +0000 Subject: libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Patch Set 3: Actually, I'm sorry, I think I stay with my original assessment. It makes code harder to figure out, and as Holger points out it would even be restricted in terms of what type it could be applied to. In Linux kernel we have some macros in linux/bitops.h, but then they exist for UL (unsigned long) and ULL (unsigned long long) and I don't even think they're that widely used ther eeither. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 08:20:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 08:20:19 +0000 Subject: osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 08:22:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 08:22:10 +0000 Subject: osmo-bts[master]: sysmo/tch.c: Clean up use of empty buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a 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 Tue Jun 27 08:26:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 08:26:42 +0000 Subject: osmo-bts[master]: sysmo/l1_if.c: Allow passing low quality buffers to l1if_tch_rx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3056/1/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 969: I think comment right next to the check explaining why we do it that way is really necessary: it's far from obvious and "works" either way so we got to make sure that someone else won't move it back again by accident. -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 27 09:23:08 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 09:23:08 +0000 Subject: [PATCH] osmo-ci[master]: Add value string termination check from libosmcore Message-ID: Review at https://gerrit.osmocom.org/3065 Add value string termination check from libosmcore The script by Neels Hofmeyr has actually nothing to with libosmocore itself - it's a generic build-time check used by jenkins so it should be part of this repo to avoid extra checkout of libosmocore just for this check script. Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a --- A scripts/verify_value_string_arrays_are_terminated.py 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/3065/1 diff --git a/scripts/verify_value_string_arrays_are_terminated.py b/scripts/verify_value_string_arrays_are_terminated.py new file mode 100755 index 0000000..020bb4d --- /dev/null +++ b/scripts/verify_value_string_arrays_are_terminated.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# vim: expandtab tabstop=2 shiftwidth=2 nocin + +''' +Usage: + verify_value_string_arrays_are_terminated.py PATH [PATH [...]] + +e.g. +libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +''' + +import re +import sys +import codecs + +value_string_array_re = re.compile( + r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', + re.MULTILINE | re.DOTALL) + +members = r'(\.(value|str)\s*=\s*)?' +terminator_re = re.compile('{\s*' + members + '(0|NULL)\s*,' + '\s*' + members + '(0|NULL)\s*}') +errors_found = 0 + +for f in sys.argv[1:]: + arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) + for array_def, name in arrays: + if not terminator_re.search(array_def): + print('ERROR: file contains unterminated value_string %r: %r' + % (name, f)) + errors_found += 1 + +sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/3065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 27 09:24:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 09:24:17 +0000 Subject: [PATCH] osmo-ci[master]: Add value string termination check from libosmocore In-Reply-To: References: Message-ID: Add value string termination check from libosmocore The script by Neels Hofmeyr has actually nothing to with libosmocore itself - it's a generic build-time check used by jenkins so it should be part of this repo to avoid extra checkout of libosmocore just for this check script. Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a --- A scripts/verify_value_string_arrays_are_terminated.py 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/3065/2 diff --git a/scripts/verify_value_string_arrays_are_terminated.py b/scripts/verify_value_string_arrays_are_terminated.py new file mode 100755 index 0000000..020bb4d --- /dev/null +++ b/scripts/verify_value_string_arrays_are_terminated.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# vim: expandtab tabstop=2 shiftwidth=2 nocin + +''' +Usage: + verify_value_string_arrays_are_terminated.py PATH [PATH [...]] + +e.g. +libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +''' + +import re +import sys +import codecs + +value_string_array_re = re.compile( + r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', + re.MULTILINE | re.DOTALL) + +members = r'(\.(value|str)\s*=\s*)?' +terminator_re = re.compile('{\s*' + members + '(0|NULL)\s*,' + '\s*' + members + '(0|NULL)\s*}') +errors_found = 0 + +for f in sys.argv[1:]: + arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) + for array_def, name in arrays: + if not terminator_re.search(array_def): + print('ERROR: file contains unterminated value_string %r: %r' + % (name, f)) + errors_found += 1 + +sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/3065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 27 09:25:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 09:25:11 +0000 Subject: [PATCH] osmo-ci[master]: Add value string termination check from libosmocore In-Reply-To: References: Message-ID: Add value string termination check from libosmocore The script by Neels Hofmeyr has actually nothing to do with libosmocore itself - it's a generic build-time check used by jenkins so it should be part of this repo to avoid extra checkout of libosmocore just for this script. Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a --- A scripts/verify_value_string_arrays_are_terminated.py 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/3065/3 diff --git a/scripts/verify_value_string_arrays_are_terminated.py b/scripts/verify_value_string_arrays_are_terminated.py new file mode 100755 index 0000000..020bb4d --- /dev/null +++ b/scripts/verify_value_string_arrays_are_terminated.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# vim: expandtab tabstop=2 shiftwidth=2 nocin + +''' +Usage: + verify_value_string_arrays_are_terminated.py PATH [PATH [...]] + +e.g. +libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +''' + +import re +import sys +import codecs + +value_string_array_re = re.compile( + r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', + re.MULTILINE | re.DOTALL) + +members = r'(\.(value|str)\s*=\s*)?' +terminator_re = re.compile('{\s*' + members + '(0|NULL)\s*,' + '\s*' + members + '(0|NULL)\s*}') +errors_found = 0 + +for f in sys.argv[1:]: + arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) + for array_def, name in arrays: + if not terminator_re.search(array_def): + print('ERROR: file contains unterminated value_string %r: %r' + % (name, f)) + errors_found += 1 + +sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/3065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 27 09:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 27 Jun 2017 09:30:13 +0000 Subject: openbsc[master]: lchan: add members for BFI In-Reply-To: References: Message-ID: Patch Set 2: > Isn't this basically the link failure counter "s" ? which we also > already have in lchan->s ? > > If there's something mandate by specs but we're missing it, pleaes > include relevant spec references in the commit log. I thin GSM 05.08 Chapter 5 (Radio link failure) is the right one. The implementation seems to be done in ./src/common/l1sap.c, so its in the common part. However. I think what we have her is unrelated to that. The result that is stored in the counters only affects the log output. I think this was intended to be used for lab-testing. I will ask Octasic whats their intention behind this. -- To view, visit https://gerrit.osmocom.org/2934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ed78a9dd8747736d01ccf700396d7996f9f4e5d Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Tue Jun 27 10:39:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 10:39:16 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: I've run osmo-gsm-tester manually and got exactly the same errors with current master - see http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_manual-run-all/4/#showFailuresLink So it seems like it have nothing to do with my patch or at least some other issue is masking it. -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 11:00:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 11:00:53 +0000 Subject: [ABANDON] libosmocore[master]: Add and use macros to set/get/clear/toggle bit flags In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Add and use macros to set/get/clear/toggle bit flags ...................................................................... Abandoned Harald is not convinced. -- To view, visit https://gerrit.osmocom.org/2857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie9d38b837ce84649c2975dbe8b889fe3a769885f Gerrit-PatchSet: 3 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: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jun 27 11:22:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 11:22:49 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify polling troubleshooting In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2859 to look at the new patch set (#3). Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 6 files changed, 100 insertions(+), 102 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/2859/3 diff --git a/src/bts.cpp b/src/bts.cpp index 1d27284..8bd65a5 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1150,6 +1150,15 @@ } } +static inline void try_dl_ack_recovery(struct gprs_rlcmac_dl_tbf *tbf) +{ + tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); + if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { + tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack for %s\n", tbf_name(tbf)); + } +} + void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_nack, uint32_t fn) { int8_t tfi = 0; /* must be signed */ @@ -1175,12 +1184,9 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered downlink ack " - "for %s\n", tbf_name(tbf)); - } + + try_dl_ack_recovery(tbf); + /* reset N3105 */ tbf->n3105 = 0; tbf->stop_t3191(); @@ -1263,12 +1269,9 @@ "wrong TFI=%d, ignoring!\n", tfi); return; } - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered EGPRS downlink ack " - "for %s\n", tbf_name(tbf)); - } + + try_dl_ack_recovery(tbf); + /* reset N3105 */ tbf->n3105 = 0; tbf->stop_t3191(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 48e8289..3f8784c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,50 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); + const char *chan = "UNKNOWN"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH))) + chan = "CCCH"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) + chan = "PACCH"; + + if ((state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) && (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH)))) + LOGP(DRLCMACDL, LOGL_ERROR, + "%s Attempt to schedule polling on %s (FN=%d, TS=%d) with both CCCH and PACCH flags set - FIXME!\n", + name(), chan, poll_fn, poll_ts); /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1135,11 +1169,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1236,11 +1266,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index 09e3122..5621ebe 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 24c6385..d904ca5 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -798,10 +798,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..4801753 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -137,9 +137,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2002379..1eca822 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -63,8 +63,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -151,8 +150,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -239,8 +237,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -1621,8 +1618,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1706,8 +1702,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1757,8 +1752,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1788,8 +1782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654292 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 msg block (BSN 0, CS-4): 0f 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -1845,8 +1838,7 @@ TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654348, TS=7) Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1916,8 +1908,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2012,8 +2003,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654340, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2093,8 +2083,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2247,8 +2236,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2337,8 +2325,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2795,8 +2782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW): Scheduling polling at FN 2654379 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled Ack/Nack polling on FN=2654379, TS=7 msg block (BSN 20, CS-1): 0f 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654366 block=6 data=08 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 @@ -3024,8 +3010,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3258,8 +3243,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654461 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 msg block (BSN 10, CS-1): 0f 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 @@ -3388,8 +3372,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3483,8 +3466,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3728,8 +3710,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4063,8 +4044,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4343,8 +4323,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4582,8 +4561,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4785,8 +4763,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4966,8 +4943,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5128,8 +5104,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5286,8 +5261,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5431,8 +5405,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5749,8 +5722,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5820,8 +5792,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5888,8 +5859,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5959,8 +5929,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -6268,8 +6237,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6445,8 +6413,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6906,8 +6873,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -7991,8 +7957,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on PACCH (FN=2654292, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d 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 Tue Jun 27 11:23:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 11:23:18 +0000 Subject: [ABANDON] osmo-pcu[master]: Cleanup TBF state handling In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Cleanup TBF state handling ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Icca5ce3273799e0165adcc062db8a4b71dd9fb04 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 Tue Jun 27 12:02:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 12:02:23 +0000 Subject: [PATCH] libosmocore[master]: deb: fix build by adding libosmogb doc package Message-ID: Review at https://gerrit.osmocom.org/3066 deb: fix build by adding libosmogb doc package Change-Id: I3fe45feaee4033c17e25c4c0552d54a81d9b44f5 Fixes: OS#2340 --- M debian/control A debian/libosmogb-doc.doc-base A debian/libosmogb-doc.install M debian/rules 4 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/3066/1 diff --git a/debian/control b/debian/control index 9b3761b..b19448e 100644 --- a/debian/control +++ b/debian/control @@ -162,6 +162,21 @@ The libosmogb library in particular contains a GPRS BSSGP protocol implementation. +Package: libosmogb-doc +Architecture: all +Section: doc +Depends: ${misc:Depends}, + libosmogb4, + libjs-jquery +Description: Documentation for the Osmo GPRS Gb library + This is part of the libosmocore "meta"-library. The libosmocore library + contains various utility functions that were originally developed as part of + the OpenBSC project, but which are of a more generic nature and thus useful to + (at least) other programs that are developed in the sphere of Free Software / + Open Source mobile communication. + . + This package contains the documentation for the libosmogb library. + Package: libosmogsm7 Section: libs Architecture: any diff --git a/debian/libosmogb-doc.doc-base b/debian/libosmogb-doc.doc-base new file mode 100644 index 0000000..f690318 --- /dev/null +++ b/debian/libosmogb-doc.doc-base @@ -0,0 +1,7 @@ +Document: libosmogb-doc +Title: Documentation for the libosmogb library +Section: Programming + +Format: HTML +Index: /usr/share/doc/libosmocore/gb/html/index.html +Files: /usr/share/doc/libosmocore/gb/html/*.html diff --git a/debian/libosmogb-doc.install b/debian/libosmogb-doc.install new file mode 100644 index 0000000..957c82c --- /dev/null +++ b/debian/libosmogb-doc.install @@ -0,0 +1 @@ +usr/share/doc/libosmocore/gb/ diff --git a/debian/rules b/debian/rules index e173510..2399b01 100755 --- a/debian/rules +++ b/debian/rules @@ -53,5 +53,6 @@ $(RM) -r doc/codec/ $(RM) -r doc/core/ $(RM) -r doc/gsm/ + $(RM) -r doc/gb/ $(RM) -r doc/vty/html/ $(RM) -r doc/vty/latex/ -- To view, visit https://gerrit.osmocom.org/3066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fe45feaee4033c17e25c4c0552d54a81d9b44f5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 27 13:21:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 27 Jun 2017 13:21:40 +0000 Subject: [PATCH] osmo-bts[master]: trx: avoid deacting lchan on LCHAN_REL_ACT_REACT Message-ID: Review at https://gerrit.osmocom.org/3067 trx: avoid deacting lchan on LCHAN_REL_ACT_REACT * do not deactivate lchan when called with LCHAN_REL_ACT_REACT * add fixme comment It's unclear yet if any special steps are required for osmo-bts-trx so let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1 for now. [1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file. Related: OS#1575 Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 --- M src/osmo-bts-trx/l1_if.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/3067/1 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index a7bcd2c..7b5bc81 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -151,6 +151,12 @@ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + /* FIXME: perform whatever is needed (if any) to set proper PCH/AGCH allocation according to + 3GPP TS 44.018 Table 10.5.2.11.1 using num_agch(lchan->ts->trx, "TRX L1"); function */ + return 0; + } /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 27 14:06:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 27 Jun 2017 14:06:09 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Indeed, it seems the issue came from a commit introduced yesterday in osmo-gsm-tester which was removing settsc as it is going to be removed in osmo-bts by a series of upcoming patches, but until that's included, removing the settsc config makes all trx jobs fail with a similar behaviour as we were seeing with your previously reverted patch. Summary: This patches seems good now, not adding regressions and can be merged. -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 14:19:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 27 Jun 2017 14:19:40 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Revert "osmo-bts-trx config: remove settsc" Message-ID: Review at https://gerrit.osmocom.org/3068 Revert "osmo-bts-trx config: remove settsc" According to pespin, this makes all osmo-bts-trx test runs fail. We will still figure out the details, but for the time being let's go with the known working config. This reverts commit 72ded64705a85df362f918879ddc075d1a0191fe. Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/68/3068/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index c82f367..452b920 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -20,6 +20,7 @@ band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} + settsc gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach -- To view, visit https://gerrit.osmocom.org/3068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 27 14:19:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 27 Jun 2017 14:19:40 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx config: remove settsc" In-Reply-To: References: Message-ID: Neels Hofmeyr has reverted this change. Change subject: Revert "osmo-bts-trx config: remove settsc" ...................................................................... Uploaded patch set 1. -- To view, visit https://gerrit.osmocom.org/3068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: revert Gerrit-Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 27 14:22:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 27 Jun 2017 14:22:34 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx config: remove settsc" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 14:23:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 27 Jun 2017 14:23:26 +0000 Subject: osmo-gsm-tester[master]: Revert "osmo-bts-trx config: remove settsc" In-Reply-To: References: Message-ID: Patch Set 1: Without reverting this patch, we end up in an scenario in which the 2 MS are registered but then they unregister at some point later, the tets fail with a Wait Timeout on registration. -- To view, visit https://gerrit.osmocom.org/3068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 14:23:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 27 Jun 2017 14:23:28 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Revert "osmo-bts-trx config: remove settsc" In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Revert "osmo-bts-trx config: remove settsc" ...................................................................... Revert "osmo-bts-trx config: remove settsc" According to pespin, this makes all osmo-bts-trx test runs fail. We will still figure out the details, but for the time being let's go with the known working config. This reverts commit 72ded64705a85df362f918879ddc075d1a0191fe. Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index c82f367..452b920 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -20,6 +20,7 @@ band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} + settsc gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach -- To view, visit https://gerrit.osmocom.org/3068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I57a3db0d060203ad6540c9a3cc7735e273ee0048 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jun 27 16:05:01 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 27 Jun 2017 16:05:01 +0000 Subject: [PATCH] osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2465 to look at the new patch set (#12). Introduce artifacts holding dependencies to speed up builds. Basically, osmo-build.sh holds logic to check whether the necessary artifact is available. If so it fetches artifact, unpacks it and triggers the actual build. In case the necessary artifact is not available osmo-build.sh simply builds all dependencies from source by using osmo-build-dep.sh and archives deps to the ARTIFACT_STORE afterwards. The necessary functions to determine the artifact name from remote and local repositories as well as the handling of artifact files live in osmo-artifacts.sh, which is sourced by osmo-build.sh. osmo-build.sh will be sourced by the contrib/jenkins.sh build script inside each git repository. This automatically triggers the build, so one need to source at the end of each jenkins.sh script. See jenkins-openBsc.sh [1] for more details. Artifacts will be stored as follows: $ARTIFACT_STORE/$JOB_NAME/.._... ..._..tar.gz Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. The JOB_NAME variables is injected to each jenkins job by jenkins. [1] https://github.com/blobbsen/diy-artifacts/blob/master/jenkins-openBSC.sh Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 --- A scripts/osmo-build.sh 1 file changed, 230 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/2465/12 diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh new file mode 100644 index 0000000..86ff2e3 --- /dev/null +++ b/scripts/osmo-build.sh @@ -0,0 +1,230 @@ +#!/bin/sh +# +# This script enables artifacts holding dependencies on a jenkins job level to +# speed up builds. Basically, it holds logic to check whether the necessary artifact +# is available. If so it fetches artifact, unpacks it and if cp/tar succeeded +# it triggers the actual build. +# +# Otherwise it simply builds all dependencies from source by using osmo-build-dep.sh +# and archives deps to the ARTIFACT_STORE afterwards. Revisions of locally built +# dependencies are detrmined after dependencies are built to ensure catching new +# changes in dep_n+1 meanwhile building dep_n. +# +# Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. +# The JOB_NAME variable will be injected to each jenkins' job by jenkins itself. +# When using script within a docker container one must inject jenkins' JOB_NAME variable +# to the container and ensure that ARTIFACT_STORE is mounted to the container's +# internal ARTIFACT_STORE. +# +# Artifacts will be stored as follows: +# +# $ARTIFACT_STORE/$JOB_NAME/.._... +# ..._..tar.gz +# +# Note: each matrix-build has its own directory inside ARTIFACT_STORE. +# +# In order to make use of osmo-build.sh one needs to source it, e.g. from +# ./contrib/jenkins.sh. Furthermore, jenkins should check out the git tree of +# the project to be built in the workspace root. Following functions needs to be +# declared within a build script that sources osmo-build.sh: +# +# - artifact_name() +# - build_deps() +# - build_project() +# +# This is an example for building "libosmo-netif" which depends on "libosmocore" +# and "libosmo-abis". +# +# #!/bin/sh +# +# artifact_deps() { +# # $1 will be one of folllowing functions: +# # - artifact_name_by_local_repo() +# # - artifact_name_by_remote_repo() +# # osmo-build.sh takes care about which function to use +# +# x="$($1 libosmocore)" +# x="${x}_$($1 libosmo-abis)" +# +# echo "${x}.tar.gz" +# } +# +# build_deps() { +# # all commands to build necessary dependencies +# osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false +# "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +# osmo-build-dep.sh libosmo-abis +# } +# +# build_project() { +# # Necessary commands to build the project, expecting all dependencies have +# # been built or fetched. Commands within build_project() will be executed +# # in jenkins' $WORKSPACE. +# +# autoreconf --install --force +# ./configure --enable-sanitize +# $MAKE $PARALLEL_MAKE +# $MAKE distcheck || cat-testlogs.sh +# } +# +## +# # source osmo-build.sh to fire the build +# . osmo-build.sh + +log() { + set +x + echo + echo "[INFO] $1" + echo + set -x +} + +# SOURCING SANITY +log "source sanity check to ensure that sourcing script holds necessary functions" +type artifact_deps +type build_deps +type build_project +log "check whether necessary dependency build scripts are in PATH" +type osmo-build-dep.sh +type osmo-deps.sh + +# BUILD FUNCTIONS +init_build() { + + if [ -z "$JOB_NAME" ]; then + log "[ERROR] JOB_NAME variable is not set, running in Jenkins?" + exit 1 + fi + + if [ -z "$ARTIFACT_STORE" ]; then + log "[ERROR] ARTIFACT_STORE variable is not set on this build slave" + exit 1 + fi + + base="$(pwd)" + deps="$base/deps" + inst="$deps/install" + rm -rf "$deps" || true + + # obtain the project name from the git clone found in the workspace root + project=$(git config --get --local remote.origin.url \ + | cut -d '/' -f4 | cut -d '.' -f1) + + # replace invalid char for dirs in jenkins variable + # ( '/' separates job name and matrix-axis) + job_name="$( echo "$JOB_NAME" | tr '/' '_')" + + export base deps inst project job_name + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" + export LD_LIBRARY_PATH="$inst/lib" + + log "$project build initialized" +} + +build() { + + init_build + + artifact_name="$(artifact_name)" + + if [ -f "$ARTIFACT_STORE/$job_name/$artifact_name" ]; then + fetch_artifact "$ARTIFACT_STORE/$job_name" "$artifact_name" + else + log "Compile $project dependencies from source." + mkdir -p "$deps" + rm -rf "$inst" + + build_deps + archive_artifact + fi + + log "building $project" + build_project +} + +# ARTIFACT FUNCTIONS +artifact_name() { + # in case deps is empty or does not exist we + if [ -d "$deps" ]; then + artifact_deps "branch_and_rev_of_local_repo" + cd "$base" + else + artifact_deps "branch_and_rev_of_remote_repo" + fi +} + +branch_and_rev_of_local_repo() { + cd "$deps/$1" + rev="$(git rev-parse --short HEAD)" + branch="$(git rev-parse --abbrev-ref HEAD)" + + # check whether it is a tag + if [ "$branch" = "HEAD" ]; then + tag="$(git describe --tags HEAD)" + tag="$(echo "$tag" | tr '/' '_')" + echo "$1.$tag" + else + branch="$( echo "$branch" | tr '/' '_')" + echo "$1.$branch.$rev" + fi +} + +branch_and_rev_of_remote_repo() { + if [ -z "${2+x}" ]; then branch="master"; else branch="$2"; fi + branch="$( echo "$branch" | tr '/' '_')" + rev="$(git ls-remote "https://git.osmocom.org/$1" "refs/heads/$branch")" + + # check whether branch is a tag + if [ "$rev" = "" ]; then + echo "$1.$branch" + else + rev="$(echo "$rev" | cut -c 1-7)" + echo "$1.$branch.$rev" + fi +} + +archive_artifact() { + log "Archiving artifact to artifactStore." + + cd "$base" + artifact="$(artifact_name)" + # temp_job_store is necessary to atomically move it to production. + temp_job_store="$ARTIFACT_STORE/tmp/$job_name/" + job_store="$ARTIFACT_STORE/$job_name/" + + if [ ! -f "$temp_job_store/$artifact" ]; then + mkdir -p "$job_store" "$temp_job_store" + # remove outdated artifact first to avoid temporarily + # doubling of artifact storage consumption + rm -f "$job_store/*" + tar czf "$temp_job_store/$artifact" "deps" + mv -n "$temp_job_store/$artifact" "$job_store/$artifact" + rm -rf "$temp_job_store" + + log_artifact_hash "$job_store/$artifact" + fi +} + +fetch_artifact() { + log "Fetching artifact from artifactStore." + + log_artifact_hash "$1/$2" + cp "$1/$2" . + log_artifact_hash "$2" + tar xzf "$2" + + if [ $? -gt 0 ]; then + log "Artifact could not be fetched, triggering build_deps()" + build_deps + else + log "Artifact successfully fetched, triggering $project compilation" + fi +} + +# checksum is not used by script itself, +# but might be handy in logs when debugging. +log_artifact_hash() { + log "name: $1 \n sha256: $(sha256sum "$1" | cut -d ' ' -f1)" +} + +build -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 12 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 27 16:08:03 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 27 Jun 2017 16:08:03 +0000 Subject: [PATCH] osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2465 to look at the new patch set (#13). Introduce artifacts holding dependencies to speed up builds. Basically, osmo-build.sh holds logic to check whether the necessary artifact is available. If so it fetches artifact, unpacks it and triggers the actual build. In case the necessary artifact is not available osmo-build.sh simply builds all dependencies from source by using osmo-build-dep.sh and archives deps to the ARTIFACT_STORE afterwards. The necessary functions to determine the artifact name from remote and local repositories as well as the handling of artifact files live in osmo-artifacts.sh, which is sourced by osmo-build.sh. osmo-build.sh will be sourced by the contrib/jenkins.sh build script inside each git repository. This automatically triggers the build, so one need to source at the end of each jenkins.sh script. See jenkins-openBsc.sh [1] for more details. Artifacts will be stored as follows: $ARTIFACT_STORE/$JOB_NAME/.._... ..._..tar.gz Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. The JOB_NAME variables is injected to each jenkins job by jenkins. [1] https://github.com/blobbsen/diy-artifacts/blob/master/jenkins-openBSC.sh Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 --- A scripts/osmo-build.sh 1 file changed, 230 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/2465/13 diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh new file mode 100644 index 0000000..8ca8e47 --- /dev/null +++ b/scripts/osmo-build.sh @@ -0,0 +1,230 @@ +#!/bin/sh +# +# This script enables artifacts holding dependencies on a jenkins job level to +# speed up builds. Basically, it holds logic to check whether the necessary artifact +# is available. If so it fetches artifact, unpacks it and if cp/tar succeeded +# it triggers the actual build. +# +# Otherwise it simply builds all dependencies from source by using osmo-build-dep.sh +# and archives deps to the ARTIFACT_STORE afterwards. Revisions of locally built +# dependencies are detrmined after dependencies are built to ensure catching new +# changes in dep_n+1 meanwhile building dep_n. +# +# Furthermore, ARTIFACT_STORE environment variable has to be set on all jenkins slaves. +# The JOB_NAME variable will be injected to each jenkins' job by jenkins itself. +# When using script within a docker container one must inject jenkins' JOB_NAME variable +# to the container and ensure that ARTIFACT_STORE is mounted to the container's +# internal ARTIFACT_STORE. +# +# Artifacts will be stored as follows: +# +# $ARTIFACT_STORE/$JOB_NAME/.._... +# ..._..tar.gz +# +# Note: each matrix-build has its own directory inside ARTIFACT_STORE. +# +# In order to make use of osmo-build.sh one needs to source it, e.g. from +# ./contrib/jenkins.sh. Furthermore, jenkins should check out the git tree of +# the project to be built in the workspace root. Following functions needs to be +# declared within a build script that sources osmo-build.sh: +# +# - artifact_name() +# - build_deps() +# - build_project() +# +# This is an example for building "libosmo-netif" which depends on "libosmocore" +# and "libosmo-abis". +# +# #!/bin/sh +# +# artifact_deps() { +# # $1 will be one of folllowing functions: +# # - artifact_name_by_local_repo() +# # - artifact_name_by_remote_repo() +# # osmo-build.sh takes care about which function to use +# +# x="$($1 libosmocore)" +# x="${x}_$($1 libosmo-abis)" +# +# echo "${x}.tar.gz" +# } +# +# build_deps() { +# # all commands to build necessary dependencies +# osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false +# "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +# osmo-build-dep.sh libosmo-abis +# } +# +# build_project() { +# # Necessary commands to build the project, expecting all dependencies have +# # been built or fetched. Commands within build_project() will be executed +# # in jenkins' $WORKSPACE. +# +# autoreconf --install --force +# ./configure --enable-sanitize +# $MAKE $PARALLEL_MAKE +# $MAKE distcheck || cat-testlogs.sh +# } +# +## +# # source osmo-build.sh to fire the build +# . osmo-build.sh + +log() { + set +x + echo + echo "[INFO] $1" + echo + set -x +} + +# SOURCING SANITY +log "source sanity check to ensure that sourcing script holds necessary functions" +type artifact_deps +type build_deps +type build_project +log "check whether necessary dependency build scripts are in PATH" +type osmo-build-dep.sh +type osmo-deps.sh + +# BUILD FUNCTIONS +init_build() { + + if [ -z "$JOB_NAME" ]; then + log "[ERROR] JOB_NAME variable is not set, running in Jenkins?" + exit 1 + fi + + if [ -z "$ARTIFACT_STORE" ]; then + log "[ERROR] ARTIFACT_STORE variable is not set on this build slave" + exit 1 + fi + + base="$(pwd)" + deps="$base/deps" + inst="$deps/install" + rm -rf "$deps" || true + + # obtain the project name from the git clone found in the workspace root + project=$(git config --get --local remote.origin.url \ + | cut -d '/' -f4 | cut -d '.' -f1) + + # replace invalid char for dirs in $JOB_NAME (jenkins variable) + # ( '/' separates job name and matrix-axis) + job_name="$( echo "$JOB_NAME" | tr '/' '_')" + + export base deps inst project job_name + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" + export LD_LIBRARY_PATH="$inst/lib" + + log "$project build initialized" +} + +build() { + + init_build + + artifact_name="$(artifact_name)" + + if [ -f "$ARTIFACT_STORE/$job_name/$artifact_name" ]; then + fetch_artifact "$ARTIFACT_STORE/$job_name" "$artifact_name" + else + log "Compile $project dependencies from source." + mkdir -p "$deps" + rm -rf "$inst" + + build_deps + archive_artifact + fi + + log "building $project" + build_project +} + +# ARTIFACT FUNCTIONS +artifact_name() { + # in case deps is empty or does not exist we + if [ -d "$deps" ]; then + artifact_deps "branch_and_rev_of_local_repo" + cd "$base" + else + artifact_deps "branch_and_rev_of_remote_repo" + fi +} + +branch_and_rev_of_local_repo() { + cd "$deps/$1" + rev="$(git rev-parse --short HEAD)" + branch="$(git rev-parse --abbrev-ref HEAD)" + + # check whether it is a tag + if [ "$branch" = "HEAD" ]; then + tag="$(git describe --tags HEAD)" + tag="$(echo "$tag" | tr '/' '_')" + echo "$1.$tag" + else + branch="$( echo "$branch" | tr '/' '_')" + echo "$1.$branch.$rev" + fi +} + +branch_and_rev_of_remote_repo() { + if [ -z "${2+x}" ]; then branch="master"; else branch="$2"; fi + branch="$( echo "$branch" | tr '/' '_')" + rev="$(git ls-remote "https://git.osmocom.org/$1" "refs/heads/$branch")" + + # check whether branch is a tag + if [ "$rev" = "" ]; then + echo "$1.$branch" + else + rev="$(echo "$rev" | cut -c 1-7)" + echo "$1.$branch.$rev" + fi +} + +archive_artifact() { + log "Archiving artifact to artifactStore." + + cd "$base" + artifact="$(artifact_name)" + # temp_job_store is necessary to atomically move it to production. + temp_job_store="$ARTIFACT_STORE/tmp/$job_name/" + job_store="$ARTIFACT_STORE/$job_name/" + + if [ ! -f "$temp_job_store/$artifact" ]; then + mkdir -p "$job_store" "$temp_job_store" + # remove outdated artifact first to avoid temporarily + # doubling of artifact storage consumption + rm -f "$job_store/*" + tar czf "$temp_job_store/$artifact" "deps" + mv -n "$temp_job_store/$artifact" "$job_store/$artifact" + rm -rf "$temp_job_store" + + log_artifact_hash "$job_store/$artifact" + fi +} + +fetch_artifact() { + log "Fetching artifact from artifactStore." + + log_artifact_hash "$1/$2" + cp "$1/$2" . + log_artifact_hash "$2" + tar xzf "$2" + + if [ $? -gt 0 ]; then + log "Artifact could not be fetched, triggering build_deps()" + build_deps + else + log "Artifact successfully fetched, triggering $project compilation" + fi +} + +# checksum is not used by script itself, +# but might be handy in logs when debugging. +log_artifact_hash() { + log "name: $1 \n sha256: $(sha256sum "$1" | cut -d ' ' -f1)" +} + +build -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 13 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 27 16:13:30 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Tue, 27 Jun 2017 16:13:30 +0000 Subject: osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds. In-Reply-To: References: Message-ID: Patch Set 13: Now, it's a shell and not a bash script as suggested by Max. All comments (PS11) should be addressed. Furthermore osmo-build.sh checks whether all functions in contrib/jenkins.sh and build scripts like osmo-deps.sh and osmo-build-dep.sh are available and fails elsewise (fail fast). Thanks for all the reviews! -- To view, visit https://gerrit.osmocom.org/2465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484 Gerrit-PatchSet: 13 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Andr? Boddenberg Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 16:31:39 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 27 Jun 2017 16:31:39 +0000 Subject: osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 16:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 27 Jun 2017 16:39:15 +0000 Subject: osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3062/1//COMMIT_MSG Commit Message: Line 18: Fixes: Bug #2341 "osmo-trx-m is broken" would be good to use the OS#2341 notation: Fixes: OS#2341 [...] ...to ensure we can evaluate the relation automatically. See point 4 in http://lists.osmocom.org/pipermail/openbsc/2017-March/010448.html (pending: include this in the wiki) -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 27 18:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 27 Jun 2017 18:37:12 +0000 Subject: [PATCH] osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup In-Reply-To: References: Message-ID: Hello Max, Alexander Chemeris, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3062 to look at the new patch set (#2). uhd: Always specify samples-per-symbol for device lookup Fix MCBTS device setup where the map access was failing on the wrong assumption that all devices support 1-SPS TX-RX operation. Some devices and/or configurations such as LIMESDR and MCBTS only support running at 4-SPS. Even though certain settings (e.g. number of physical channels or the FPGA clocking rate) are not dependent on the SPS value, we still need to specify because we use SPS as a parameter for device classification. Fixes: OS#2341 Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/3062/2 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 833f02f..a766ddc 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -576,7 +576,7 @@ chans = 1; } - if (chans > dev_param_map.at(dev_key(dev_type, 1, 1)).channels) + if (chans > dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)).channels) throw std::invalid_argument("Device does not support number of requested channels"); std::string subdev_string; @@ -1069,7 +1069,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { + if (rf_spread > dev_param_map.at(dev_key(B210, tx_sps, rx_sps)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 27 18:38:39 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 27 Jun 2017 18:38:39 +0000 Subject: osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 27 18:38:41 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 27 Jun 2017 18:38:41 +0000 Subject: [MERGED] osmo-trx[master]: uhd: Always specify samples-per-symbol for device lookup In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: uhd: Always specify samples-per-symbol for device lookup ...................................................................... uhd: Always specify samples-per-symbol for device lookup Fix MCBTS device setup where the map access was failing on the wrong assumption that all devices support 1-SPS TX-RX operation. Some devices and/or configurations such as LIMESDR and MCBTS only support running at 4-SPS. Even though certain settings (e.g. number of physical channels or the FPGA clocking rate) are not dependent on the SPS value, we still need to specify because we use SPS as a parameter for device classification. Fixes: OS#2341 Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Signed-off-by: Tom Tsou --- M Transceiver52M/UHDDevice.cpp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 833f02f..a766ddc 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -576,7 +576,7 @@ chans = 1; } - if (chans > dev_param_map.at(dev_key(dev_type, 1, 1)).channels) + if (chans > dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)).channels) throw std::invalid_argument("Device does not support number of requested channels"); std::string subdev_string; @@ -1069,7 +1069,7 @@ /* Find center frequency between channels */ rf_spread = fabs(freqs[!chan] - freq); - if (rf_spread > dev_param_map.at(dev_key(B210, 1, 1)).mcr) { + if (rf_spread > dev_param_map.at(dev_key(B210, tx_sps, rx_sps)).mcr) { LOG(ALERT) << rf_spread << "Hz tuning spread not supported\n"; return treq; } -- To view, visit https://gerrit.osmocom.org/3062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56e939285d585cc38efa6c329e30e3acebb734eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Tom Tsou Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jun 28 07:56:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 07:56:50 +0000 Subject: [PATCH] osmo-bts[master]: RSL: receive and send multiple SI2q messages 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/3047 to look at the new patch set (#4). RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way That's resubmission of 340cff51f49f6e798cb5fb6d1b9febdd09902906 and 186c6bac0758b6f94aa101e151664b0dea5d8975 with memory initialization order change to fix the issue detected by osmo-gsm-tester - see OS#2338. Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Related: OS#1660, OS#2338 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 41 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/3047/4 diff --git a/src/common/rsl.c b/src/common/rsl.c index eab9379..fd8bf13 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -307,21 +307,34 @@ } if (SYSINFO_TYPE_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater with index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > SI2Q_MAX_NUM) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater with impossible parameters: index %u, count %u" + "should be <= %u\n", bts->si2q_index, bts->si2q_count, SI2Q_MAX_NUM); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + 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 if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 28 07:56:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 07:56:54 +0000 Subject: osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 07:59:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 07:59:31 +0000 Subject: osmo-bts[master]: trx: avoid deacting lchan on LCHAN_REL_ACT_REACT In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 08:00:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 08:00:03 +0000 Subject: libosmocore[master]: deb: fix build by adding libosmogb doc package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3fe45feaee4033c17e25c4c0552d54a81d9b44f5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 08:00:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 08:00:05 +0000 Subject: [MERGED] libosmocore[master]: deb: fix build by adding libosmogb doc package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: deb: fix build by adding libosmogb doc package ...................................................................... deb: fix build by adding libosmogb doc package Change-Id: I3fe45feaee4033c17e25c4c0552d54a81d9b44f5 Fixes: OS#2340 --- M debian/control A debian/libosmogb-doc.doc-base A debian/libosmogb-doc.install M debian/rules 4 files changed, 24 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index 9b3761b..b19448e 100644 --- a/debian/control +++ b/debian/control @@ -162,6 +162,21 @@ The libosmogb library in particular contains a GPRS BSSGP protocol implementation. +Package: libosmogb-doc +Architecture: all +Section: doc +Depends: ${misc:Depends}, + libosmogb4, + libjs-jquery +Description: Documentation for the Osmo GPRS Gb library + This is part of the libosmocore "meta"-library. The libosmocore library + contains various utility functions that were originally developed as part of + the OpenBSC project, but which are of a more generic nature and thus useful to + (at least) other programs that are developed in the sphere of Free Software / + Open Source mobile communication. + . + This package contains the documentation for the libosmogb library. + Package: libosmogsm7 Section: libs Architecture: any diff --git a/debian/libosmogb-doc.doc-base b/debian/libosmogb-doc.doc-base new file mode 100644 index 0000000..f690318 --- /dev/null +++ b/debian/libosmogb-doc.doc-base @@ -0,0 +1,7 @@ +Document: libosmogb-doc +Title: Documentation for the libosmogb library +Section: Programming + +Format: HTML +Index: /usr/share/doc/libosmocore/gb/html/index.html +Files: /usr/share/doc/libosmocore/gb/html/*.html diff --git a/debian/libosmogb-doc.install b/debian/libosmogb-doc.install new file mode 100644 index 0000000..957c82c --- /dev/null +++ b/debian/libosmogb-doc.install @@ -0,0 +1 @@ +usr/share/doc/libosmocore/gb/ diff --git a/debian/rules b/debian/rules index e173510..2399b01 100755 --- a/debian/rules +++ b/debian/rules @@ -53,5 +53,6 @@ $(RM) -r doc/codec/ $(RM) -r doc/core/ $(RM) -r doc/gsm/ + $(RM) -r doc/gb/ $(RM) -r doc/vty/html/ $(RM) -r doc/vty/latex/ -- To view, visit https://gerrit.osmocom.org/3066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3fe45feaee4033c17e25c4c0552d54a81d9b44f5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 28 08:03:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 28 Jun 2017 08:03:29 +0000 Subject: [MERGED] osmo-bts[master]: RSL: receive and send multiple SI2q messages In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: RSL: receive and send multiple SI2q messages ...................................................................... RSL: receive and send multiple SI2q messages * change BCCH Info handler to explicitly support multiple SI2quater messages sent from BSC * change SI scheduler to send SI2q in round-robin way That's resubmission of 340cff51f49f6e798cb5fb6d1b9febdd09902906 and 186c6bac0758b6f94aa101e151664b0dea5d8975 with memory initialization order change to fix the issue detected by osmo-gsm-tester - see OS#2338. Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Related: OS#1660, OS#2338 --- M src/common/rsl.c M src/common/sysinfo.c 2 files changed, 41 insertions(+), 14 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 eab9379..fd8bf13 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -264,7 +264,7 @@ { struct gsm_bts *bts = trx->bts; struct tlv_parsed tp; - uint8_t rsl_si, si2q_index, si2q_count; + uint8_t rsl_si, count; enum osmo_sysinfo_type osmo_si; struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; @@ -307,21 +307,34 @@ } if (SYSINFO_TYPE_2quater == osmo_si) { - si2q = (struct gsm48_system_information_type_2quater *) - bts->si_buf[SYSINFO_TYPE_2quater]; + si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; - bv.data_len = 20; + bv.data_len = GSM_MACBLOCK_LEN; bv.cur_bit = 3; - si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); - si2q_count = (uint8_t) bitvec_get_uint(&bv, 4); - if (si2q_index || si2q_count) { - LOGP(DRSL, LOGL_ERROR, - " Rx RSL SI2quater witn unsupported " - "index %u, count %u\n", - si2q_index, si2q_count); - return rsl_tx_error_report(trx, - RSL_ERR_IE_CONTENT); + bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4); + + count = (uint8_t) bitvec_get_uint(&bv, 4); + if (bts->si2q_count && bts->si2q_count != count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n", + bts->si2q_count, count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); } + + bts->si2q_count = count; + if (bts->si2q_index > bts->si2q_count) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater with index %u > count %u\n", + bts->si2q_index, bts->si2q_count); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + if (bts->si2q_index > SI2Q_MAX_NUM || bts->si2q_count > SI2Q_MAX_NUM) { + LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater with impossible parameters: index %u, count %u" + "should be <= %u\n", bts->si2q_index, bts->si2q_count, SI2Q_MAX_NUM); + return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT); + } + + 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 if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a53627..9276c7b 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include #include +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); -- To view, visit https://gerrit.osmocom.org/3047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jun 28 08:03:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 08:03:55 +0000 Subject: osmo-pcu[master]: Simplify polling troubleshooting In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 4 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 Jun 28 10:24:48 2017 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?Andr=C3=A9_Boddenberg?=) Date: Wed, 28 Jun 2017 10:24:48 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/2691/3/scripts/osmo-build-dep.sh File scripts/osmo-build-dep.sh: PS3, Line 60: # Make the dependencies available through symlinks in $deps ($PWD/..). : STOW_DIR="$inst/stow" stow --restow $project Currently we are working on a script[1] to reuse dependency artifacts to speed up builds. How could we make the dependencies available through symlinks, in case we just fetched the dependencies as tar and simple untar them (tar basically holds the deps folder). Right now that's possible by simply setting LD_LIBRARY_PATH and PKG_CONFIG_PATH, but I didn't figure out how to "restow" such dependencies deployed by untaring "artifacts.tar.gz" [1] https://gerrit.osmocom.org/#/c/2465/ -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 28 11:32:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 28 Jun 2017 11:32:42 +0000 Subject: [PATCH] osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT 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/3067 to look at the new patch set (#2). trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT * do not deactivate lchan when called with LCHAN_REL_ACT_REACT * add fixme comment It's unclear yet if any special steps are required for osmo-bts-trx so let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1 for now. [1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file. Related: OS#1575 Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 --- M src/osmo-bts-trx/l1_if.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/3067/2 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index a7bcd2c..7b5bc81 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -151,6 +151,12 @@ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + /* FIXME: perform whatever is needed (if any) to set proper PCH/AGCH allocation according to + 3GPP TS 44.018 Table 10.5.2.11.1 using num_agch(lchan->ts->trx, "TRX L1"); function */ + return 0; + } /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 12:36:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 28 Jun 2017 12:36:06 +0000 Subject: [PATCH] libosmocore[master]: Handle BVC-RESET-ACK Message-ID: Review at https://gerrit.osmocom.org/3069 Handle BVC-RESET-ACK That's necessary for SGSN to properly handle BSS response to reset procedure initiated by SGSN (foe example via 'bssgp bvc nsei 101 bvci 0 reset' command). According to 3GPP TS 08.18 ?8.4 "after performing the BVC Reset procedure all affected BVCs are assumed to be unblocked at the SGSN" so there's no need in any special handling. Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Related: OS#1638 --- M src/gb/gprs_bssgp.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/3069/1 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 518198f..8daf39f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -963,6 +963,9 @@ } rc = bssgp_rx_bvc_unblock(msg, tp); break; + case BSSGP_PDUT_BVC_RESET_ACK: + LOGP(DBSSGP, LOGL_ERROR, "BSSGP BVCI=%u Rx BVC-RESET-ACK\n", bvci); + break; case BSSGP_PDUT_BVC_RESET: /* BSS tells us that BVC init is required */ if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI) || -- To view, visit https://gerrit.osmocom.org/3069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 28 12:38:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 28 Jun 2017 12:38:19 +0000 Subject: [PATCH] libosmocore[master]: BSSGP: handle BVC-RESET-ACK In-Reply-To: References: Message-ID: BSSGP: handle BVC-RESET-ACK That's necessary for SGSN to properly handle BSS response to reset procedure initiated by SGSN (foe example via 'bssgp bvc nsei 101 bvci 0 reset' command). According to 3GPP TS 08.18 ?8.4 "after performing the BVC Reset procedure all affected BVCs are assumed to be unblocked at the SGSN" so there's no need in any special handling. Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Related: OS#1638 --- M src/gb/gprs_bssgp.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/3069/2 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 518198f..8daf39f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -963,6 +963,9 @@ } rc = bssgp_rx_bvc_unblock(msg, tp); break; + case BSSGP_PDUT_BVC_RESET_ACK: + LOGP(DBSSGP, LOGL_ERROR, "BSSGP BVCI=%u Rx BVC-RESET-ACK\n", bvci); + break; case BSSGP_PDUT_BVC_RESET: /* BSS tells us that BVC init is required */ if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI) || -- To view, visit https://gerrit.osmocom.org/3069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 12:45:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 28 Jun 2017 12:45:32 +0000 Subject: [PATCH] libosmocore[master]: BSSGP: handle BVC-RESET-ACK In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3069 to look at the new patch set (#3). BSSGP: handle BVC-RESET-ACK That's necessary for SGSN to properly handle BSS response to reset procedure initiated by SGSN (foe example via 'bssgp bvc nsei 101 bvci 0 reset' command). According to 3GPP TS 48.018 ?8.4 "after performing the BVC Reset procedure all affected BVCs are assumed to be unblocked at the SGSN" so there's no need in any special handling. Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Related: OS#1638 --- M src/gb/gprs_bssgp.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/3069/3 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 518198f..8daf39f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -963,6 +963,9 @@ } rc = bssgp_rx_bvc_unblock(msg, tp); break; + case BSSGP_PDUT_BVC_RESET_ACK: + LOGP(DBSSGP, LOGL_ERROR, "BSSGP BVCI=%u Rx BVC-RESET-ACK\n", bvci); + break; case BSSGP_PDUT_BVC_RESET: /* BSS tells us that BVC init is required */ if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI) || -- To view, visit https://gerrit.osmocom.org/3069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:17:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:17:39 +0000 Subject: libosmocore[master]: BSSGP: handle BVC-RESET-ACK In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Gerrit-PatchSet: 3 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 Wed Jun 28 13:17:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:17:41 +0000 Subject: [MERGED] libosmocore[master]: BSSGP: handle BVC-RESET-ACK In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSGP: handle BVC-RESET-ACK ...................................................................... BSSGP: handle BVC-RESET-ACK That's necessary for SGSN to properly handle BSS response to reset procedure initiated by SGSN (foe example via 'bssgp bvc nsei 101 bvci 0 reset' command). According to 3GPP TS 48.018 ?8.4 "after performing the BVC Reset procedure all affected BVCs are assumed to be unblocked at the SGSN" so there's no need in any special handling. Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b Related: OS#1638 --- M src/gb/gprs_bssgp.c 1 file changed, 3 insertions(+), 0 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 518198f..8daf39f 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -963,6 +963,9 @@ } rc = bssgp_rx_bvc_unblock(msg, tp); break; + case BSSGP_PDUT_BVC_RESET_ACK: + LOGP(DBSSGP, LOGL_ERROR, "BSSGP BVCI=%u Rx BVC-RESET-ACK\n", bvci); + break; case BSSGP_PDUT_BVC_RESET: /* BSS tells us that BVC init is required */ if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI) || -- To view, visit https://gerrit.osmocom.org/3069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90dfbd0195a8403406429ccc746299d072445f7b 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 Wed Jun 28 13:19:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:19:14 +0000 Subject: osmo-ci[master]: Add value string termination check from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:19:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:19:30 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Allow different l2 pkts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif 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 Wed Jun 28 13:19:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:19:46 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea 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: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:20:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:20:43 +0000 Subject: osmo-bts[master]: octphy: initalize nmsg only when needed In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 28 13:20:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:20:46 +0000 Subject: osmo-bts[master]: octphy: initalize l1msg and only when needed In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 28 13:20:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:20:56 +0000 Subject: osmo-bts[master]: octphy: remove log output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 28 13:21:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:21:35 +0000 Subject: osmo-bts[master]: octphy: do not send empty frames to phy In-Reply-To: References: Message-ID: Patch Set 1: I'd be interested why. Is the PHY going to transmit such an empty message anyway in this case? -- To view, visit https://gerrit.osmocom.org/3060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Jun 28 13:21:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:21:51 +0000 Subject: [MERGED] osmo-bts[master]: octphy: remove log output In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: remove log output ...................................................................... octphy: remove log output When handle_ph_data_ind() runs BER and RSSI is logged. Remove this log output by removing the call to dump_meas_res (Patch by Octasic Inc.) Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 0efc4bb..8b31630 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1058,8 +1058,6 @@ data_ind->Data.ulDataLength), data_ind->Data.ulDataLength); - dump_meas_res(LOGL_DEBUG, &data_ind->MeasurementInfo); - /* check for TCH */ if (sapi == cOCTVC1_GSM_SAPI_ENUM_TCHF || sapi == cOCTVC1_GSM_SAPI_ENUM_TCHH) { -- To view, visit https://gerrit.osmocom.org/3059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:21:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:21:52 +0000 Subject: [MERGED] osmo-bts[master]: octphy: initalize l1msg and only when needed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: initalize l1msg and only when needed ...................................................................... octphy: initalize l1msg and only when needed l1msg is initalized when the variable is declared. This means the allocation always runs right on the beginning. Even when the buffer is not needed at all. do a prober l1msg initalization only when needed and check the return code. (Patch by Octasic Inc.) Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 85b5a86..9b348a9 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -451,7 +451,7 @@ { struct phy_instance *pinst = trx_phy_instance(trx); struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; - struct msgb *l1msg = l1p_msgb_alloc(); + struct msgb *l1msg = NULL; uint32_t u32Fn; uint8_t u8Tn, subCh, sapi = 0; uint8_t chan_nr, link_id; @@ -510,6 +510,14 @@ if (len) { /* create new PHY primitive in l1msg, copying payload */ + + l1msg = l1p_msgb_alloc(); + if (!l1msg) { + LOGP(DL1C, LOGL_FATAL, "L1SAP PH-DATA.req msg alloc failed\n"); + rc = -ENOMEM; + goto done; + } + tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *data_req = (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *) msgb_put(l1msg, sizeof(*data_req)); -- To view, visit https://gerrit.osmocom.org/3057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:21:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:21:52 +0000 Subject: [MERGED] osmo-bts[master]: octphy: initalize nmsg only when needed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: initalize nmsg only when needed ...................................................................... octphy: initalize nmsg only when needed nmsg is initalized every time the function runs, even when it is not needed. Move the initalization into the if (msg) body so that nmsg is only initalized when we really need it. (Patch by Octasic Inc.) Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0 --- M src/osmo-bts-octphy/l1_if.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 9b348a9..0efc4bb 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -584,13 +584,14 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); - /* create new message */ - nmsg = l1p_msgb_alloc(); - if (!nmsg) - return -ENOMEM; - /* create new message and fill data */ if (msg) { + nmsg = l1p_msgb_alloc(); + if (!nmsg) { + LOGP(DL1C, LOGL_FATAL, "L1SAP PH-TCH.req msg alloc failed\n"); + return -ENOMEM; + } + msgb_pull(msg, sizeof(*l1sap)); tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *data_req = (tOCTVC1_GSM_MSG_TRX_REQUEST_LOGICAL_CHANNEL_DATA_CMD *) -- To view, visit https://gerrit.osmocom.org/3058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:21:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:21:52 +0000 Subject: [MERGED] osmo-bts[master]: octphy: improve log output In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: improve log output ...................................................................... octphy: improve log output Printing the RX payload size is strictly informative, so the loglevel LOGL_ERROR is wrong. This commit changes it to LOGL_DEBUG (Patch by Octasic Inc.) Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897 --- M src/osmo-bts-octphy/l1_tch.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 7393e73..5693313 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -194,7 +194,7 @@ &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; if (data_ind->Data.ulDataLength < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", + LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/2932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:22:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:22:30 +0000 Subject: osmo-bts[master]: measurement: initalize lchan properly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02edc4724f3d272905bee13384628aca18ea9781 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 28 13:24:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:24:03 +0000 Subject: osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3037/2/src/osmo-bts-trx/scheduler_trx.c File src/osmo-bts-trx/scheduler_trx.c: Line 1473: if (elapsed_fn >= 135774) > where does this number comes from? I don't know, I just moved the code around. The original code did not contain any rationale for that magic number. -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 28 13:24:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 13:24:23 +0000 Subject: osmo-bts[master]: Add loopback support for PDTCH In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Jun 28 15:44:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 28 Jun 2017 15:44:58 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp.c: Add osmo_rtp_drop_frame API Message-ID: Review at https://gerrit.osmocom.org/3070 osmo_ortp.c: Add osmo_rtp_drop_frame API Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 --- M src/trau/osmo_ortp.c 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/70/3070/1 diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index b2ee040..05817aa 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -436,6 +436,27 @@ return osmo_rtp_socket_fdreg(rs); } +/*! \brief Increment seq and timestamp on a RTP socket without sending any packet + * \param[in] rs OsmoRTP socket + * \param[in] duration duration in number of RTP clock ticks + * + * Useful if willing to update the RTP internal clock at a given time but no + * audio content is available. From receiver point of view, it will look like + * a packet was lost somewhere in the path. + * + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_drop_frame(struct osmo_rtp_socket *rs, unsigned int duration) +{ + if (rs->flags & OSMO_RTP_F_DISABLED) + return 0; + + uint16_t next_seq = rtp_session_get_seq_number(rs->sess) + 1; + rtp_session_set_seq_number(rs->sess, next_seq); + rs->tx_timestamp += duration; + return 0; +} + /*! \brief Send one RTP frame via a RTP socket * \param[in] rs OsmoRTP socket * \param[in] payload pointer to buffer with RTP payload data -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jun 28 15:46:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 28 Jun 2017 15:46:40 +0000 Subject: [PATCH] osmo-bts[master]: sysmo/l1_if.c: Allow passing low quality buffers to upper la... In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3056 to look at the new patch set (#2). sysmo/l1_if.c: Allow passing low quality buffers to upper layers We want to always call l1if_tch_rx in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Next patch in the series solves this issue. Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/l1_if.h M src/osmo-bts-sysmo/tch.c 3 files changed, 21 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/3056/2 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f564836..776ec01 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -937,6 +937,7 @@ struct osmo_phsap_prim *l1sap; uint32_t fn; int rc = 0; + bool low_quality = data_ind->measParam.fLinkQuality < btsb->min_qual_norm; chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); @@ -951,12 +952,6 @@ process_meas_res(trx, chan_nr, fn, data_ind); - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, @@ -968,11 +963,20 @@ if (data_ind->sapi == GsmL1_Sapi_TchF || data_ind->sapi == GsmL1_Sapi_TchH) { /* TCH speech frame handling */ - rc = l1if_tch_rx(trx, chan_nr, l1p_msg); + rc = l1if_tch_rx(trx, chan_nr, l1p_msg, low_quality); msgb_free(l1p_msg); return rc; } + /* Discard frames with bad quality payload only after making sure we + * signal upper layers for TCH frames, because it expects to always be + * notified even if the content of the frame is not correct, otherwise + * it losses events and the RTP clock drifts. */ + if (low_quality && data_ind->msgUnitParam.u8Size != 0) { + msgb_free(l1p_msg); + return 0; + } + /* fill L1SAP header */ sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size); l1sap = msgb_l1sap_prim(sap_msg); diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index 033e7f5..6dd2d60 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -128,7 +128,7 @@ int l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn, bool use_cache, bool marker); -int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); +int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a12b1a7..b8b53df 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -502,7 +502,7 @@ } /*! \brief receive a traffic L1 primitive for a given lchan */ -int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) +int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality) { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; @@ -513,10 +513,14 @@ if (is_recv_only(lchan->abis_ip.speech_mode)) return -EAGAIN; - if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + if (low_quality || data_ind->msgUnitParam.u8Size < 1) { + LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size %u low_quality %d\n", + chan_nr, data_ind->msgUnitParam.u8Size, low_quality); + + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1C-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 28 15:46:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 28 Jun 2017 15:46:41 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload Message-ID: Review at https://gerrit.osmocom.org/3071 l1sap.c: Avoid sending RTP frame with empty payload Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc --- M src/common/l1sap.c 1 file changed, 23 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3071/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1fb6134..3d53795 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1011,22 +1011,31 @@ msgb_pull(msg, sizeof(*l1sap)); - /* hand msg to RTP code for transmission */ - if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); - - /* if loopback is enabled, also queue received RTP data */ - if (lchan->loopback) { - /* make sure the queue doesn't get too long */ - queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); - /* add new frame to queue */ - msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ - return 1; + /* Low level layers always call us when TCH content is expected to be + * available, even if the content is not available due to decoding + * issues. Content not available is expected as empty payload. */ + if(msg->len) { + /* hand msg to RTP code for transmission */ + if (lchan->abis_ip.rtp_socket) + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); + /* if loopback is enabled, also queue received RTP data */ + if (lchan->loopback) { + /* make sure the queue doesn't get too long */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ + msgb_enqueue(&lchan->dl_tch_queue, msg); + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; + } + /* Only clear the marker bit once we have sent a RTP packet with it */ + lchan->rtp_tx_marker = false; + } else { + DEBUGP(DL1P, "Dropping RTP frame with lost payload\n"); + if (lchan->abis_ip.rtp_socket) + osmo_rtp_drop_frame(lchan->abis_ip.rtp_socket, fn_ms_adj(fn, lchan)); } - lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From admin at opensuse.org Fri Jun 23 19:53:44 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:53:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <59541bc0d4ac3_1d6b5a4f88205958@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: [ 344s] [ 344s] lamb04 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:12 UTC 2017. [ 344s] [ 344s] ### VM INTERACTION START ### [ 348s] [ 331.394824] reboot: Power down [ 348s] ### VM INTERACTION END ### [ 348s] build: extracting built packages... [ 348s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.dsc [ 348s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 348s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 348s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 348s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59541bc326001_1d6b5a4f8820615d@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: [ 224s] [ 224s] lamb24 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:22 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 228s] [ 214.746288] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] build: extracting built packages... [ 228s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 228s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.dsc [ 228s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 228s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 228s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <59541bc37e2cb_1d6b5a4f882062ae@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: [ 292s] lamb66 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:17 UTC 2017. [ 292s] [ 292s] ### VM INTERACTION START ### [ 293s] Powering off. [ 293s] [ 279.409997] reboot: Power down [ 293s] ### VM INTERACTION END ### [ 293s] build: extracting built packages... [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.dsc [ 293s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 293s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 293s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 293s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:53:44 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:53:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <59541bc12c67d_1d6b5a4f88206051@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: [ 255s] [ 255s] lamb15 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:39 UTC 2017. [ 255s] [ 255s] ### VM INTERACTION START ### [ 258s] [ 243.854006] reboot: Power down [ 258s] ### VM INTERACTION END ### [ 258s] build: extracting built packages... [ 258s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 258s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 258s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.dsc [ 258s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 258s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59541bc492872_1d6b5a4f882063e7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 283s] [ 283s] lamb53 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:11 UTC 2017. [ 283s] [ 283s] ### VM INTERACTION START ### [ 287s] [ 272.704659] reboot: Power down [ 287s] ### VM INTERACTION END ### [ 287s] build: extracting built packages... [ 287s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.dsc [ 287s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 287s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 287s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:54:35 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:54:35 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59541bc636f35_1d6b5a4f882064c1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 315s] [ 315s] lamb69 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:40 UTC 2017. [ 315s] [ 315s] ### VM INTERACTION START ### [ 318s] [ 299.657850] reboot: Power down [ 318s] ### VM INTERACTION END ### [ 319s] build: extracting built packages... [ 319s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 319s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 319s] DEBS/libosmocore_0.9.6.20170628.dsc [ 319s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 319s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:55:10 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:55:10 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <59541bc8c40ca_1d6b5a4f882065d6@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: [ 207s] [ 207s] build76 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:53 UTC 2017. [ 207s] [ 207s] ### VM INTERACTION START ### [ 210s] [ 199.501318] reboot: Power down [ 210s] ### VM INTERACTION END ### [ 210s] build: extracting built packages... [ 210s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.dsc [ 210s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 210s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 210s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 210s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:55:27 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:55:27 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59541bcb79b8e_1d6b5a4f88206681@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: [ 211s] [ 211s] build79 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:58 UTC 2017. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 202.569182] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] build: extracting built packages... [ 215s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.dsc [ 215s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 215s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 215s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 215s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:56:01 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:56:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/i586 In-Reply-To: References: Message-ID: <59541bccc4858_1d6b5a4f882067de@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 345s] cloud111 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:38 UTC 2017. [ 345s] [ 345s] ### VM INTERACTION START ### [ 347s] Powering off. [ 347s] [ 312.180344] reboot: Power down [ 358s] ### VM INTERACTION END ### [ 358s] build: extracting built packages... [ 359s] DEBS/libosmocore_0.9.6.20170628.dsc [ 359s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 359s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jun 23 19:57:10 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 23 Jun 2017 19:57:10 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59541bd310c58_1d6b5a4f882068e8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 638s] [ 638s] cloud121 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 20:01:15 UTC 2017. [ 638s] [ 638s] ### VM INTERACTION START ### [ 641s] [ 613.459662] reboot: Power down [ 647s] ### VM INTERACTION END ### [ 647s] build: extracting built packages... [ 648s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 648s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.dsc [ 648s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 648s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 648s] OTHER/_statistics -- 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 Jun 28 22:34:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 22:34:21 +0000 Subject: osmo-bts[master]: sysmo/tch.c: Clean up use of empty buffer In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 22:36:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 22:36:04 +0000 Subject: osmo-bts[master]: sysmo/l1_if.c: Allow passing low quality buffers to upper la... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 22:37:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 22:37:21 +0000 Subject: osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3071/1/src/common/l1sap.c File src/common/l1sap.c: Line 1017: if(msg->len) { if is not a function, hence we use a space. -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From admin at opensuse.org Sat Jun 24 19:53:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:53:09 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5954363b3c400_5b7b860f881005de@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: [ 211s] [ 211s] build79 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:58 UTC 2017. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 202.569182] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] build: extracting built packages... [ 215s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.dsc [ 215s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 215s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 215s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 215s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5954363d28c97_5b7b860f881010ea@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 315s] [ 315s] lamb69 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:40 UTC 2017. [ 315s] [ 315s] ### VM INTERACTION START ### [ 318s] [ 299.657850] reboot: Power down [ 318s] ### VM INTERACTION END ### [ 319s] build: extracting built packages... [ 319s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 319s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 319s] DEBS/libosmocore_0.9.6.20170628.dsc [ 319s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 319s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5954363ca21ff_5b7b860f8810095@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 283s] [ 283s] lamb53 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:11 UTC 2017. [ 283s] [ 283s] ### VM INTERACTION START ### [ 287s] [ 272.704659] reboot: Power down [ 287s] ### VM INTERACTION END ### [ 287s] build: extracting built packages... [ 287s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.dsc [ 287s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 287s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 287s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:53:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:53:09 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5954363ba0cec_5b7b860f8810063@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: [ 292s] lamb66 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:17 UTC 2017. [ 292s] [ 292s] ### VM INTERACTION START ### [ 293s] Powering off. [ 293s] [ 279.409997] reboot: Power down [ 293s] ### VM INTERACTION END ### [ 293s] build: extracting built packages... [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.dsc [ 293s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 293s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 293s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 293s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5954363e2e4dd_5b7b860f881012fc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 345s] cloud111 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:38 UTC 2017. [ 345s] [ 345s] ### VM INTERACTION START ### [ 347s] Powering off. [ 347s] [ 312.180344] reboot: Power down [ 358s] ### VM INTERACTION END ### [ 358s] build: extracting built packages... [ 359s] DEBS/libosmocore_0.9.6.20170628.dsc [ 359s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 359s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:53:43 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:53:43 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5954363cd5b4_5b7b860f881007bd@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: [ 255s] [ 255s] lamb15 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:39 UTC 2017. [ 255s] [ 255s] ### VM INTERACTION START ### [ 258s] [ 243.854006] reboot: Power down [ 258s] ### VM INTERACTION END ### [ 258s] build: extracting built packages... [ 258s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 258s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 258s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.dsc [ 258s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 258s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5954363ee9372_5b7b860f881014ab@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: [ 344s] [ 344s] lamb04 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:12 UTC 2017. [ 344s] [ 344s] ### VM INTERACTION START ### [ 348s] [ 331.394824] reboot: Power down [ 348s] ### VM INTERACTION END ### [ 348s] build: extracting built packages... [ 348s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.dsc [ 348s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 348s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 348s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 348s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:54:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:54:01 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5954363d72d0c_5b7b860f88101111@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: [ 207s] [ 207s] build76 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:53 UTC 2017. [ 207s] [ 207s] ### VM INTERACTION START ### [ 210s] [ 199.501318] reboot: Power down [ 210s] ### VM INTERACTION END ### [ 210s] build: extracting built packages... [ 210s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.dsc [ 210s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 210s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 210s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 210s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:54:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:54:18 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <595436402727f_5b7b860f88101589@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 638s] [ 638s] cloud121 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 20:01:15 UTC 2017. [ 638s] [ 638s] ### VM INTERACTION START ### [ 641s] [ 613.459662] reboot: Power down [ 647s] ### VM INTERACTION END ### [ 647s] build: extracting built packages... [ 648s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 648s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.dsc [ 648s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 648s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 648s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jun 24 19:59:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 24 Jun 2017 19:59:26 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <595436463fab5_5b7b860f88102070@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: [ 224s] [ 224s] lamb24 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:22 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 228s] [ 214.746288] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] build: extracting built packages... [ 228s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 228s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.dsc [ 228s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 228s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 228s] OTHER/_statistics -- 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 Jun 28 23:43:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 23:43:19 +0000 Subject: osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 28 23:43:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 23:43:28 +0000 Subject: [MERGED] osmo-bts[master]: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer ...................................................................... TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer using gettimeofday() is not suitable for the GSM frame timer, as it relies on the normal 'wall clock' system time, which may be adjusted by ntp, gps or other means at runtime. Switching to a different clock source means we cannot use osmo_timer_list anymore, but timerfd integrates just fine with our libosmocore select() loop handling. Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Closes: #2325 --- M src/osmo-bts-trx/scheduler_trx.c M src/osmo-bts-trx/trx_vty.c 2 files changed, 244 insertions(+), 85 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index cbcde8c..9c87643 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -2,7 +2,7 @@ /* (C) 2013 by Andreas Eversberg * (C) 2015 by Alexander Chemeris - * (C) 2015 by Harald Welte + * (C) 2015-2017 by Harald Welte * * All Rights Reserved * @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -46,12 +48,6 @@ #include "loops.h" extern void *tall_bts_ctx; - -/* clock states */ -static uint32_t transceiver_lost; -uint32_t transceiver_last_fn; -static struct timeval transceiver_clock_tv; -static struct osmo_timer_list transceiver_clock_timer; /* Enable this to multiply TOA of RACH by 10. * This is useful to check tenth of timing advances with RSSI test tool. @@ -1409,82 +1405,232 @@ return 0; } - /* - * frame clock + * TRX frame clock handling + * + * In a "normal" synchronous PHY layer, we would be polled every time + * the PHY needs data for a given frame number. However, the + * OpenBTS-inherited TRX protocol works differently: We (L1) must + * autonomously send burst data based on our own clock, and every so + * often (currently every ~ 216 frames), we get a clock indication from + * the TRX. + * + * We're using a MONOTONIC timerfd interval timer for the 4.615ms frame + * intervals, and then compute + send the 8 bursts for that frame. + * + * Upon receiving a clock indication from the TRX, we compensate + * accordingly: If we were transmitting too fast, we're delaying the + * next interval timer accordingly. If we were too slow, we immediately + * send burst data for the missing frame numbers. */ -#define FRAME_DURATION_uS 4615 +/*! clock state of a given TRX */ +struct osmo_trx_clock_state { + /*! number of FN periods without TRX clock indication */ + uint32_t fn_without_clock_ind; + struct { + /*! last FN we processed based on FN period timer */ + uint32_t fn; + /*! time at which we last processed FN */ + struct timespec tv; + } last_fn_timer; + struct { + /*! last FN we received a clock indication for */ + uint32_t fn; + /*! time at which we received the last clock indication */ + struct timespec tv; + } last_clk_ind; + /*! Osmocom FD wrapper for timerfd */ + struct osmo_fd fn_timer_ofd; +}; + +/* TODO: This must go and become part of the phy_link */ +static struct osmo_trx_clock_state g_clk_s = { .fn_timer_ofd.fd = -1 }; + +/*! duration of a GSM frame in nano-seconds. (120ms/26) */ +#define FRAME_DURATION_nS 4615384 +/*! duration of a GSM frame in micro-seconds (120s/26) */ +#define FRAME_DURATION_uS (FRAME_DURATION_nS/1000) +/*! maximum number of 'missed' frame periods we can tolerate of OS doesn't schedule us*/ #define MAX_FN_SKEW 50 +/*! maximum number of frame periods we can tolerate without TRX Clock Indication*/ #define TRX_LOSS_FRAMES 400 -extern int quit; -/* this timer fires for every FN to be processed */ -static void trx_ctrl_timer_cb(void *data) +/*! compute the number of micro-seconds difference elapsed between \a last and \a now */ +static inline int compute_elapsed_us(const struct timespec *last, const struct timespec *now) { - struct gsm_bts *bts = data; - struct timeval tv_now, *tv_clock = &transceiver_clock_tv; - int32_t elapsed; + int elapsed; + + elapsed = (now->tv_sec - last->tv_sec) * 1000000 + + (now->tv_nsec - last->tv_nsec) / 1000; + return elapsed; +} + +/*! compute the number of frame number intervals elapsed between \a last and \a now */ +static inline int compute_elapsed_fn(const uint32_t last, const uint32_t now) +{ + int elapsed_fn = (now + GSM_HYPERFRAME - last) % GSM_HYPERFRAME; + if (elapsed_fn >= 135774) + elapsed_fn -= GSM_HYPERFRAME; + return elapsed_fn; +} + +/*! normalise given 'struct timespec', i.e. carry nanoseconds into seconds */ +static inline void normalize_timespec(struct timespec *ts) +{ + ts->tv_sec += ts->tv_nsec / 1000000000; + ts->tv_nsec = ts->tv_nsec % 1000000000; +} + +/*! disable the osmocom-wrapped timerfd */ +static int timer_ofd_disable(struct osmo_fd *ofd) +{ + const struct itimerspec its_null = { + .it_value = { 0, 0 }, + .it_interval = { 0, 0 }, + }; + return timerfd_settime(ofd->fd, 0, &its_null, NULL); +} + +/*! schedule the osmcoom-wrapped timerfd to occur first at \a first, then periodically at \a interval + * \param[in] ofd Osmocom wrapped timerfd + * \param[in] first Relative time at which the timer should first execute (NULL = \a interval) + * \param[in] interval Time interval at which subsequent timer shall fire + * \returns 0 on success; negative on error */ +static int timer_ofd_schedule(struct osmo_fd *ofd, const struct timespec *first, + const struct timespec *interval) +{ + struct itimerspec its; + + if (ofd->fd < 0) + return -EINVAL; + + /* first expiration */ + if (first) + its.it_value = *first; + else + its.it_value = *interval; + /* repeating interval */ + its.it_interval = *interval; + + return timerfd_settime(ofd->fd, 0, &its, NULL); +} + +/*! setup osmocom-wrapped timerfd + * \param[inout] ofd Osmocom-wrapped timerfd on which to operate + * \param[in] cb Call-back function called when timerfd becomes readable + * \param[in] data Opaque data to be passed on to call-back + * \returns 0 on success; negative on error + * + * We simply initialize the data structures here, but do not yet + * schedule the timer. + */ +static int timer_ofd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, unsigned int), void *data) +{ + ofd->cb = cb; + ofd->data = data; + ofd->when = BSC_FD_READ; + + if (ofd->fd < 0) { + ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); + if (ofd->fd < 0) + return ofd->fd; + + osmo_fd_register(ofd); + } + return 0; +} + +/*! Increment a GSM frame number modulo GSM_HYPERFRAME */ +#define INCREMENT_FN(fn) (fn) = (((fn) + 1) % GSM_HYPERFRAME) + +extern int quit; + +/*! this is the timerfd-callback firing for every FN to be processed */ +static int trx_fn_timer_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct gsm_bts *bts = ofd->data; + struct osmo_trx_clock_state *tcs = &g_clk_s; + struct timespec tv_now; + uint64_t expire_count; + int elapsed_us; + int error_us; + int rc, i; + + if (!(what & BSC_FD_READ)) + return 0; + + /* read from timerfd: number of expirations of periodic timer */ + rc = read(ofd->fd, (void *) &expire_count, sizeof(expire_count)); + if (rc < 0 && errno == EAGAIN) + return 0; + OSMO_ASSERT(rc == sizeof(expire_count)); + + if (expire_count > 1) { + LOGP(DL1C, LOGL_NOTICE, "FN timer expire_count=%"PRIu64": We missed %"PRIu64" timers\n", + expire_count, expire_count-1); + } /* check if transceiver is still alive */ - if (transceiver_lost++ == TRX_LOSS_FRAMES) { + if (tcs->fn_without_clock_ind++ == TRX_LOSS_FRAMES) { LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n"); no_clock: + timer_ofd_disable(&tcs->fn_timer_ofd); transceiver_available = 0; bts_shutdown(bts, "No clock from osmo-trx"); - return; + return -1; } - gettimeofday(&tv_now, NULL); - - elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 - + (tv_now.tv_usec - tv_clock->tv_usec); + /* compute actual elapsed time and resulting OS scheduling error */ + clock_gettime(CLOCK_MONOTONIC, &tv_now); + elapsed_us = compute_elapsed_us(&tcs->last_fn_timer.tv, &tv_now); + error_us = elapsed_us - FRAME_DURATION_uS; +#ifdef DEBUG_CLOCK + printf("%s(): %09ld, elapsed_us=%05d, error_us=%-d: fn=%d\n", __func__, + tv_now.tv_nsec, elapsed_us, error_us, tcs->last_fn_timer.fn+1); +#endif + tcs->last_fn_timer.tv = tv_now; /* if someone played with clock, or if the process stalled */ - if (elapsed > FRAME_DURATION_uS * MAX_FN_SKEW || elapsed < 0) { - LOGP(DL1C, LOGL_NOTICE, "PC clock skew: elapsed uS %d\n", - elapsed); + if (elapsed_us > FRAME_DURATION_uS * MAX_FN_SKEW || elapsed_us < 0) { + LOGP(DL1C, LOGL_ERROR, "PC clock skew: elapsed_us=%d, error_us=%d\n", + elapsed_us, error_us); goto no_clock; } - /* schedule next FN clock */ - while (elapsed > FRAME_DURATION_uS / 2) { - tv_clock->tv_usec += FRAME_DURATION_uS; - if (tv_clock->tv_usec >= 1000000) { - tv_clock->tv_sec++; - tv_clock->tv_usec -= 1000000; - } - transceiver_last_fn = (transceiver_last_fn + 1) % GSM_HYPERFRAME; - trx_sched_fn(bts, transceiver_last_fn); - elapsed -= FRAME_DURATION_uS; + /* call trx_sched_fn() for all expired FN */ + for (i = 0; i < expire_count; i++) { + INCREMENT_FN(tcs->last_fn_timer.fn); + trx_sched_fn(bts, tcs->last_fn_timer.fn); } - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS - elapsed); + + return 0; } - -/* receive clock from transceiver */ +/*! called every time we receive a clock indication from TRX */ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn) { - struct timeval tv_now, *tv_clock = &transceiver_clock_tv; - int32_t elapsed; - int32_t elapsed_fn; + struct osmo_trx_clock_state *tcs = &g_clk_s; + struct timespec tv_now; + int elapsed_us, elapsed_fn; + int elapsed_us_since_clk, elapsed_fn_since_clk, error_us_since_clk; + unsigned int fn_caught_up = 0; + const struct timespec interval = { .tv_sec = 0, .tv_nsec = FRAME_DURATION_nS }; if (quit) return 0; /* reset lost counter */ - transceiver_lost = 0; + tcs->fn_without_clock_ind = 0; - gettimeofday(&tv_now, NULL); + clock_gettime(CLOCK_MONOTONIC, &tv_now); /* clock becomes valid */ if (!transceiver_available) { - LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", - fn); + LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", fn); transceiver_available = 1; @@ -1495,69 +1641,83 @@ check_transceiver_availability(bts, 1); new_clock: - transceiver_last_fn = fn; - trx_sched_fn(bts, transceiver_last_fn); + tcs->last_fn_timer.fn = fn; + /* call trx cheduler function for new 'last' FN */ + trx_sched_fn(bts, tcs->last_fn_timer.fn); - /* schedule first FN clock */ - memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - memset(&transceiver_clock_timer, 0, - sizeof(transceiver_clock_timer)); - transceiver_clock_timer.cb = trx_ctrl_timer_cb; - transceiver_clock_timer.data = bts; - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS); + /* schedule first FN clock timer */ + timer_ofd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts); + timer_ofd_schedule(&tcs->fn_timer_ofd, NULL, &interval); + + tcs->last_fn_timer.tv = tv_now; + tcs->last_clk_ind.tv = tv_now; + tcs->last_clk_ind.fn = fn; return 0; } - osmo_timer_del(&transceiver_clock_timer); + /* calculate elapsed time +fn since last timer */ + elapsed_us = compute_elapsed_us(&tcs->last_fn_timer.tv, &tv_now); + elapsed_fn = compute_elapsed_fn(tcs->last_fn_timer.fn, fn); +#ifdef DEBUG_CLOCK + printf("%s(): LAST_TIMER %9ld, elapsed_us=%7d, elapsed_fn=%+3d\n", __func__, + tv_now.tv_nsec, elapsed_us, elapsed_fn); +#endif + /* negative elapsed_fn values mean that we've already processed + * more FN based on the local interval timer than what the TRX + * now reports in the clock indication. Positive elapsed_fn + * values mean we still have a backlog to process */ - /* calculate elapsed time since last_fn */ - elapsed = (tv_now.tv_sec - tv_clock->tv_sec) * 1000000 - + (tv_now.tv_usec - tv_clock->tv_usec); + /* calculate elapsed time +fn since last clk ind */ + elapsed_us_since_clk = compute_elapsed_us(&tcs->last_clk_ind.tv, &tv_now); + elapsed_fn_since_clk = compute_elapsed_fn(tcs->last_clk_ind.fn, fn); + /* error (delta) between local clock since last CLK and CLK based on FN clock at TRX */ + error_us_since_clk = elapsed_us_since_clk - (FRAME_DURATION_uS * elapsed_fn_since_clk); + LOGP(DL1C, LOGL_INFO, "TRX Clock Ind: elapsed_us=%7d, elapsed_fn=%3d, error_us=%+5d\n", + elapsed_us_since_clk, elapsed_fn_since_clk, error_us_since_clk); - /* how much frames have been elapsed since last fn processed */ - elapsed_fn = (fn + GSM_HYPERFRAME - transceiver_last_fn) % GSM_HYPERFRAME; - if (elapsed_fn >= 135774) - elapsed_fn -= GSM_HYPERFRAME; + /* TODO: put this computed error_us_since_clk into some filter + * function and use that to adjust our regular timer interval to + * compensate for clock drift between the PC clock and the + * TRX/SDR clock */ + + tcs->last_clk_ind.tv = tv_now; + tcs->last_clk_ind.fn = fn; /* check for max clock skew */ if (elapsed_fn > MAX_FN_SKEW || elapsed_fn < -MAX_FN_SKEW) { LOGP(DL1C, LOGL_NOTICE, "GSM clock skew: old fn=%u, " - "new fn=%u\n", transceiver_last_fn, fn); + "new fn=%u\n", tcs->last_fn_timer.fn, fn); goto new_clock; } - LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d\n", - elapsed_fn * FRAME_DURATION_uS - elapsed); + LOGP(DL1C, LOGL_INFO, "GSM clock jitter: %d us (elapsed_fn=%d)\n", + elapsed_fn * FRAME_DURATION_uS - elapsed_us, elapsed_fn); /* too many frames have been processed already */ if (elapsed_fn < 0) { + struct timespec first = interval; /* set clock to the time or last FN should have been * transmitted. */ - tv_clock->tv_sec = tv_now.tv_sec; - tv_clock->tv_usec = tv_now.tv_usec + - (0 - elapsed_fn) * FRAME_DURATION_uS; - if (tv_clock->tv_usec >= 1000000) { - tv_clock->tv_sec++; - tv_clock->tv_usec -= 1000000; - } + first.tv_nsec += (0 - elapsed_fn) * FRAME_DURATION_nS; + normalize_timespec(&first); + LOGP(DL1C, LOGL_NOTICE, "We were %d FN faster than TRX, compensating\n", -elapsed_fn); /* set time to the time our next FN has to be transmitted */ - osmo_timer_schedule(&transceiver_clock_timer, 0, - FRAME_DURATION_uS * (1 - elapsed_fn)); - + timer_ofd_schedule(&tcs->fn_timer_ofd, &first, &interval); return 0; } /* transmit what we still need to transmit */ - while (fn != transceiver_last_fn) { - transceiver_last_fn = (transceiver_last_fn + 1) % GSM_HYPERFRAME; - trx_sched_fn(bts, transceiver_last_fn); + while (fn != tcs->last_fn_timer.fn) { + INCREMENT_FN(tcs->last_fn_timer.fn); + trx_sched_fn(bts, tcs->last_fn_timer.fn); + fn_caught_up++; } - /* schedule next FN to be transmitted */ - memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - osmo_timer_schedule(&transceiver_clock_timer, 0, FRAME_DURATION_uS); + if (fn_caught_up) { + LOGP(DL1C, LOGL_NOTICE, "We were %d FN slower than TRX, compensated\n", elapsed_fn); + tcs->last_fn_timer.tv = tv_now; + } return 0; } diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 4f74c44..6d6cded 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -60,8 +60,7 @@ if (!transceiver_available) { vty_out(vty, "transceiver is not connected%s", VTY_NEWLINE); } else { - vty_out(vty, "transceiver is connected, current fn=%u%s", - transceiver_last_fn, VTY_NEWLINE); + vty_out(vty, "transceiver is connected%s", VTY_NEWLINE); } llist_for_each_entry(trx, &bts->trx_list, list) { -- To view, visit https://gerrit.osmocom.org/3037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jun 28 23:43:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 28 Jun 2017 23:43:29 +0000 Subject: [MERGED] osmo-bts[master]: Add loopback support for PDTCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add loopback support for PDTCH ...................................................................... Add loopback support for PDTCH This add support for BTS-side lookback of PDTCH channels. If lchan-loopback is enabled, We take the uplink frames as received in PH-DATA.ind and put them into the dl_tch_queue for that lchan. When we receive PH-RTS.ind, we dequeue frames from that queue and transmit them in downlink. If no frame is found in queue, we transmit an empty (all-zero) frame of 23 bytes (CS-1). Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 --- M src/common/l1sap.c 1 file changed, 89 insertions(+), 27 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1fb6134..85d1dd1 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -51,6 +51,16 @@ #include #include +static char *dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + + snprintf(buf, sizeof(buf), "%06u/%02u/%02u/%02u/%02u", + tm->fn, tm->t1, tm->t2, tm->t3, tm->fn%52); + buf[sizeof(buf)-1] = '\0'; + return buf; +} + struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) { @@ -595,6 +605,39 @@ return rc; } +/*! handling for PDTCH loopback mode, used for BER testing + * \param[in] lchan logical channel on which we operate + * \param[in] rts_ind PH-RTS.ind from PHY which we process + * \param[out] msg Message buffer to which we write data + * + * The function will fill \a msg, from which the caller can then + * subsequently build a PH-DATA.req */ +static int lchan_pdtch_ph_rts_ind_loop(struct gsm_lchan *lchan, + const struct ph_data_param *rts_ind, + struct msgb *msg, const struct gsm_time *tm) +{ + struct msgb *loop_msg; + uint8_t *p; + + /* de-queue response message (loopback) */ + loop_msg = msgb_dequeue(&lchan->dl_tch_queue); + if (!loop_msg) { + LOGP(DL1P, LOGL_NOTICE, "%s %s: no looped PDTCH message, sending empty\n", + gsm_lchan_name(lchan), dump_gsmtime(tm)); + /* empty downlink message */ + p = msgb_put(msg, GSM_MACBLOCK_LEN); + memset(p, 0, GSM_MACBLOCK_LEN); + } else { + LOGP(DL1P, LOGL_NOTICE, "%s %s: looped PDTCH message of %u bytes\n", + gsm_lchan_name(lchan), dump_gsmtime(tm), msgb_l2len(loop_msg)); + /* copy over data from queued response message */ + p = msgb_put(msg, msgb_l2len(loop_msg)); + memcpy(p, msgb_l2(loop_msg), msgb_l2len(loop_msg)); + msgb_free(loop_msg); + } + return 0; +} + /* PH-RTS-IND prim received from bts model */ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap, struct ph_data_param *rts_ind) @@ -618,21 +661,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-RTS.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); - - if (ts_is_pdch(&trx->ts[tn])) { - if (L1SAP_IS_PTCCH(rts_ind->fn)) { - pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */, - L1SAP_FN2PTCCHBLOCK(fn)); - - return 0; - } - pcu_tx_rts_req(&trx->ts[tn], 0, fn, 0 /* ARFCN */, - L1SAP_FN2MACBLOCK(fn)); - - return 0; - } + DEBUGP(DL1P, "Rx PH-RTS.ind %s chan_nr=%d link_id=%d\n", + dump_gsmtime(&g_time), chan_nr, link_id); /* reuse PH-RTS.ind for PH-DATA.req */ if (!msg) { @@ -645,7 +675,25 @@ msg); msg->l2h = msg->l1h + sizeof(*l1sap); - if (L1SAP_IS_CHAN_BCCH(chan_nr)) { + if (ts_is_pdch(&trx->ts[tn])) { + lchan = get_active_lchan_by_chan_nr(trx, chan_nr); + if (lchan && lchan->loopback) { + if (!L1SAP_IS_PTCCH(rts_ind->fn)) + lchan_pdtch_ph_rts_ind_loop(lchan, rts_ind, msg, &g_time); + /* continue below like for SACCH/FACCH/... */ + } else { + /* forward RTS.ind to PCU */ + if (L1SAP_IS_PTCCH(rts_ind->fn)) { + pcu_tx_rts_req(&trx->ts[tn], 1, fn, 1 /* ARFCN */, + L1SAP_FN2PTCCHBLOCK(fn)); + } else { + pcu_tx_rts_req(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + L1SAP_FN2MACBLOCK(fn)); + } + /* return early, PCU takes care of rest */ + return 0; + } + } else if (L1SAP_IS_CHAN_BCCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); /* get them from bts->si_buf[] */ si = bts_sysinfo_get(trx->bts, &g_time); @@ -916,25 +964,39 @@ g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); if (ts_is_pdch(&trx->ts[tn])) { + lchan = get_lchan_by_chan_nr(trx, chan_nr); + if (!lchan) + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); + if (lchan && lchan->loopback) { + /* we are in loopback mode (for BER testing) + * mode and need to enqeue the frame to be + * returned in downlink */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + msgb_enqueue(&lchan->dl_tch_queue, msg); + + /* Return 1 to signal that we're still using msg + * and it should not be freed */ + return 1; + } + + /* don't send bad frames to PCU */ if (len == 0) return -EINVAL; if (L1SAP_IS_PTCCH(fn)) { pcu_tx_data_ind(&trx->ts[tn], 1, fn, - 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), + 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); - - return 0; + } else { + /* drop incomplete UL block */ + if (pr_info != PRES_INFO_BOTH) + return 0; + /* PDTCH / PACCH frame handling */ + pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, + data_ind->ta_offs_qbits, data_ind->lqual_cb); } - /* drop incomplete UL block */ - if (pr_info != PRES_INFO_BOTH) - return 0; - /* PDTCH / PACCH frame handling */ - pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, - L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); - return 0; } -- To view, visit https://gerrit.osmocom.org/3032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From admin at opensuse.org Sun Jun 25 19:53:12 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:53:12 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59544798905e4_2fa4f42f7c1793f2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 283s] [ 283s] lamb53 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:11 UTC 2017. [ 283s] [ 283s] ### VM INTERACTION START ### [ 287s] [ 272.704659] reboot: Power down [ 287s] ### VM INTERACTION END ### [ 287s] build: extracting built packages... [ 287s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.dsc [ 287s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 287s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 287s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:52:38 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:52:38 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5954479822ca_2fa4f42f7c179271@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: [ 211s] [ 211s] build79 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:58 UTC 2017. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 202.569182] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] build: extracting built packages... [ 215s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.dsc [ 215s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 215s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 215s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 215s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:53:12 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:53:12 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59544799d401d_2fa4f42f7c17962b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 638s] [ 638s] cloud121 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 20:01:15 UTC 2017. [ 638s] [ 638s] ### VM INTERACTION START ### [ 641s] [ 613.459662] reboot: Power down [ 647s] ### VM INTERACTION END ### [ 647s] build: extracting built packages... [ 648s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 648s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.dsc [ 648s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 648s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 648s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:53:12 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:53:12 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <59544799661a3_2fa4f42f7c1795aa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 315s] [ 315s] lamb69 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:40 UTC 2017. [ 315s] [ 315s] ### VM INTERACTION START ### [ 318s] [ 299.657850] reboot: Power down [ 318s] ### VM INTERACTION END ### [ 319s] build: extracting built packages... [ 319s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 319s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 319s] DEBS/libosmocore_0.9.6.20170628.dsc [ 319s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 319s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:53:30 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:53:30 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5954479a7b56a_2fa4f42f7c1797ca@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: [ 292s] lamb66 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:17 UTC 2017. [ 292s] [ 292s] ### VM INTERACTION START ### [ 293s] Powering off. [ 293s] [ 279.409997] reboot: Power down [ 293s] ### VM INTERACTION END ### [ 293s] build: extracting built packages... [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.dsc [ 293s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 293s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 293s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 293s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:53:30 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:53:30 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5954479acb0a1_2fa4f42f7c17987b@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: [ 207s] [ 207s] build76 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:53 UTC 2017. [ 207s] [ 207s] ### VM INTERACTION START ### [ 210s] [ 199.501318] reboot: Power down [ 210s] ### VM INTERACTION END ### [ 210s] build: extracting built packages... [ 210s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.dsc [ 210s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 210s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 210s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 210s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:54:04 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:54:04 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5954479b63825_2fa4f42f7c17992b@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: [ 255s] [ 255s] lamb15 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:39 UTC 2017. [ 255s] [ 255s] ### VM INTERACTION START ### [ 258s] [ 243.854006] reboot: Power down [ 258s] ### VM INTERACTION END ### [ 258s] build: extracting built packages... [ 258s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 258s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 258s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.dsc [ 258s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 258s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:53:12 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:53:12 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59544798e865e_2fa4f42f7c1794a2@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: [ 224s] [ 224s] lamb24 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:22 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 228s] [ 214.746288] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] build: extracting built packages... [ 228s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 228s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.dsc [ 228s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 228s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 228s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:54:21 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:54:21 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5954479bc9098_2fa4f42f7c1800e4@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: [ 344s] [ 344s] lamb04 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:12 UTC 2017. [ 344s] [ 344s] ### VM INTERACTION START ### [ 348s] [ 331.394824] reboot: Power down [ 348s] ### VM INTERACTION END ### [ 348s] build: extracting built packages... [ 348s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.dsc [ 348s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 348s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 348s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 348s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jun 25 19:54:21 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 25 Jun 2017 19:54:21 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5954479c309a4_2fa4f42f7c180124@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 345s] cloud111 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:38 UTC 2017. [ 345s] [ 345s] ### VM INTERACTION START ### [ 347s] Powering off. [ 347s] [ 312.180344] reboot: Power down [ 358s] ### VM INTERACTION END ### [ 358s] build: extracting built packages... [ 359s] DEBS/libosmocore_0.9.6.20170628.dsc [ 359s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 359s] OTHER/_statistics -- 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 Jun 29 00:27:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:27:29 +0000 Subject: [PATCH] osmo-trx[master]: LimeSDR: set approximate tx offset value to make GSM work Message-ID: Review at https://gerrit.osmocom.org/3072 LimeSDR: set approximate tx offset value to make GSM work may be fine-tuned in the future Modified to match current master by Harald Welte. Change-Id: Ied215ca9e9d9c346c2a654f96785d1b87b075129 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/72/3072/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index a766ddc..9ab96f6 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -130,7 +130,7 @@ { std::make_tuple(UMTRX, 1, 1), { 2, 0.0, GSMRATE, 9.9692e-5, "UmTRX 1 SPS" } }, { std::make_tuple(UMTRX, 4, 1), { 2, 0.0, GSMRATE, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS"} }, { std::make_tuple(UMTRX, 4, 4), { 2, 0.0, GSMRATE, 5.1503e-5, "UmTRX 4 SPS" } }, - { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" } }, + { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 8.9e-5, "LimeSDR 4 SPS" } }, { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, }; -- To view, visit https://gerrit.osmocom.org/3072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied215ca9e9d9c346c2a654f96785d1b87b075129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:27:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:27:30 +0000 Subject: [PATCH] osmo-trx[master]: LimeSDR: Change device detection to work with USB and PCIe v... Message-ID: Review at https://gerrit.osmocom.org/3073 LimeSDR: Change device detection to work with USB and PCIe versions Modified to match current master by Harald Welte. Change-Id: Ie43610de0b2196d84caf09717ec8c8ca75ab926d --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/73/3073/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 9ab96f6..1ee4804 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -528,7 +528,7 @@ { "X310", { X3XX, TX_WINDOW_FIXED } }, { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, - { "STREAM", { LIMESDR, TX_WINDOW_USRP1 } }, + { "LimeSDR", { LIMESDR, TX_WINDOW_USRP1 } }, }; // Compare UHD motherboard and device strings */ -- To view, visit https://gerrit.osmocom.org/3073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie43610de0b2196d84caf09717ec8c8ca75ab926d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:27:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:27:31 +0000 Subject: [PATCH] osmo-trx[master]: LimeSDR: change tx window type to TX_WINDOW_FIXED Message-ID: Review at https://gerrit.osmocom.org/3074 LimeSDR: change tx window type to TX_WINDOW_FIXED It seems that TX_WINDOW_USRP1 is for devices that do not support tx sync to timestamp. LimeSDR supports it. Changing to TX_WINDOW_FIXED greatly reduces number of "dumping stale buffer" messages Modified to match current master by Harald Welte. Change-Id: I8de5b165ccd72a62b0f16655618e24ca740d9637 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/74/3074/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 1ee4804..a69d6c3 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -528,7 +528,7 @@ { "X310", { X3XX, TX_WINDOW_FIXED } }, { "USRP2", { USRP2, TX_WINDOW_FIXED } }, { "UmTRX", { UMTRX, TX_WINDOW_FIXED } }, - { "LimeSDR", { LIMESDR, TX_WINDOW_USRP1 } }, + { "LimeSDR", { LIMESDR, TX_WINDOW_FIXED } }, }; // Compare UHD motherboard and device strings */ -- To view, visit https://gerrit.osmocom.org/3074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8de5b165ccd72a62b0f16655618e24ca740d9637 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:27:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:27:31 +0000 Subject: [PATCH] osmo-trx[master]: LimeSDR: Fix sample value range Message-ID: Review at https://gerrit.osmocom.org/3075 LimeSDR: Fix sample value range when "sc16" stream arg is passed to SoapyUHD sample value range is -32768 to 32767 Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/75/3075/1 diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index a69d6c3..d1dd3d0 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -1185,7 +1185,7 @@ double uhd_device::fullScaleInputValue() { if (dev_type == LIMESDR) - return (double) 2047 * LIMESDR_TX_AMPL; + return (double) 32767 * LIMESDR_TX_AMPL; if (dev_type == UMTRX) return (double) SHRT_MAX * UMTRX_TX_AMPL; else @@ -1194,7 +1194,7 @@ double uhd_device::fullScaleOutputValue() { - if (dev_type == LIMESDR) return (double) 2047; + if (dev_type == LIMESDR) return (double) 32767.0; return (double) SHRT_MAX; } -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:27:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:27:55 +0000 Subject: osmo-trx[master]: LimeSDR: set approximate tx offset value to make GSM work In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied215ca9e9d9c346c2a654f96785d1b87b075129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:28:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:28:00 +0000 Subject: osmo-trx[master]: LimeSDR: Change device detection to work with USB and PCIe v... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie43610de0b2196d84caf09717ec8c8ca75ab926d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:28:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:28:03 +0000 Subject: osmo-trx[master]: LimeSDR: change tx window type to TX_WINDOW_FIXED In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8de5b165ccd72a62b0f16655618e24ca740d9637 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 00:28:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 00:28:06 +0000 Subject: osmo-trx[master]: LimeSDR: Fix sample value range In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58b8b6b71648bd9cbc105ddaaa9a7cf0a31b3d47 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From admin at opensuse.org Mon Jun 26 19:53:39 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:53:39 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5954536a6f1d0_2fa4f42f7c4604b9@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: [ 344s] [ 344s] lamb04 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:12 UTC 2017. [ 344s] [ 344s] ### VM INTERACTION START ### [ 348s] [ 331.394824] reboot: Power down [ 348s] ### VM INTERACTION END ### [ 348s] build: extracting built packages... [ 348s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.dsc [ 348s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 348s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 348s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 348s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:53:56 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:53:56 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5954536b85ea2_2fa4f42f7c460642@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: [ 224s] [ 224s] lamb24 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:22 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 228s] [ 214.746288] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] build: extracting built packages... [ 228s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 228s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.dsc [ 228s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 228s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 228s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:53:56 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:53:56 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5954536b354a9_2fa4f42f7c4605bc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 283s] [ 283s] lamb53 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:11 UTC 2017. [ 283s] [ 283s] ### VM INTERACTION START ### [ 287s] [ 272.704659] reboot: Power down [ 287s] ### VM INTERACTION END ### [ 287s] build: extracting built packages... [ 287s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.dsc [ 287s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 287s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 287s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:53:56 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:53:56 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5954536bc6614_2fa4f42f7c460712@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: [ 292s] lamb66 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:17 UTC 2017. [ 292s] [ 292s] ### VM INTERACTION START ### [ 293s] Powering off. [ 293s] [ 279.409997] reboot: Power down [ 293s] ### VM INTERACTION END ### [ 293s] build: extracting built packages... [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.dsc [ 293s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 293s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 293s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 293s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:54:14 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:54:14 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5954536cc1866_2fa4f42f7c4609dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 345s] cloud111 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:38 UTC 2017. [ 345s] [ 345s] ### VM INTERACTION START ### [ 347s] Powering off. [ 347s] [ 312.180344] reboot: Power down [ 358s] ### VM INTERACTION END ### [ 358s] build: extracting built packages... [ 359s] DEBS/libosmocore_0.9.6.20170628.dsc [ 359s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 359s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:54:31 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:54:31 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5954536e33546_2fa4f42f7c46125c@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: [ 207s] [ 207s] build76 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:53 UTC 2017. [ 207s] [ 207s] ### VM INTERACTION START ### [ 210s] [ 199.501318] reboot: Power down [ 210s] ### VM INTERACTION END ### [ 210s] build: extracting built packages... [ 210s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.dsc [ 210s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 210s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 210s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 210s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:54:48 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:54:48 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5954536eeeee2_2fa4f42f7c4613f4@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: [ 211s] [ 211s] build79 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:58 UTC 2017. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 202.569182] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] build: extracting built packages... [ 215s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.dsc [ 215s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 215s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 215s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 215s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:54:48 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:54:48 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5954536f60981_2fa4f42f7c46149b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 315s] [ 315s] lamb69 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:40 UTC 2017. [ 315s] [ 315s] ### VM INTERACTION START ### [ 318s] [ 299.657850] reboot: Power down [ 318s] ### VM INTERACTION END ### [ 319s] build: extracting built packages... [ 319s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 319s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 319s] DEBS/libosmocore_0.9.6.20170628.dsc [ 319s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 319s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:55:22 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:55:22 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5954537171d4a_2fa4f42f7c461613@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: [ 255s] [ 255s] lamb15 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:39 UTC 2017. [ 255s] [ 255s] ### VM INTERACTION START ### [ 258s] [ 243.854006] reboot: Power down [ 258s] ### VM INTERACTION END ### [ 258s] build: extracting built packages... [ 258s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 258s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 258s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.dsc [ 258s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 258s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jun 26 19:55:39 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 26 Jun 2017 19:55:39 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <59545373aff_2fa4f42f7c4619cc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 638s] [ 638s] cloud121 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 20:01:15 UTC 2017. [ 638s] [ 638s] ### VM INTERACTION START ### [ 641s] [ 613.459662] reboot: Power down [ 647s] ### VM INTERACTION END ### [ 647s] build: extracting built packages... [ 648s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 648s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.dsc [ 648s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 648s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 648s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:53:35 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:53:35 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5954b5aae73c_5632cd6f7c99537@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: [ 224s] [ 224s] lamb24 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:22 UTC 2017. [ 224s] [ 224s] ### VM INTERACTION START ### [ 228s] [ 214.746288] reboot: Power down [ 228s] ### VM INTERACTION END ### [ 228s] build: extracting built packages... [ 228s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 228s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.dsc [ 228s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 228s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 228s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 228s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 228s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:53:18 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:53:18 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5954b5a9823cc_5640cd6f7c9969@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: [ 207s] [ 207s] build76 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:53 UTC 2017. [ 207s] [ 207s] ### VM INTERACTION START ### [ 210s] [ 199.501318] reboot: Power down [ 210s] ### VM INTERACTION END ### [ 210s] build: extracting built packages... [ 210s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.dsc [ 210s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 210s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 210s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 210s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 210s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 210s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:09 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:09 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5954b5aaa4270_5632cd6f7c996c3@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: [ 292s] lamb66 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:17 UTC 2017. [ 292s] [ 292s] ### VM INTERACTION START ### [ 293s] Powering off. [ 293s] [ 279.409997] reboot: Power down [ 293s] ### VM INTERACTION END ### [ 293s] build: extracting built packages... [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.dsc [ 293s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 293s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 293s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 293s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 293s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 293s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:26 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:26 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5954b5ab62dac_5632cd6f7c9984a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 315s] [ 315s] lamb69 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:40 UTC 2017. [ 315s] [ 315s] ### VM INTERACTION START ### [ 318s] [ 299.657850] reboot: Power down [ 318s] ### VM INTERACTION END ### [ 319s] build: extracting built packages... [ 319s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 319s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 319s] DEBS/libosmocore_0.9.6.20170628.dsc [ 319s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 319s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 319s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 319s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:52:44 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:52:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5954b5a81e36e_5640cd6f7c9954c@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: [ 344s] [ 344s] lamb04 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:12 UTC 2017. [ 344s] [ 344s] ### VM INTERACTION START ### [ 348s] [ 331.394824] reboot: Power down [ 348s] ### VM INTERACTION END ### [ 348s] build: extracting built packages... [ 348s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.dsc [ 348s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 348s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 348s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 348s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 348s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 348s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:26 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:26 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5954b5ac8dccd_5632cd6f7c100084@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 283s] [ 283s] lamb53 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:55:11 UTC 2017. [ 283s] [ 283s] ### VM INTERACTION START ### [ 287s] [ 272.704659] reboot: Power down [ 287s] ### VM INTERACTION END ### [ 287s] build: extracting built packages... [ 287s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.dsc [ 287s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 287s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 287s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 287s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 287s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:44 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5954b5ae91bf8_562acd6f7c984f9@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: [ 211s] [ 211s] build79 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:53:58 UTC 2017. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 202.569182] reboot: Power down [ 215s] ### VM INTERACTION END ### [ 215s] build: extracting built packages... [ 215s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.dsc [ 215s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 215s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 215s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 215s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 215s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 215s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:44 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5954b5afdbf6d_562acd6f7c98581@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: [ 255s] [ 255s] lamb15 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:54:39 UTC 2017. [ 255s] [ 255s] ### VM INTERACTION START ### [ 258s] [ 243.854006] reboot: Power down [ 258s] ### VM INTERACTION END ### [ 258s] build: extracting built packages... [ 258s] DEBS/libosmocodec0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 258s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmoctrl0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmosim0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.changes [ 258s] DEBS/libosmocore-dbg_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmocore_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogb4_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore8_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-utils_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmovty3_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-dev_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 258s] DEBS/libosmogsm7_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore_0.9.6.20170628.dsc [ 258s] DEBS/libosmocoding0_0.9.6.20170628_amd64.deb [ 258s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 258s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:09 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:09 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5954b5ab12e6d_5632cd6f7c997fc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 638s] [ 638s] cloud121 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 20:01:15 UTC 2017. [ 638s] [ 638s] ### VM INTERACTION START ### [ 641s] [ 613.459662] reboot: Power down [ 647s] ### VM INTERACTION END ### [ 647s] build: extracting built packages... [ 648s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 648s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.dsc [ 648s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 648s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 648s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 648s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 648s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jun 27 19:54:44 2017 From: admin at opensuse.org (OBS Notification) Date: Tue, 27 Jun 2017 19:54:44 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5954b5ad34317_5632cd6f7c100196@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/i586 Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 345s] cloud111 finished "build libosmocore_0.9.6.20170628.dsc" at Wed Jun 28 19:56:38 UTC 2017. [ 345s] [ 345s] ### VM INTERACTION START ### [ 347s] Powering off. [ 347s] [ 312.180344] reboot: Power down [ 358s] ### VM INTERACTION END ### [ 358s] build: extracting built packages... [ 359s] DEBS/libosmocore_0.9.6.20170628.dsc [ 359s] DEBS/libosmocore8_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.changes [ 359s] DEBS/libosmocore_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmogb-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocoding0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocoding-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocodec0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dbg_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-dev_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocodec-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmosim0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmocore-utils_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty3_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogsm7_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmogb4_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmovty-doc_0.9.6.20170628_all.deb [ 359s] DEBS/libosmoctrl0_0.9.6.20170628_i386.deb [ 359s] DEBS/libosmocore_0.9.6.20170628.tar.xz [ 359s] OTHER/_statistics -- 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 Jun 29 08:18:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 08:18:39 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3071 to look at the new patch set (#2). l1sap.c: Avoid sending RTP frame with empty payload Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc --- M src/common/l1sap.c 1 file changed, 23 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3071/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1fb6134..6aa1357 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1011,22 +1011,31 @@ msgb_pull(msg, sizeof(*l1sap)); - /* hand msg to RTP code for transmission */ - if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); - - /* if loopback is enabled, also queue received RTP data */ - if (lchan->loopback) { - /* make sure the queue doesn't get too long */ - queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); - /* add new frame to queue */ - msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ - return 1; + /* Low level layers always call us when TCH content is expected to be + * available, even if the content is not available due to decoding + * issues. Content not available is expected as empty payload. */ + if (msg->len) { + /* hand msg to RTP code for transmission */ + if (lchan->abis_ip.rtp_socket) + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); + /* if loopback is enabled, also queue received RTP data */ + if (lchan->loopback) { + /* make sure the queue doesn't get too long */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ + msgb_enqueue(&lchan->dl_tch_queue, msg); + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; + } + /* Only clear the marker bit once we have sent a RTP packet with it */ + lchan->rtp_tx_marker = false; + } else { + DEBUGP(DL1P, "Dropping RTP frame with lost payload\n"); + if (lchan->abis_ip.rtp_socket) + osmo_rtp_drop_frame(lchan->abis_ip.rtp_socket, fn_ms_adj(fn, lchan)); } - lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 29 08:27:13 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 08:27:13 +0000 Subject: osmo-bts[master]: sysmo/l1_if.c: Allow passing low quality buffers to upper la... In-Reply-To: References: Message-ID: Patch Set 2: Is this really necessary on sysmoBTS only? What about other BTS models? -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 08:30:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 08:30:16 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Why only implementation in .c but no .h file? How it's planned to be used? Please explain in commit message. -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Jun 29 08:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 08:33:11 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Patch Set 1: > Why only implementation in .c but no .h file? How it's planned to > be used? Please explain in commit message. Indeed I forgot to add the .h file to the commit, thanks for pointing out. -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 08:37:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 08:37:46 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3070 to look at the new patch set (#2). osmo_ortp: Add osmo_rtp_drop_frame API This API will be used by osmo-bts to maintain the sampling clock of the RTP socket whenever a frame should be sent but it is not available, for instance due to low quality of signal. Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 --- M include/osmocom/trau/osmo_ortp.h M src/trau/osmo_ortp.c 2 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/70/3070/2 diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index 9eb176f..fa6696c 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -76,6 +76,7 @@ int osmo_rtp_socket_connect(struct osmo_rtp_socket *rs, const char *ip, uint16_t port); int osmo_rtp_socket_set_pt(struct osmo_rtp_socket *rs, int payload_type); int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); +int osmo_rtp_drop_frame(struct osmo_rtp_socket *rs, unsigned int duration); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration); int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index b2ee040..05817aa 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -436,6 +436,27 @@ return osmo_rtp_socket_fdreg(rs); } +/*! \brief Increment seq and timestamp on a RTP socket without sending any packet + * \param[in] rs OsmoRTP socket + * \param[in] duration duration in number of RTP clock ticks + * + * Useful if willing to update the RTP internal clock at a given time but no + * audio content is available. From receiver point of view, it will look like + * a packet was lost somewhere in the path. + * + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_drop_frame(struct osmo_rtp_socket *rs, unsigned int duration) +{ + if (rs->flags & OSMO_RTP_F_DISABLED) + return 0; + + uint16_t next_seq = rtp_session_get_seq_number(rs->sess) + 1; + rtp_session_set_seq_number(rs->sess, next_seq); + rs->tx_timestamp += duration; + return 0; +} + /*! \brief Send one RTP frame via a RTP socket * \param[in] rs OsmoRTP socket * \param[in] payload pointer to buffer with RTP payload data -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 29 09:02:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 09:02:04 +0000 Subject: osmo-bts[master]: sysmo/l1_if.c: Allow passing low quality buffers to upper la... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) > Is this really necessary on sysmoBTS only? What about other BTS > models? I'll check and provide separate patches for each of them. https://gerrit.osmocom.org/#/c/3056/1/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 969: } > I think comment right next to the check explaining why we do it that way is It makes sense. I'm still working on this so I may even send a new version with more changes on it (like handling packets considered low quality in l1if_tch_rx in a different way, see https://osmocom.org/issues/2335#note-4 for more context. -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 29 10:29:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 10:29:08 +0000 Subject: [PATCH] osmo-bts[master]: sysmo: Allow passing low quality buffers to upper layers 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/3056 to look at the new patch set (#3). sysmo: Allow passing low quality buffers to upper layers We want to always call l1if_tch_rx in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/l1_if.h M src/osmo-bts-sysmo/tch.c 3 files changed, 20 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/3056/3 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f564836..776ec01 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -937,6 +937,7 @@ struct osmo_phsap_prim *l1sap; uint32_t fn; int rc = 0; + bool low_quality = data_ind->measParam.fLinkQuality < btsb->min_qual_norm; chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); @@ -951,12 +952,6 @@ process_meas_res(trx, chan_nr, fn, data_ind); - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, @@ -968,11 +963,20 @@ if (data_ind->sapi == GsmL1_Sapi_TchF || data_ind->sapi == GsmL1_Sapi_TchH) { /* TCH speech frame handling */ - rc = l1if_tch_rx(trx, chan_nr, l1p_msg); + rc = l1if_tch_rx(trx, chan_nr, l1p_msg, low_quality); msgb_free(l1p_msg); return rc; } + /* Discard frames with bad quality payload only after making sure we + * signal upper layers for TCH frames, because it expects to always be + * notified even if the content of the frame is not correct, otherwise + * it losses events and the RTP clock drifts. */ + if (low_quality && data_ind->msgUnitParam.u8Size != 0) { + msgb_free(l1p_msg); + return 0; + } + /* fill L1SAP header */ sap_msg = l1sap_msgb_alloc(data_ind->msgUnitParam.u8Size); l1sap = msgb_l1sap_prim(sap_msg); diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index 033e7f5..6dd2d60 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -128,7 +128,7 @@ int l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn, bool use_cache, bool marker); -int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); +int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a12b1a7..584499b 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -502,7 +502,7 @@ } /*! \brief receive a traffic L1 primitive for a given lchan */ -int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) +int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality) { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; @@ -513,10 +513,13 @@ if (is_recv_only(lchan->abis_ip.speech_mode)) return -EAGAIN; - if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + if (low_quality || data_ind->msgUnitParam.u8Size < 1) { + LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size %u low_quality %d\n", + chan_nr, data_ind->msgUnitParam.u8Size, low_quality); + + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1C-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 3 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 Thu Jun 29 10:29:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 10:29:08 +0000 Subject: [PATCH] osmo-bts[master]: litecell15/tch.c: Clean up use of empty buffer Message-ID: Review at https://gerrit.osmocom.org/3076 litecell15/tch.c: Clean up use of empty buffer Make code easier to read and avoid reading first byte of the buffer if size is 0. Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5 --- M src/osmo-bts-litecell15/tch.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/3076/1 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index ffc1eb3..8bed695 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -361,9 +361,7 @@ { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; - uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; - uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len, sid_first[9] = { 0 }; + uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 }; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -375,6 +373,9 @@ chan_nr); return -EINVAL; } + + payload_type = data_ind->msgUnitParam.u8Buffer[0]; + payload = data_ind->msgUnitParam.u8Buffer + 1; payload_len = data_ind->msgUnitParam.u8Size - 1; switch (payload_type) { -- To view, visit https://gerrit.osmocom.org/3076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 29 10:29:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 10:29:09 +0000 Subject: [PATCH] osmo-bts[master]: litecell15: Allow passing low quality buffers to upper layers Message-ID: Review at https://gerrit.osmocom.org/3077 litecell15: Allow passing low quality buffers to upper layers We want to always call l1if_tch_rx in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. Change-Id: I3aba5949ce2ecb2ee3d8a8e57a3e6b2108691160 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/l1_if.h M src/osmo-bts-litecell15/tch.c 3 files changed, 20 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/3077/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 71bb833..6b5fbc6 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -929,6 +929,7 @@ uint8_t *data, len; int rc = 0; int8_t rssi; + bool low_quality = data_ind->measParam.fLinkQuality < btsb->min_qual_norm; chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); @@ -943,12 +944,6 @@ process_meas_res(trx, chan_nr, &data_ind->measParam); - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), (uint32_t)data_ind->hLayer2, @@ -960,9 +955,18 @@ if (data_ind->sapi == GsmL1_Sapi_TchF || data_ind->sapi == GsmL1_Sapi_TchH) { /* TCH speech frame handling */ - rc = l1if_tch_rx(trx, chan_nr, l1p_msg); + rc = l1if_tch_rx(trx, chan_nr, l1p_msg, low_quality); msgb_free(l1p_msg); return rc; + } + + /* Discard frames with bad quality payload only after making sure we + * signal upper layers for TCH frames, because it expects to always be + * notified even if the content of the frame is not correct, otherwise + * it losses events and the RTP clock drifts. */ + if (low_quality && data_ind->msgUnitParam.u8Size != 0) { + msgb_free(l1p_msg); + return 0; } /* get rssi */ @@ -1575,4 +1579,3 @@ return 0; } - diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h index 7feee56..ecf9b6f 100644 --- a/src/osmo-bts-litecell15/l1_if.h +++ b/src/osmo-bts-litecell15/l1_if.h @@ -92,7 +92,7 @@ int l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len, const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn, bool use_cache, bool marker); -int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); +int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 8bed695..cccfb05 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -357,7 +357,7 @@ } /*! \brief receive a traffic L1 primitive for a given lchan */ -int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) +int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality) { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; @@ -368,10 +368,13 @@ if (is_recv_only(lchan->abis_ip.speech_mode)) return -EAGAIN; - if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + if (low_quality || data_ind->msgUnitParam.u8Size < 1) { + LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size %u low_quality %d\n", + chan_nr, data_ind->msgUnitParam.u8Size, low_quality); + + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1C-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; -- To view, visit https://gerrit.osmocom.org/3077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3aba5949ce2ecb2ee3d8a8e57a3e6b2108691160 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 29 10:29:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 10:29:09 +0000 Subject: [PATCH] osmo-bts[master]: octphy: Allow passing low quality buffers to upper layers Message-ID: Review at https://gerrit.osmocom.org/3078 octphy: Allow passing low quality buffers to upper layers We want to always call l1if_tch_rx in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 --- M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-octphy/l1_if.h M src/osmo-bts-octphy/l1_tch.c 3 files changed, 20 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3078/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8b31630..12a096b 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1026,6 +1026,7 @@ uint8_t sapi = (uint8_t) data_ind->LchId.bySAPI; uint8_t ts_num = (uint8_t) data_ind->LchId.byTimeslotNb; uint8_t sc = (uint8_t) data_ind->LchId.bySubChannelNb; + bool low_quality = false; /* FIXME: check min_qual_norm! */ /* Need to combine two 16bit MSB and LSB to form 32bit FN */ fn = data_ind->Data.ulFrameNumber; @@ -1050,8 +1051,6 @@ process_meas_res(trx, chan_nr, fn, data_ind->Data.ulDataLength, &data_ind->MeasurementInfo); - /* FIXME: check min_qual_norm! */ - DEBUGP(DL1C, "Rx PH-DATA.ind %s: %s data_len:%d \n", get_value_string(octphy_l1sapi_names, sapi), osmo_hexdump(data_ind->Data.abyDataContent, @@ -1062,10 +1061,18 @@ if (sapi == cOCTVC1_GSM_SAPI_ENUM_TCHF || sapi == cOCTVC1_GSM_SAPI_ENUM_TCHH) { /* TCH speech frame handling */ - rc = l1if_tch_rx(trx, chan_nr, data_ind); + rc = l1if_tch_rx(trx, chan_nr, data_ind, low_quality); return rc; } + /* Discard frames with bad quality payload only after making sure we + * signal upper layers for TCH frames, because it expects to always be + * notified even if the content of the frame is not correct, otherwise + * it losses events and the RTP clock drifts. */ + if (low_quality && data_ind->Data.ulDataLength != 0) { + return 0; + } + /* get rssi, rssi is in q8 format */ rssi = (int8_t) (data_ind->MeasurementInfo.sRSSIDbm >> 8); /* get data pointer and length */ diff --git a/src/osmo-bts-octphy/l1_if.h b/src/osmo-bts-octphy/l1_if.h index 0960482..c1b2e0a 100644 --- a/src/osmo-bts-octphy/l1_if.h +++ b/src/osmo-bts-octphy/l1_if.h @@ -102,7 +102,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, tOCTVC1_GSM_MSG_TRX_LOGICAL_CHANNEL_DATA_INDICATION_EVT * - data_ind); + data_ind, bool low_quality); struct gsm_bts_trx *trx_by_l1h(struct octphy_hdl *fl1h, unsigned int trx_id); diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 5693313..366df4f 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -183,7 +183,7 @@ /* brief receive a traffic L1 primitive for a given lchan */ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, tOCTVC1_GSM_MSG_TRX_LOGICAL_CHANNEL_DATA_INDICATION_EVT * - data_ind) + data_ind, bool low_quality) { uint32_t payload_type = data_ind->Data.ulPayloadType; uint8_t *payload = data_ind->Data.abyDataContent; @@ -193,11 +193,15 @@ struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; - if (data_ind->Data.ulDataLength < 1) { - LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + if (low_quality || data_ind->Data.ulDataLength < 1) { + LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size %u low_quality %d\n", + chan_nr, data_ind->Data.ulDataLength, low_quality); + + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1C-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->Data.ulFrameNumber); } + payload_len = data_ind->Data.ulDataLength; switch (payload_type) { -- To view, visit https://gerrit.osmocom.org/3078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 29 12:07:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 12:07:38 +0000 Subject: [PATCH] osmo-trx[master]: deb: remove unused dependency Message-ID: Review at https://gerrit.osmocom.org/3079 deb: remove unused dependency The libdbd dependency is not used because libsqlite3 is used directly - adjust debian/control to match. Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Related: OS#1929 --- M debian/control 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/79/3079/1 diff --git a/debian/control b/debian/control index 0e3b714..12da64a 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Build-Depends: debhelper (>= 9), autotools-dev, autoconf-archive, - libdbd-sqlite3, libsqlite3-dev, pkg-config, dh-autoreconf, @@ -20,7 +19,7 @@ Package: osmo-trx Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libdbd-sqlite3 +Depends: ${shlibs:Depends}, ${misc:Depends}, libsqlite3-0 Description: SDR transceiver that implements Layer 1 of a GSM BTS OsmoTRX is a software-defined radio transceiver that implements the Layer 1 physical layer of a BTS comprising the following 3GPP specifications: -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 29 12:22:21 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 29 Jun 2017 12:22:21 +0000 Subject: osmo-trx[master]: deb: remove unused dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2ab1facad703fa0c1d45084e70d41e73dbad6e7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 13:10:42 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 29 Jun 2017 13:10:42 +0000 Subject: [ABANDON] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: osmo-bts-litecell15: Fix missing frame number in MEAS IND ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Thu Jun 29 13:18:11 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 29 Jun 2017 13:18:11 +0000 Subject: [MERGED] osmo-bts[master]: Revert "sysmobts: normalize frame number in measurement indi... In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: Revert "sysmobts: normalize frame number in measurement indication" ...................................................................... Revert "sysmobts: normalize frame number in measurement indication" This reverts commit 88b2cc30a6a7253c2c4c76178e5727fad48556ca. Change-Id: I30f37a9feef24a45e254377502615d717dba9765 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 2 insertions(+), 10 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 f564836..837fc5c 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -897,14 +897,12 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_PhDataInd_t *data_ind) + uint32_t fn, GsmL1_MeasParam_t *m) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_INDICATION, NULL); - GsmL1_MeasParam_t *m = &data_ind->measParam; - l1sap.u.info.type = PRIM_INFO_MEAS; l1sap.u.info.u.meas_ind.chan_nr = chan_nr; l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; @@ -915,12 +913,6 @@ * physical radio link, the uplink is delayed by 3 timeslots, we need * to compensate for that delay. */ l1sap.u.info.u.meas_ind.fn = fn + 3; - - /* Align frame number with measurement period ends */ - if (data_ind->sapi == GsmL1_Sapi_TchF) - l1sap.u.info.u.meas_ind.fn += 1; - else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == GsmL1_SubCh_0) - l1sap.u.info.u.meas_ind.fn += 1; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -949,7 +941,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, data_ind); + process_meas_res(trx, chan_nr, fn, &data_ind->measParam); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/3050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30f37a9feef24a45e254377502615d717dba9765 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Jun 29 13:37:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:37:34 +0000 Subject: [PATCH] osmo-trx[master]: Add '-t' command line option to enable SCHED_RR Message-ID: Review at https://gerrit.osmocom.org/3080 Add '-t' command line option to enable SCHED_RR SCHED_RR allows us to operate osmo-trx reliable even under exceptionally high system load, as the realtime scheduler priority will have higher priority than the other "regular" tasks on the system. Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Closes: OS#2344 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 29 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/80/3080/1 diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 31a99cf..61b3098 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -77,6 +78,7 @@ double rssi_offset; bool swap_channels; bool edge; + int sched_rr; }; ConfigurationTable gConfig; @@ -259,7 +261,8 @@ " -r Random Normal Burst test mode with TSC\n" " -A Random Access Burst test mode with delay\n" " -R RSSI to dBm offset in dB (default=0)\n" - " -S Swap channels (UmTRX only)\n", + " -S Swap channels (UmTRX only)\n" + " -t SCHED_RR real-time priority (1..32)\n", "EMERG, ALERT, CRT, ERR, WARNING, NOTICE, INFO, DEBUG"); } @@ -283,8 +286,9 @@ config->rssi_offset = 0.0; config->swap_channels = false; config->edge = false; + config->sched_rr = -1; - while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Se")) != -1) { + while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Set:")) != -1) { switch (option) { case 'h': print_help(); @@ -343,6 +347,9 @@ case 'e': config->edge = true; break; + case 't': + config->sched_rr = atoi(optarg); + break; default: print_help(); exit(0); @@ -386,6 +393,21 @@ exit(0); } +static int set_sched_rr(int prio) +{ + struct sched_param param; + int rc; + memset(¶m, 0, sizeof(param)); + param.sched_priority = prio; + printf("Setting SCHED_RR priority(%d)\n", param.sched_priority); + rc = sched_setscheduler(getpid(), SCHED_RR, ¶m); + if (rc != 0) { + std::cerr << "Config: Setting SCHED_RR failed" << std::endl; + return -1; + } + return 0; +} + int main(int argc, char *argv[]) { int type, chans, ref; @@ -424,6 +446,11 @@ handle_options(argc, argv, &config); + if (config.sched_rr != -1) { + if (set_sched_rr(config.sched_rr) < 0) + return EXIT_FAILURE; + } + setup_signal_handlers(); /* Check database sanity */ -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 29 13:39:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:39:18 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: I would actually vote for making SCHED_RR a default, preferrably with an even higher priority (e.g. 10) than what we'd use as osmo-bts-trx, as osmo-trx is even more important to schedule than osmo-bts. What do you guys think? -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f 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 Thu Jun 29 13:41:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:41:33 +0000 Subject: osmo-bts[master]: octphy: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 1: why bother with the extra argument? A length of 0 bytes must mean a frame with invalid CRC. What other case for zero-length can you think of? -- To view, visit https://gerrit.osmocom.org/3078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Thu Jun 29 13:41:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:41:52 +0000 Subject: osmo-bts[master]: litecell15/tch.c: Clean up use of empty buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Thu Jun 29 13:42:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:42:06 +0000 Subject: osmo-bts[master]: sysmo: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/3056/3/src/osmo-bts-sysmo/l1_if.h File src/osmo-bts-sysmo/l1_if.h: Line 131: int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg, bool low_quality); why bother with the extra argument? A length of 0 bytes must mean a frame with invalid CRC. What other case for zero-length can you think of? -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 3 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 29 13:42:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:42:29 +0000 Subject: osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts 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 Thu Jun 29 13:43:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 13:43:39 +0000 Subject: libosmo-abis[master]: osmo_ortp: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3070/2/src/trau/osmo_ortp.c File src/trau/osmo_ortp.c: Line 449: int osmo_rtp_drop_frame(struct osmo_rtp_socket *rs, unsigned int duration) drop_frame() sounds like an imperative, i.e. the function will be dropping a frame. It's more a 'dropped_frame', i.e. we are telling the osmo_rtp code that a frame was droped? or something like skipped_frame? -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Thu Jun 29 14:10:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 14:10:54 +0000 Subject: osmo-bts[master]: octphy: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 1: > why bother with the extra argument? A length of 0 bytes must mean > a frame with invalid CRC. What other case for zero-length can you > think of? >From the FIXME in the code in l1_if.c, I understand that at some point we want to check for low quality link in a similar way as we do in sysmobts or litecell15. As that ocpthy specific code is not there yet, I still prepare the code to avoid potential bugs when it is implemented by already guiding where the check and return on error should be done. In the general case, afaik we have 2 different issues here where we don't want to decode the payload: payloadSize==0 or low_quality==true, which afaiu doesn't necessarily imply payloadSize==0 too. -- To view, visit https://gerrit.osmocom.org/3078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 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: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 14:12:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 14:12:27 +0000 Subject: libosmo-sccp[master]: Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == Callin... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic76aacc81f87f8885fe04121aead5c79a761ef07 Gerrit-PatchSet: 2 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 Jun 29 14:13:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 14:13:02 +0000 Subject: [MERGED] libosmo-sccp[master]: Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == Callin... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == CallingPartyAddress" ...................................................................... Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == CallingPartyAddress" This reverts commit 5527df78adc08b76df07c4b682263b5bdd6181d4. I tried some time to figure out what other changes are needed to make this commit work and fix a confusion, until I noticed: The commit's *log message* is correct that SRC == calling, but the *patch* modifies callED addr to be the SRC, which is wrong. So reverting this commit is indeed the correct way to fix our addresses. Change-Id: Ic76aacc81f87f8885fe04121aead5c79a761ef07 --- M src/sccp_scoc.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 9502953..628b63b 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -483,7 +483,7 @@ xua_msg_add_u32(xua, SUA_IEI_ROUTE_CTX, conn->inst->route_ctx); xua_msg_add_u32(xua, SUA_IEI_PROTO_CLASS, conn->sccp_class); xua_msg_add_u32(xua, SUA_IEI_SRC_REF, conn->conn_id); - xua_msg_add_sccp_addr(xua, SUA_IEI_SRC_ADDR, &conn->called_addr); + xua_msg_add_sccp_addr(xua, SUA_IEI_DEST_ADDR, &conn->called_addr); xua_msg_add_u32(xua, SUA_IEI_SEQ_CTRL, 0); /* TODO */ /* optional: sequence number (class 3 only) */ if (conn->calling_addr.presence) -- To view, visit https://gerrit.osmocom.org/3046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic76aacc81f87f8885fe04121aead5c79a761ef07 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 Thu Jun 29 14:51:52 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 29 Jun 2017 14:51:52 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: dexter has restored this change. Change subject: osmo-bts-litecell15: Fix missing frame number in MEAS IND ...................................................................... Restored -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: restore Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Thu Jun 29 14:58:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 14:58:43 +0000 Subject: [PATCH] osmo-bts[master]: l1sap: Don't enqueue PTCCH blocks for loopback Message-ID: Review at https://gerrit.osmocom.org/3081 l1sap: Don't enqueue PTCCH blocks for loopback When we're in loopback testing mode for PDTCH, we must make sure to avoid adding PTCCH blocks to the queue. Only PDTCH blocks must be enqueued. For the transmit (downlink) side, we already had the PTCCH check in place. Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/81/3081/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 85d1dd1..71690cd 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -967,7 +967,7 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); if (!lchan) LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); - if (lchan && lchan->loopback) { + if (lchan && lchan->loopback && !L1SAP_IS_PTCCH(fn)) { /* we are in loopback mode (for BER testing) * mode and need to enqeue the frame to be * returned in downlink */ -- To view, visit https://gerrit.osmocom.org/3081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 29 14:58:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 14:58:44 +0000 Subject: [PATCH] osmo-bts[master]: TRX: permit transmission of all-zero loopback frames Message-ID: Review at https://gerrit.osmocom.org/3082 TRX: permit transmission of all-zero loopback frames For some reason, osmo-bts-trx attempted to interpret/validate the contents of the downlink TCH block that it was about to transmit. If such checks are made, they should clearly be in the common part above L1SAP, and not in the bts-model specific part. Also, having the checks in place didn't allow us to send an all-zero downlink block, as is required for detection of uplink FER in a loopback testing setup, e.g. with CMU-300. Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 5 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/82/3082/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index a9bcbda..4c3330f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -471,42 +471,15 @@ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR / HR */ - if (chan != TRXC_TCHF) { /* HR */ + if (chan != TRXC_TCHF) /* HR */ len = 15; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] & 0xf0) != 0x00) { - LOGP(DL1C, LOGL_NOTICE, "%s " - "Transmitting 'bad " - "HR frame' trx=%u ts=%u at " - "fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } - break; - } - len = GSM_FR_BYTES; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] >> 4) != 0xd) { - LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " - "FR frame' trx=%u ts=%u at fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } + else + len = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ if (chan != TRXC_TCHF) goto inval_mode2; len = GSM_EFR_BYTES; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] >> 4) != 0xc) { - LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " - "EFR frame' trx=%u ts=%u at fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ len = osmo_amr_rtp_dec(msg_tch->l2h, msgb_l2len(msg_tch), @@ -1146,10 +1119,12 @@ if (lchan->tch.dtx.ul_sid) return 0; /* DTXu: pause in progress */ memset(tch_data, 0, GSM_FR_BYTES); + tch_data[0] = 0xd0; rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ memset(tch_data, 0, GSM_EFR_BYTES); + tch_data[0] = 0xc0; rc = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ -- To view, visit https://gerrit.osmocom.org/3082 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 29 15:01:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 15:01:29 +0000 Subject: osmo-bts[master]: TRX: permit transmission of all-zero loopback frames In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3082 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5 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 Thu Jun 29 15:01:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 29 Jun 2017 15:01:35 +0000 Subject: osmo-bts[master]: l1sap: Don't enqueue PTCCH blocks for loopback In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f 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 Thu Jun 29 15:27:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 15:27:43 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3070 to look at the new patch set (#3). osmo_ortp: Add osmo_rtp_drop_frame API This API will be used by osmo-bts to maintain the sampling clock of the RTP socket whenever a frame should be sent but it is not available, for instance due to low quality of signal. Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 --- M include/osmocom/trau/osmo_ortp.h M src/trau/osmo_ortp.c 2 files changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/70/3070/3 diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index 9eb176f..578b1cb 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -76,6 +76,7 @@ int osmo_rtp_socket_connect(struct osmo_rtp_socket *rs, const char *ip, uint16_t port); int osmo_rtp_socket_set_pt(struct osmo_rtp_socket *rs, int payload_type); int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); +int osmo_rtp_skipped_frame(struct osmo_rtp_socket *rs, unsigned int duration); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration); int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index b2ee040..c9480ff 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -436,6 +436,28 @@ return osmo_rtp_socket_fdreg(rs); } +/*! \brief Increment timestamp on a RTP socket without sending any packet + * \param[in] rs OsmoRTP socket + * \param[in] duration duration in number of RTP clock ticks + * + * Useful to keep the RTP internal clock up to date if an RTP frame should be + * send at a given time but no audio content is available. When next packet is + * sent, the receiver will see a different increase on the sequence number and + * the timestamp, and it should then take it as a synchronization point. For + * that same reason, it is advisable to enable the marker bit on the next RTP + * packet to be sent after calling this function. + * + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_skipped_frame(struct osmo_rtp_socket *rs, unsigned int duration) +{ + if (rs->flags & OSMO_RTP_F_DISABLED) + return 0; + + rs->tx_timestamp += duration; + return 0; +} + /*! \brief Send one RTP frame via a RTP socket * \param[in] rs OsmoRTP socket * \param[in] payload pointer to buffer with RTP payload data -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Thu Jun 29 15:29:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 15:29:00 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload 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/3071 to look at the new patch set (#4). l1sap.c: Avoid sending RTP frame with empty payload Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc --- M src/common/l1sap.c 1 file changed, 24 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3071/4 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1fb6134..80fafb8 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1011,22 +1011,32 @@ msgb_pull(msg, sizeof(*l1sap)); - /* hand msg to RTP code for transmission */ - if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); - - /* if loopback is enabled, also queue received RTP data */ - if (lchan->loopback) { - /* make sure the queue doesn't get too long */ - queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); - /* add new frame to queue */ - msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ - return 1; + /* Low level layers always call us when TCH content is expected to be + * available, even if the content is not available due to decoding + * issues. Content not available is expected as empty payload. */ + if (msg->len) { + /* hand msg to RTP code for transmission */ + if (lchan->abis_ip.rtp_socket) + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); + /* if loopback is enabled, also queue received RTP data */ + if (lchan->loopback) { + /* make sure the queue doesn't get too long */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ + msgb_enqueue(&lchan->dl_tch_queue, msg); + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; + } + /* Only clear the marker bit once we have sent a RTP packet with it */ + lchan->rtp_tx_marker = false; + } else { + DEBUGP(DL1P, "Skipping RTP frame with lost payload\n"); + if (lchan->abis_ip.rtp_socket) + osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, fn_ms_adj(fn, lchan)); + lchan->rtp_tx_marker = true; } - lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Jun 29 15:33:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 15:33:25 +0000 Subject: osmo-bts[master]: l1sap: Don't enqueue PTCCH blocks for loopback In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Thu Jun 29 15:44:01 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 29 Jun 2017 15:44:01 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2813 to look at the new patch set (#5). osmo-bts-trx: fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-trx does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/13/2813/5 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index a7bcd2c..3517787 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -528,7 +528,7 @@ void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, - float ber, float rssi) + float ber, float rssi, uint32_t fn) { memset(l1sap, 0, sizeof(*l1sap)); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, @@ -538,6 +538,7 @@ l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); + l1sap->u.info.u.meas_ind.fn = fn; } int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, @@ -553,7 +554,7 @@ gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); - l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn); return l1sap_up(trx, &l1sap); } diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 1864857..fdc40f2 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -69,7 +69,7 @@ int l1if_provision_transceiver(struct gsm_bts *bts); int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, - float ber, float rssi); + float ber, float rssi, uint32_t fn); int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, int n_errors, int n_bits_total, float rssi, float toa); -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Jun 29 15:44:01 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 29 Jun 2017 15:44:01 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND 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/2861 to look at the new patch set (#5). osmo-bts-litecell15: Fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. change process_meas_res() to properly include the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap) Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/5 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 71bb833..d6cffc9 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -901,7 +901,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + GsmL1_MeasParam_t *m, uint32_t fn) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -912,6 +912,7 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + l1sap.u.info.u.meas_ind.fn = fn; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +942,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, &data_ind->measParam, fn); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Thu Jun 29 17:05:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 17:05:23 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_ortp.c: Duration of a RTP frame affects timestamp of th... Message-ID: Review at https://gerrit.osmocom.org/3083 osmo_ortp.c: Duration of a RTP frame affects timestamp of the next one Duration of an RTP frames dictates the timestamp used for the next frame, not for the one being sent now. It was done like this before to account for possible losses. Implementation wise, the duration was understood as "duration between last frame was sent and now when current one is sent". It makes more sense to use it as the duration in number of sampling ticks as described on the function documentation, specially now that we can account for extra time by means of osmo_rtp_skipped_frame. Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548 --- M src/trau/osmo_ortp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/83/3083/1 diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c9480ff..c49a23d 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -496,9 +496,9 @@ return -ENOMEM; rtp_set_markbit(mblk, marker); - rs->tx_timestamp += duration; rc = rtp_session_sendm_with_ts(rs->sess, mblk, rs->tx_timestamp); + rs->tx_timestamp += duration; if (rc < 0) { /* no need to free() the mblk, as rtp_session_rtp_send() * unconditionally free()s the mblk even in case of -- To view, visit https://gerrit.osmocom.org/3083 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 29 17:06:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 29 Jun 2017 17:06:05 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... Message-ID: Review at https://gerrit.osmocom.org/3084 l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION After latest changes, l2 expects to receive an event for every TCH frame, that is, no TCH frame event should be lost on that layer. We should now then be safe returning always GSM_RTP_DURATION. The code which used to calculate the variable duration is left there to assert that indeed we are not longer having this kind of issues. Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 --- M src/common/l1sap.c 1 file changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/84/3084/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 80fafb8..a2aef9f 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -77,10 +77,6 @@ { uint32_t samples_passed, r; - /* don't adjust duration when DTX is not enabled */ - if (lchan->ts->trx->bts->dtxu == GSM48_DTX_SHALL_NOT_BE_USED) - return GSM_RTP_DURATION; - if (lchan->tch.last_fn != LCHAN_FN_DUMMY) { /* 12/13 frames usable for audio in TCH, 160 samples per RTP packet, @@ -90,7 +86,9 @@ GSM_RTP_DURATION */ r = samples_passed + GSM_RTP_DURATION / 2; r -= r % GSM_RTP_DURATION; - return r; + + if (r != GSM_RTP_DURATION) + LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with lower layer!\n"); } return GSM_RTP_DURATION; } -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jun 29 17:47:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 29 Jun 2017 17:47:55 +0000 Subject: [PATCH] osmo-gsm-tester[master]: jenkins: build msc using libosmo-sccp master Message-ID: Review at https://gerrit.osmocom.org/3085 jenkins: build msc using libosmo-sccp master Since 81c0bcab068174036f6897e69311f413d94c74d4 was merged, it is not necessary to build the neels/aoip branch anymore. Other patches on that branch are not necessary either. Change-Id: I850e0dd2fc61d59d56c0dd69ee00b6e19685fb95 --- M contrib/jenkins-build-osmo-msc.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/85/3085/1 diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh index 53a23fe..f9710c0 100755 --- a/contrib/jenkins-build-osmo-msc.sh +++ b/contrib/jenkins-build-osmo-msc.sh @@ -9,7 +9,7 @@ build_repo libosmo-netif build_repo openggsn build_repo libsmpp34 -build_repo libosmo-sccp neels/aoip # TEMPORARY BRANCH +build_repo libosmo-sccp build_repo libasn1c build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu -- To view, visit https://gerrit.osmocom.org/3085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I850e0dd2fc61d59d56c0dd69ee00b6e19685fb95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 29 17:52:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 29 Jun 2017 17:52:04 +0000 Subject: libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp 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 Jun 29 17:52:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 29 Jun 2017 17:52:08 +0000 Subject: [MERGED] libosmo-sccp[master]: fix compiler warning: xua_test: hexdump pointer type In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix compiler warning: xua_test: hexdump pointer type ...................................................................... fix compiler warning: xua_test: hexdump pointer type Was recently introduced by a70b4599f63b50c4d654eb9e1b1a099a7c8cdc36. Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 --- M tests/xua/xua_test.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index 4af0836..c496cc4 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -155,7 +155,7 @@ printf("Testing Decoded GT -> SUA encoding\n"); printf("IN: %s\n", osmo_sccp_gt_dump(gt_in)); - printf(" %s\n", osmo_hexdump_nospc(gt_in, sizeof(struct osmo_sccp_gt))); + printf(" %s\n", osmo_hexdump_nospc((const unsigned char*)gt_in, sizeof(struct osmo_sccp_gt))); /* encode sccp_addr to SUA GT */ xua_part_add_gt(msg, gt_in); @@ -168,7 +168,7 @@ /* parse + compare */ sua_parse_gt(>_out, msgb_data(msg), msgb_length(msg)); printf("OUT:%s\n", osmo_sccp_gt_dump(>_out)); - printf(" %s\n", osmo_hexdump_nospc(>_out, sizeof(struct osmo_sccp_gt))); + printf(" %s\n", osmo_hexdump_nospc((const unsigned char*)>_out, sizeof(struct osmo_sccp_gt))); OSMO_ASSERT(!memcmp(gt_in, >_out, sizeof(gt_out))); msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/3030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp 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 Thu Jun 29 17:57:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 29 Jun 2017 17:57:32 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_helpers.h: remove duplicate declaration of osmo_sccp_ma... Message-ID: Review at https://gerrit.osmocom.org/3086 sccp_helpers.h: remove duplicate declaration of osmo_sccp_make_addr_pc_ssn() Change-Id: Ifbb03de3df3b9bac86fb97dfc8e81e99fc172292 --- M include/osmocom/sigtran/sccp_helpers.h 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/86/3086/1 diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h index bbd0364..ecf583e 100644 --- a/include/osmocom/sigtran/sccp_helpers.h +++ b/include/osmocom/sigtran/sccp_helpers.h @@ -4,8 +4,6 @@ #include #include -void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn); - int osmo_sccp_tx_unitdata(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, -- To view, visit https://gerrit.osmocom.org/3086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbb03de3df3b9bac86fb97dfc8e81e99fc172292 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 29 18:30:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 18:30:31 +0000 Subject: [PATCH] libosmocore[master]: Add missing BSSGP cause values Message-ID: Review at https://gerrit.osmocom.org/3087 Add missing BSSGP cause values Add values from 3GPP TS 48.018 Change-Id: Ie39a6c91a46d179392d861805a106743a07c6fb0 --- M include/osmocom/gprs/protocol/gsm_08_18.h M src/gb/gprs_bssgp_util.c 2 files changed, 114 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/3087/1 diff --git a/include/osmocom/gprs/protocol/gsm_08_18.h b/include/osmocom/gprs/protocol/gsm_08_18.h index 3179455..af6caf3 100644 --- a/include/osmocom/gprs/protocol/gsm_08_18.h +++ b/include/osmocom/gprs/protocol/gsm_08_18.h @@ -120,24 +120,61 @@ /*! Cause coding (Section 11.3.8 / Table 11.10) */ enum gprs_bssgp_cause { - BSSGP_CAUSE_PROC_OVERLOAD = 0x00, - BSSGP_CAUSE_EQUIP_FAIL = 0x01, - BSSGP_CAUSE_TRASIT_NET_FAIL = 0x02, - BSSGP_CAUSE_CAPA_GREATER_0KPBS = 0x03, - BSSGP_CAUSE_UNKNOWN_MS = 0x04, - BSSGP_CAUSE_UNKNOWN_BVCI = 0x05, - BSSGP_CAUSE_CELL_TRAF_CONG = 0x06, - BSSGP_CAUSE_SGSN_CONG = 0x07, - BSSGP_CAUSE_OML_INTERV = 0x08, - BSSGP_CAUSE_BVCI_BLOCKED = 0x09, - BSSGP_CAUSE_PFC_CREATE_FAIL = 0x0a, - BSSGP_CAUSE_SEM_INCORR_PDU = 0x20, - BSSGP_CAUSE_INV_MAND_INF = 0x21, - BSSGP_CAUSE_MISSING_MAND_IE = 0x22, - BSSGP_CAUSE_MISSING_COND_IE = 0x23, - BSSGP_CAUSE_UNEXP_COND_IE = 0x24, - BSSGP_CAUSE_COND_IE_ERR = 0x25, - BSSGP_CAUSE_PDU_INCOMP_STATE = 0x26, - BSSGP_CAUSE_PROTO_ERR_UNSPEC = 0x27, - BSSGP_CAUSE_PDU_INCOMP_FEAT = 0x28, + BSSGP_CAUSE_PROC_OVERLOAD = 0x00, + BSSGP_CAUSE_EQUIP_FAIL = 0x01, + BSSGP_CAUSE_TRASIT_NET_FAIL = 0x02, + BSSGP_CAUSE_CAPA_GREATER_0KPBS = 0x03, + BSSGP_CAUSE_UNKNOWN_MS = 0x04, + BSSGP_CAUSE_UNKNOWN_BVCI = 0x05, + BSSGP_CAUSE_CELL_TRAF_CONG = 0x06, + BSSGP_CAUSE_SGSN_CONG = 0x07, + BSSGP_CAUSE_OML_INTERV = 0x08, + BSSGP_CAUSE_BVCI_BLOCKED = 0x09, + BSSGP_CAUSE_PFC_CREATE_FAIL = 0x0a, + BSSGP_CAUSE_PFC_PREEMPTED = 0x0b, + BSSGP_CAUSE_ABQP_NOT_SUPP = 0x0c, + BSSGP_CAUSE_SEM_INCORR_PDU = 0x20, + BSSGP_CAUSE_INV_MAND_INF = 0x21, + BSSGP_CAUSE_MISSING_MAND_IE = 0x22, + BSSGP_CAUSE_MISSING_COND_IE = 0x23, + BSSGP_CAUSE_UNEXP_COND_IE = 0x24, + BSSGP_CAUSE_COND_IE_ERR = 0x25, + BSSGP_CAUSE_PDU_INCOMP_STATE = 0x26, + BSSGP_CAUSE_PROTO_ERR_UNSPEC = 0x27, + BSSGP_CAUSE_PDU_INCOMP_FEAT = 0x28, + BSSGP_CAUSE_REQ_INFO_NOT_AVAIL = 0x29, + BSSGP_CAUSE_UNKN_DST = 0x2a, + BSSGP_CAUSE_UNKN_RIM_AI = 0x2b, + BSSGP_CAUSE_INVAL_CONT_UI = 0x2c, + BSSGP_CAUSE_PFC_QUEUE = 0x2d, + BSSGP_CAUSE_PFC_CREATED = 0x2e, + BSSGP_CAUSE_T12_EXPIRY = 0x2f, + BSSGP_CAUSE_MS_UNDER_PS_HO = 0x30, + BSSGP_CAUSE_UL_QUALITY = 0x31, + BSSGP_CAUSE_UL_STRENGTH = 0x32, + BSSGP_CAUSE_DL_QUALITY = 0x33, + BSSGP_CAUSE_DL_STRENGTH = 0x34, + BSSGP_CAUSE_DISTANCE = 0x35, + BSSGP_CAUSE_BETTER_CELL = 0x36, + BSSGP_CAUSE_TRAFFIC = 0x37, + BSSGP_CAUSE_MS_RADIO_LOSS = 0x38, + BSSGP_CAUSE_MS_BACK_OLD_CHAN = 0x39, + BSSGP_CAUSE_T13_EXPIRY = 0x3a, + BSSGP_CAUSE_T14_EXPIRY = 0x3b, + BSSGP_CAUSE_NOT_ALL_PFC = 0x3c, + BSSGP_CAUSE_CS = 0x3d, + BSSGP_CAUSE_REQ_ALG_NOT_SUPP = 0x3e, + BSSGP_CAUSE_RELOC_FAIL = 0x3f, + BSSGP_CAUSE_DIR_RETRY = 0x40, + BSSGP_CAUSE_TIME_CRIT_RELOC = 0x41, + BSSGP_CAUSE_PS_HO_TARG_NA = 0x42, + BSSGP_CAUSE_PS_HO_TARG_NOT_SUPP = 0x43, + BSSGP_CAUSE_PUESBINE = 0x44, + BSSGP_CAUSE_DTM_HO_NO_CS_RES = 0x45, + BSSGP_CAUSE_DTM_HO_PS_ALLOC_FAIL = 0x46, + BSSGP_CAUSE_DTM_HO_T24_EXPIRY = 0x47, + BSSGP_CAUSE_DTM_HO_INVAL_CS_IND = 0x48, + BSSGP_CAUSE_DTM_HO_T23_EXPIRY = 0x49, + BSSGP_CAUSE_DTM_HO_MSC_ERR = 0x4a, + BSSGP_CAUSE_INVAL_CSG_CELL = 0x4b, }; diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c index 78a11a3..4553da8 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -39,26 +39,63 @@ /* Chapter 11.3.9 / Table 11.10: Cause coding */ static const struct value_string bssgp_cause_strings[] = { - { BSSGP_CAUSE_PROC_OVERLOAD, "Processor overload" }, - { BSSGP_CAUSE_EQUIP_FAIL, "Equipment Failure" }, - { BSSGP_CAUSE_TRASIT_NET_FAIL, "Transit netowkr service failure" }, - { BSSGP_CAUSE_CAPA_GREATER_0KPBS,"Transmission capacity modified" }, - { BSSGP_CAUSE_UNKNOWN_MS, "Unknown MS" }, - { BSSGP_CAUSE_UNKNOWN_BVCI, "Unknown BVCI" }, - { BSSGP_CAUSE_CELL_TRAF_CONG, "Cell traffic congestion" }, - { BSSGP_CAUSE_SGSN_CONG, "SGSN congestion" }, - { BSSGP_CAUSE_OML_INTERV, "O&M intervention" }, - { BSSGP_CAUSE_BVCI_BLOCKED, "BVCI blocked" }, - { BSSGP_CAUSE_PFC_CREATE_FAIL, "PFC create failure" }, - { BSSGP_CAUSE_SEM_INCORR_PDU, "Semantically incorrect PDU" }, - { BSSGP_CAUSE_INV_MAND_INF, "Invalid mandatory information" }, - { BSSGP_CAUSE_MISSING_MAND_IE, "Missing mandatory IE" }, - { BSSGP_CAUSE_MISSING_COND_IE, "Missing conditional IE" }, - { BSSGP_CAUSE_UNEXP_COND_IE, "Unexpected conditional IE" }, - { BSSGP_CAUSE_COND_IE_ERR, "Conditional IE error" }, - { BSSGP_CAUSE_PDU_INCOMP_STATE, "PDU incompatible with protocol state" }, - { BSSGP_CAUSE_PROTO_ERR_UNSPEC, "Protocol error - unspecified" }, - { BSSGP_CAUSE_PDU_INCOMP_FEAT, "PDU not compatible with feature set" }, + { BSSGP_CAUSE_PROC_OVERLOAD, "Processor overload" }, + { BSSGP_CAUSE_EQUIP_FAIL, "Equipment Failure" }, + { BSSGP_CAUSE_TRASIT_NET_FAIL, "Transit netowkr service failure" }, + { BSSGP_CAUSE_CAPA_GREATER_0KPBS, "Transmission capacity modified" }, + { BSSGP_CAUSE_UNKNOWN_MS, "Unknown MS" }, + { BSSGP_CAUSE_UNKNOWN_BVCI, "Unknown BVCI" }, + { BSSGP_CAUSE_CELL_TRAF_CONG, "Cell traffic congestion" }, + { BSSGP_CAUSE_SGSN_CONG, "SGSN congestion" }, + { BSSGP_CAUSE_OML_INTERV, "O&M intervention" }, + { BSSGP_CAUSE_BVCI_BLOCKED, "BVCI blocked" }, + { BSSGP_CAUSE_PFC_CREATE_FAIL, "PFC create failure" }, + { BSSGP_CAUSE_PFC_PREEMPTED, "PFC preempted" }, + { BSSGP_CAUSE_ABQP_NOT_SUPP, "ABQP no more supported" }, + { BSSGP_CAUSE_SEM_INCORR_PDU, "Semantically incorrect PDU" }, + { BSSGP_CAUSE_INV_MAND_INF, "Invalid mandatory information" }, + { BSSGP_CAUSE_MISSING_MAND_IE, "Missing mandatory IE" }, + { BSSGP_CAUSE_MISSING_COND_IE, "Missing conditional IE" }, + { BSSGP_CAUSE_UNEXP_COND_IE, "Unexpected conditional IE" }, + { BSSGP_CAUSE_COND_IE_ERR, "Conditional IE error" }, + { BSSGP_CAUSE_PDU_INCOMP_STATE, "PDU incompatible with protocol state" }, + { BSSGP_CAUSE_PROTO_ERR_UNSPEC, "Protocol error - unspecified" }, + { BSSGP_CAUSE_PDU_INCOMP_FEAT, "PDU not compatible with feature set" }, + { BSSGP_CAUSE_REQ_INFO_NOT_AVAIL, "Requested Information not available" }, + { BSSGP_CAUSE_UNKN_DST , "Unknown Destination address" }, + { BSSGP_CAUSE_UNKN_RIM_AI, "Unknown RIM Application Identity or RIM application disabled" }, + { BSSGP_CAUSE_INVAL_CONT_UI, "Invalid Container Unit Information" }, + { BSSGP_CAUSE_PFC_QUEUE, "PFC queuing" }, + { BSSGP_CAUSE_PFC_CREATED, "PFC created successfully" }, + { BSSGP_CAUSE_T12_EXPIRY, "T12 expiry" }, + { BSSGP_CAUSE_MS_UNDER_PS_HO, "MS under PS Handover treatment" }, + { BSSGP_CAUSE_UL_QUALITY, "Uplink quality" }, + { BSSGP_CAUSE_UL_STRENGTH, "Uplink strength" }, + { BSSGP_CAUSE_DL_QUALITY, "Downlink quality" }, + { BSSGP_CAUSE_DL_STRENGTH, "Downlink strength" }, + { BSSGP_CAUSE_DISTANCE, "Distance" }, + { BSSGP_CAUSE_BETTER_CELL, "Better cell" }, + { BSSGP_CAUSE_TRAFFIC, "Traffic" }, + { BSSGP_CAUSE_MS_RADIO_LOSS, "Radio contact lost with MS" }, + { BSSGP_CAUSE_MS_BACK_OLD_CHAN, "MS back on old channel" }, + { BSSGP_CAUSE_T13_EXPIRY, "T13 expiry" }, + { BSSGP_CAUSE_T14_EXPIRY, "T14 expiry" }, + { BSSGP_CAUSE_NOT_ALL_PFC, "Not all requested PFCs created" }, + { BSSGP_CAUSE_CS, "CS cause" }, + { BSSGP_CAUSE_REQ_ALG_NOT_SUPP, "Requested ciphering and/or integrity protection algorithms not supported" }, + { BSSGP_CAUSE_RELOC_FAIL, "Relocation failure in target system" }, + { BSSGP_CAUSE_DIR_RETRY , "Directed Retry" }, + { BSSGP_CAUSE_TIME_CRIT_RELOC , "Time critical relocation" }, + { BSSGP_CAUSE_PS_HO_TARG_NA , "PS Handover Target not allowed" }, + { BSSGP_CAUSE_PS_HO_TARG_NOT_SUPP, "PS Handover not Supported in Target BSS or Target System" }, + { BSSGP_CAUSE_PUESBINE, "Incoming relocation not supported due to PUESBINE feature" }, + { BSSGP_CAUSE_DTM_HO_NO_CS_RES, "DTM Handover - No CS resource" }, + { BSSGP_CAUSE_DTM_HO_PS_ALLOC_FAIL, "DTM Handover - PS Allocation failure" }, + { BSSGP_CAUSE_DTM_HO_T24_EXPIRY, "DTM Handover - T24 expiry" }, + { BSSGP_CAUSE_DTM_HO_INVAL_CS_IND, "DTM Handover - Invalid CS Indication IE" }, + { BSSGP_CAUSE_DTM_HO_T23_EXPIRY, "DTM Handover - T23 expiry" }, + { BSSGP_CAUSE_DTM_HO_MSC_ERR, "DTM Handover - MSC Error" }, + { BSSGP_CAUSE_INVAL_CSG_CELL, "Invalid CSG cell" }, { 0, NULL }, }; -- To view, visit https://gerrit.osmocom.org/3087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie39a6c91a46d179392d861805a106743a07c6fb0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 29 18:30:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 18:30:31 +0000 Subject: [PATCH] libosmocore[master]: BSSGP: add function to reset all PTP BVC Message-ID: Review at https://gerrit.osmocom.org/3088 BSSGP: add function to reset all PTP BVC Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Related: OS#1638 --- M include/osmocom/gprs/gprs_bssgp_bss.h M src/gb/gprs_bssgp.c M src/gb/libosmogb.map 3 files changed, 27 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/3088/1 diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index 9374e73..74211fd 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,7 +26,7 @@ #include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); - +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause); int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 8daf39f..92cd5ad 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -77,6 +77,31 @@ return NULL; } +/*! Initiate reset procedure for all PTP BVC on a given NSEI. + * + * This function initiates reset procedure for all PTP BVC with a given cause. + * \param[in] nsei NSEI to which PTP BVC should belong to + * \param[in] cause Cause of BVC RESET + * \returns 0 on success, negative error code otherwise + */ +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause) +{ + int rc; + struct bssgp_bvc_ctx *bctx; + + llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) { + if (bctx->nsei == nsei && bctx->bvci != BVCI_SIGNALLING) { + LOGP(DBSSGP, LOGL_DEBUG, "NSEI=%u/BVCI=%u RESET due to %s\n", + nsei, bctx->bvci, bssgp_cause_str(cause)); + rc = bssgp_tx_bvc_reset(bctx, bctx->bvci, cause); + if (rc < 0) + return rc; + } + } + + return 0; +} + /* Find a BTS context based on BVCI+NSEI tuple */ struct bssgp_bvc_ctx *btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei) { diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 6aad8fd..9a0dba5 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -34,6 +34,7 @@ bssgp_rx_paging; bssgp_set_log_ss; bssgp_tx_dl_ud; +bssgp_tx_bvc_ptp_reset; bssgp_tx_paging; bssgp_vty_init; bssgp_nsi; -- To view, visit https://gerrit.osmocom.org/3088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 29 18:30:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 18:30:42 +0000 Subject: [PATCH] osmo-pcu[master]: BSSGP: Use libosmocore for BVC-RESET Message-ID: Review at https://gerrit.osmocom.org/3089 BSSGP: Use libosmocore for BVC-RESET Implement proper BVC RESET procedure by using libosmocore code to handle BVCI reset and initiate PTP BVC reset if necessary. Related: OS#1638 Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 22 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/89/3089/1 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index d3c8491..437479b 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -325,14 +325,15 @@ struct bssgp_ud_hdr *budh = (struct bssgp_ud_hdr *) msgb_bssgph(msg); struct tlv_parsed tp; enum bssgp_pdu_type pdu_type = (enum bssgp_pdu_type) bgph->pdu_type; - uint16_t ns_bvci = msgb_bvci(msg); + enum gprs_bssgp_cause cause = BSSGP_CAUSE_OML_INTERV; + uint16_t ns_bvci = msgb_bvci(msg), nsei = msgb_nsei(msg); int data_len; int rc = 0; struct bssgp_bvc_ctx *bctx; if (pdu_type == BSSGP_PDUT_STATUS) /* Pass the message to the generic BSSGP parser, which handles - * STATUS message in either direction. */ + * STATUS and RESET messages in either direction. */ return bssgp_rcvmsg(msg); /* Identifiers from DOWN: NSEI, BVCI (both in msg->cb) */ @@ -349,6 +350,23 @@ rc = bssgp_tlv_parse(&tp, budh->data, data_len); } + if (pdu_type == BSSGP_PDUT_BVC_RESET) { + rc = bssgp_rcvmsg(msg); + if (ns_bvci != BVCI_SIGNALLING) + return rc; + + if (TLVP_PRES_LEN(&tp, BSSGP_IE_CAUSE, 1)) + cause = (enum gprs_bssgp_cause)*TLVP_VAL(&tp, BSSGP_IE_CAUSE); + else + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u BVC RESET without cause?!\n", nsei); + + rc = bssgp_tx_bvc_ptp_reset(nsei, cause); + if (rc < 0) + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u BVC PTP reset procedure failed: %d\n", nsei, rc); + + return rc; + } + /* look-up or create the BTS context for this BVC */ bctx = btsctx_by_bvci_nsei(ns_bvci, msgb_nsei(msg)); @@ -357,9 +375,8 @@ && pdu_type != BSSGP_PDUT_BVC_UNBLOCK_ACK && pdu_type != BSSGP_PDUT_PAGING_PS) { - LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU " - "type %s for unknown BVCI\n", msgb_nsei(msg), ns_bvci, - bssgp_pdu_str(pdu_type)); + LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU type %s for unknown BVCI\n", + nsei, ns_bvci, bssgp_pdu_str(pdu_type)); return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, NULL, msg); } -- To view, visit https://gerrit.osmocom.org/3089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 29 18:34:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 18:34:41 +0000 Subject: osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Patch Set 1: Have it been tested with DTX active? -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 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 Thu Jun 29 18:39:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 29 Jun 2017 18:39:32 +0000 Subject: [PATCH] libosmocore[master]: BSSGP: add function to reset all PTP BVC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3088 to look at the new patch set (#2). BSSGP: add function to reset all PTP BVC Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Related: OS#1638 --- M include/osmocom/gprs/gprs_bssgp_bss.h M src/gb/gprs_bssgp.c M src/gb/libosmogb.map 3 files changed, 28 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/3088/2 diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index 9374e73..74211fd 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,7 +26,7 @@ #include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); - +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause); int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 8daf39f..2552849 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -35,6 +35,7 @@ #include #include +#include #include #include "common_vty.h" @@ -77,6 +78,31 @@ return NULL; } +/*! Initiate reset procedure for all PTP BVC on a given NSEI. + * + * This function initiates reset procedure for all PTP BVC with a given cause. + * \param[in] nsei NSEI to which PTP BVC should belong to + * \param[in] cause Cause of BVC RESET + * \returns 0 on success, negative error code otherwise + */ +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause) +{ + int rc; + struct bssgp_bvc_ctx *bctx; + + llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) { + if (bctx->nsei == nsei && bctx->bvci != BVCI_SIGNALLING) { + LOGP(DBSSGP, LOGL_DEBUG, "NSEI=%u/BVCI=%u RESET due to %s\n", + nsei, bctx->bvci, bssgp_cause_str(cause)); + rc = bssgp_tx_bvc_reset(bctx, bctx->bvci, cause); + if (rc < 0) + return rc; + } + } + + return 0; +} + /* Find a BTS context based on BVCI+NSEI tuple */ struct bssgp_bvc_ctx *btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei) { diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 6aad8fd..9a0dba5 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -34,6 +34,7 @@ bssgp_rx_paging; bssgp_set_log_ss; bssgp_tx_dl_ud; +bssgp_tx_bvc_ptp_reset; bssgp_tx_paging; bssgp_vty_init; bssgp_nsi; -- To view, visit https://gerrit.osmocom.org/3088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Thu Jun 29 19:54:40 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 29 Jun 2017 19:54:40 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <59555b28c46f4_112212f4f80227796@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: [ 223s] | [ 223s] | This file was extended by libosmocore config.status 0.9.6.20170629, which was [ 223s] | generated by GNU Autoconf 2.69. Invocation command line was [ 223s] | [ 223s] | CONFIG_FILES = [ 223s] | CONFIG_HEADERS = [ 223s] | CONFIG_LINKS = [ 223s] | CONFIG_COMMANDS = [ 223s] | $ ./config.status Doxyfile.core [ 223s] | [ 223s] | on cumulus2 [ 223s] | [ 223s] | config.status:1171: creating Doxyfile.core [ 223s] [ 223s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 223s] make[1]: *** [override_dh_auto_test] Error 1 [ 223s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 223s] debian/rules:15: recipe for target 'build' failed [ 223s] make: *** [build] Error 2 [ 223s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 223s] [ 223s] cumulus2 failed "build libosmocore_0.9.6.20170629.dsc" at Thu Jun 29 19:54:22 UTC 2017. [ 223s] [ 223s] ### VM INTERACTION START ### [ 226s] [ 206.600870] reboot: Power down [ 226s] ### VM INTERACTION END ### [ 226s] [ 226s] cumulus2 failed "build libosmocore_0.9.6.20170629.dsc" at Thu Jun 29 19:54:26 UTC 2017. [ 226s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Thu Jun 29 19:54:40 2017 From: admin at opensuse.org (OBS Notification) Date: Thu, 29 Jun 2017 19:54:40 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <59555b2844ea9_112212f4f8022765@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 212s] | [ 212s] | This file was extended by libosmocore config.status 0.9.6.20170629, which was [ 212s] | generated by GNU Autoconf 2.69. Invocation command line was [ 212s] | [ 212s] | CONFIG_FILES = [ 212s] | CONFIG_HEADERS = [ 212s] | CONFIG_LINKS = [ 212s] | CONFIG_COMMANDS = [ 212s] | $ ./config.status Doxyfile.core [ 212s] | [ 212s] | on build35 [ 212s] | [ 212s] | config.status:1171: creating Doxyfile.core [ 212s] [ 212s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 212s] make[1]: *** [override_dh_auto_test] Error 1 [ 212s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 212s] debian/rules:15: recipe for target 'build' failed [ 212s] make: *** [build] Error 2 [ 212s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 212s] [ 212s] build35 failed "build libosmocore_0.9.6.20170629.dsc" at Thu Jun 29 19:54:17 UTC 2017. [ 212s] [ 212s] ### VM INTERACTION START ### [ 215s] [ 196.479529] reboot: Power down [ 216s] ### VM INTERACTION END ### [ 216s] [ 216s] build35 failed "build libosmocore_0.9.6.20170629.dsc" at Thu Jun 29 19:54:22 UTC 2017. [ 216s] -- 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 Jun 29 23:39:06 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 29 Jun 2017 23:39:06 +0000 Subject: osmo-trx[master]: LimeSDR: set approximate tx offset value to make GSM work In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied215ca9e9d9c346c2a654f96785d1b87b075129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 29 23:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 29 Jun 2017 23:39:15 +0000 Subject: [MERGED] osmo-trx[master]: LimeSDR: set approximate tx offset value to make GSM work In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: LimeSDR: set approximate tx offset value to make GSM work ...................................................................... LimeSDR: set approximate tx offset value to make GSM work may be fine-tuned in the future Modified to match current master by Harald Welte. Change-Id: Ied215ca9e9d9c346c2a654f96785d1b87b075129 --- M Transceiver52M/UHDDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index a766ddc..9ab96f6 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -130,7 +130,7 @@ { std::make_tuple(UMTRX, 1, 1), { 2, 0.0, GSMRATE, 9.9692e-5, "UmTRX 1 SPS" } }, { std::make_tuple(UMTRX, 4, 1), { 2, 0.0, GSMRATE, 7.3846e-5, "UmTRX 4/1 Tx/Rx SPS"} }, { std::make_tuple(UMTRX, 4, 4), { 2, 0.0, GSMRATE, 5.1503e-5, "UmTRX 4 SPS" } }, - { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 16.5/GSMRATE, "STREAM/LimeSDR (4 SPS TX/RX)" } }, + { std::make_tuple(LIMESDR, 4, 4), { 1, GSMRATE*32, GSMRATE, 8.9e-5, "LimeSDR 4 SPS" } }, { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, }; -- To view, visit https://gerrit.osmocom.org/3072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied215ca9e9d9c346c2a654f96785d1b87b075129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Jun 29 23:59:18 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 29 Jun 2017 23:59:18 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: > I would actually vote for making SCHED_RR a default, preferrably > with an even higher priority (e.g. 10) than what we'd use as > osmo-bts-trx, as osmo-trx is even more important to schedule than > osmo-bts. What do you guys think? These settings can be very tricky. osmo-trx already sets SCHED_RR and priorities through the UHD priority interface. https://github.com/EttusResearch/uhd/blob/master/host/lib/utils/thread_priority.cpp But, importantly, the current settings were added years ago to be independent of underlying UHD libusb threads - which may not be ideal. UHD maintains a separate internal thread for driving libusb asynchronous I/O. That thread is indirectly controlled by the priority level at the time of construction - which is main() in osmo-trx. So this patch could perform better than the current priority settings. Does testing confirm that? -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 30 03:03:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:03:28 +0000 Subject: osmo-trx[master]: Add '-t' command line option to enable SCHED_RR In-Reply-To: References: Message-ID: Patch Set 1: Please see https://osmocom.org/issues/2344 for my test results. With this patch (and associated '-t 1') I can sustain a load of >= 100 on the system running osmo-trx + osmo-bts. Without the patch, it fails within seconds. Hence my argument to even make it default, and to use a even "stronger" (lover numeric, higher conceptual) priority than osmo-bts. And make osmo-bts also use SCHED_RR unconditionally. -- To view, visit https://gerrit.osmocom.org/3080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 30 03:05:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:05:25 +0000 Subject: osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Jun 30 03:05:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:05:36 +0000 Subject: osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Jun 30 03:05:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:05:46 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-trx: fix missing frame number in MEAS IND ...................................................................... osmo-bts-trx: fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-trx does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index a7bcd2c..3517787 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -528,7 +528,7 @@ void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, - float ber, float rssi) + float ber, float rssi, uint32_t fn) { memset(l1sap, 0, sizeof(*l1sap)); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_MPH_INFO, @@ -538,6 +538,7 @@ l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4); l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000); l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1); + l1sap->u.info.u.meas_ind.fn = fn; } int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, @@ -553,7 +554,7 @@ gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); - l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi); + l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn); return l1sap_up(trx, &l1sap); } diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 1864857..fdc40f2 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -69,7 +69,7 @@ int l1if_provision_transceiver(struct gsm_bts *bts); int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn); void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, float ta, - float ber, float rssi); + float ber, float rssi, uint32_t fn); int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint8_t chan_nr, int n_errors, int n_bits_total, float rssi, float toa); -- To view, visit https://gerrit.osmocom.org/2813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Fri Jun 30 03:05:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:05:52 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-litecell15: Fix missing frame number in MEAS IND ...................................................................... osmo-bts-litecell15: Fix missing frame number in MEAS IND The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. change process_meas_res() to properly include the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap) Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 71bb833..d6cffc9 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -901,7 +901,7 @@ } static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - GsmL1_MeasParam_t *m) + GsmL1_MeasParam_t *m, uint32_t fn) { struct osmo_phsap_prim l1sap; memset(&l1sap, 0, sizeof(l1sap)); @@ -912,6 +912,7 @@ l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming; l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100); l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); + l1sap.u.info.u.meas_ind.fn = fn; /* l1sap wants to take msgb ownership. However, as there is no * msg, it will msgb_free(l1sap.oph.msg == NULL) */ @@ -941,7 +942,7 @@ fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, &data_ind->measParam); + process_meas_res(trx, chan_nr, &data_ind->measParam, fn); if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm && data_ind->msgUnitParam.u8Size != 0) { -- To view, visit https://gerrit.osmocom.org/2861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Fri Jun 30 03:06:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:06:39 +0000 Subject: osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts 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 Jun 30 03:06:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:06:48 +0000 Subject: libosmo-abis[master]: osmo_ortp: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jun 30 03:06:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:06:54 +0000 Subject: [MERGED] libosmo-abis[master]: osmo_ortp: Add osmo_rtp_drop_frame API In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_ortp: Add osmo_rtp_drop_frame API ...................................................................... osmo_ortp: Add osmo_rtp_drop_frame API This API will be used by osmo-bts to maintain the sampling clock of the RTP socket whenever a frame should be sent but it is not available, for instance due to low quality of signal. Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 --- M include/osmocom/trau/osmo_ortp.h M src/trau/osmo_ortp.c 2 files changed, 23 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index 9eb176f..578b1cb 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -76,6 +76,7 @@ int osmo_rtp_socket_connect(struct osmo_rtp_socket *rs, const char *ip, uint16_t port); int osmo_rtp_socket_set_pt(struct osmo_rtp_socket *rs, int payload_type); int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); +int osmo_rtp_skipped_frame(struct osmo_rtp_socket *rs, unsigned int duration); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration); int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index b2ee040..c9480ff 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -436,6 +436,28 @@ return osmo_rtp_socket_fdreg(rs); } +/*! \brief Increment timestamp on a RTP socket without sending any packet + * \param[in] rs OsmoRTP socket + * \param[in] duration duration in number of RTP clock ticks + * + * Useful to keep the RTP internal clock up to date if an RTP frame should be + * send at a given time but no audio content is available. When next packet is + * sent, the receiver will see a different increase on the sequence number and + * the timestamp, and it should then take it as a synchronization point. For + * that same reason, it is advisable to enable the marker bit on the next RTP + * packet to be sent after calling this function. + * + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_skipped_frame(struct osmo_rtp_socket *rs, unsigned int duration) +{ + if (rs->flags & OSMO_RTP_F_DISABLED) + return 0; + + rs->tx_timestamp += duration; + return 0; +} + /*! \brief Send one RTP frame via a RTP socket * \param[in] rs OsmoRTP socket * \param[in] payload pointer to buffer with RTP payload data -- To view, visit https://gerrit.osmocom.org/3070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis 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 Fri Jun 30 03:07:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:07:21 +0000 Subject: libosmo-abis[master]: osmo_ortp.c: Duration of a RTP frame affects timestamp of th... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3083 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Jun 30 03:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:07:27 +0000 Subject: [MERGED] libosmo-abis[master]: osmo_ortp.c: Duration of a RTP frame affects timestamp of th... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_ortp.c: Duration of a RTP frame affects timestamp of the next one ...................................................................... osmo_ortp.c: Duration of a RTP frame affects timestamp of the next one Duration of an RTP frames dictates the timestamp used for the next frame, not for the one being sent now. It was done like this before to account for possible losses. Implementation wise, the duration was understood as "duration between last frame was sent and now when current one is sent". It makes more sense to use it as the duration in number of sampling ticks as described on the function documentation, specially now that we can account for extra time by means of osmo_rtp_skipped_frame. Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548 --- M src/trau/osmo_ortp.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c9480ff..c49a23d 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -496,9 +496,9 @@ return -ENOMEM; rtp_set_markbit(mblk, marker); - rs->tx_timestamp += duration; rc = rtp_session_sendm_with_ts(rs->sess, mblk, rs->tx_timestamp); + rs->tx_timestamp += duration; if (rc < 0) { /* no need to free() the mblk, as rtp_session_rtp_send() * unconditionally free()s the mblk even in case of -- To view, visit https://gerrit.osmocom.org/3083 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis 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 Jun 30 03:09:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:09:11 +0000 Subject: osmo-bts[master]: Revert "osmo-bts-sysmo: Include frame number in MEAS IND" In-Reply-To: References: Message-ID: Patch Set 2: might be useful to explain *why* it is being reverted. -- To view, visit https://gerrit.osmocom.org/3051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts 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 Jun 30 03:11:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:11:47 +0000 Subject: osmo-bts[master]: octphy: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3078/1/src/osmo-bts-octphy/l1_tch.c File src/osmo-bts-octphy/l1_tch.c: Line 201: rmsg = msgb_alloc_headroom(256, 128, "L1C-to-RTP"); L1C is L1 Control (channel activation, ...). L1P is L1 [data] primitive. L1C is thus wrong here and also in the LOGP above. -- To view, visit https://gerrit.osmocom.org/3078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 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: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 30 03:16:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 30 Jun 2017 03:16:03 +0000 Subject: osmo-bts[master]: sysmo: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3056/3/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: PS3, Line 992: 1sap->u.data.lqual_cb this is where/how we report linqQuality to the common part in l1sap. I think it would make a lot of sense to remove the "drop frames in case of bad link quality from the BTS-specific parts and move it into the code above l1sap. We'd have to add ber10k andlqual_cb to ph_tch_param, like we have it in ph_data_param already (libosmocore l1sap.h). -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 3 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 30 08:47:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 08:47:58 +0000 Subject: [MERGED] osmo-bts[master]: sysmo/tch.c: Clean up use of empty buffer In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: sysmo/tch.c: Clean up use of empty buffer ...................................................................... sysmo/tch.c: Clean up use of empty buffer Make code easier to read and avoid reading first byte of the buffer if size is 0. Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a --- M src/osmo-bts-sysmo/tch.c 1 file changed, 4 insertions(+), 3 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/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 475652e..a12b1a7 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -506,9 +506,7 @@ { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; - uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; - uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len, sid_first[9] = { 0 }; + uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 }; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -520,6 +518,9 @@ chan_nr); return -EINVAL; } + + payload_type = data_ind->msgUnitParam.u8Buffer[0]; + payload = data_ind->msgUnitParam.u8Buffer + 1; payload_len = data_ind->msgUnitParam.u8Size - 1; switch (payload_type) { -- To view, visit https://gerrit.osmocom.org/3055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a Gerrit-PatchSet: 3 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 Fri Jun 30 08:53:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 08:53:52 +0000 Subject: [MERGED] osmo-bts[master]: litecell15/tch.c: Clean up use of empty buffer In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: litecell15/tch.c: Clean up use of empty buffer ...................................................................... litecell15/tch.c: Clean up use of empty buffer Make code easier to read and avoid reading first byte of the buffer if size is 0. Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5 --- M src/osmo-bts-litecell15/tch.c 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index ffc1eb3..8bed695 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -361,9 +361,7 @@ { GsmL1_Prim_t *l1p = msgb_l1prim(l1p_msg); GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; - uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; - uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len, sid_first[9] = { 0 }; + uint8_t *payload, payload_type, payload_len, sid_first[9] = { 0 }; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -375,6 +373,9 @@ chan_nr); return -EINVAL; } + + payload_type = data_ind->msgUnitParam.u8Buffer[0]; + payload = data_ind->msgUnitParam.u8Buffer + 1; payload_len = data_ind->msgUnitParam.u8Size - 1; switch (payload_type) { -- To view, visit https://gerrit.osmocom.org/3076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5 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: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 09:19:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 09:19:00 +0000 Subject: osmo-bts[master]: octphy: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3078/1/src/osmo-bts-octphy/l1_tch.c File src/osmo-bts-octphy/l1_tch.c: Line 201: rmsg = msgb_alloc_headroom(256, 128, "L1C-to-RTP"); > L1C is L1 Control (channel activation, ...). L1P is L1 [data] primitive. L1 I actually copied it from l1_to_rtppayload_fr() & friends. I guess those need to be changed to L1P then too, I'll send another patch for that. -- To view, visit https://gerrit.osmocom.org/3078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 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: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 30 13:24:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 30 Jun 2017 13:24:20 +0000 Subject: [PATCH] osmo-pcu[master]: BSSGP: Use libosmocore for BVC-RESET In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3089 to look at the new patch set (#2). BSSGP: Use libosmocore for BVC-RESET Implement proper BVC RESET procedure by using libosmocore code to handle BVCI reset and initiate PTP BVC reset if necessary. Requires I9bf8f4dd784ccddbb9926492a85fff3293a0e913 in libosmocore. Related: OS#1638 Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 22 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/89/3089/2 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index d3c8491..437479b 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -325,14 +325,15 @@ struct bssgp_ud_hdr *budh = (struct bssgp_ud_hdr *) msgb_bssgph(msg); struct tlv_parsed tp; enum bssgp_pdu_type pdu_type = (enum bssgp_pdu_type) bgph->pdu_type; - uint16_t ns_bvci = msgb_bvci(msg); + enum gprs_bssgp_cause cause = BSSGP_CAUSE_OML_INTERV; + uint16_t ns_bvci = msgb_bvci(msg), nsei = msgb_nsei(msg); int data_len; int rc = 0; struct bssgp_bvc_ctx *bctx; if (pdu_type == BSSGP_PDUT_STATUS) /* Pass the message to the generic BSSGP parser, which handles - * STATUS message in either direction. */ + * STATUS and RESET messages in either direction. */ return bssgp_rcvmsg(msg); /* Identifiers from DOWN: NSEI, BVCI (both in msg->cb) */ @@ -349,6 +350,23 @@ rc = bssgp_tlv_parse(&tp, budh->data, data_len); } + if (pdu_type == BSSGP_PDUT_BVC_RESET) { + rc = bssgp_rcvmsg(msg); + if (ns_bvci != BVCI_SIGNALLING) + return rc; + + if (TLVP_PRES_LEN(&tp, BSSGP_IE_CAUSE, 1)) + cause = (enum gprs_bssgp_cause)*TLVP_VAL(&tp, BSSGP_IE_CAUSE); + else + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u BVC RESET without cause?!\n", nsei); + + rc = bssgp_tx_bvc_ptp_reset(nsei, cause); + if (rc < 0) + LOGP(DBSSGP, LOGL_ERROR, "NSEI=%u BVC PTP reset procedure failed: %d\n", nsei, rc); + + return rc; + } + /* look-up or create the BTS context for this BVC */ bctx = btsctx_by_bvci_nsei(ns_bvci, msgb_nsei(msg)); @@ -357,9 +375,8 @@ && pdu_type != BSSGP_PDUT_BVC_UNBLOCK_ACK && pdu_type != BSSGP_PDUT_PAGING_PS) { - LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU " - "type %s for unknown BVCI\n", msgb_nsei(msg), ns_bvci, - bssgp_pdu_str(pdu_type)); + LOGP(DBSSGP, LOGL_NOTICE, "NSEI=%u/BVCI=%u Rejecting PDU type %s for unknown BVCI\n", + nsei, ns_bvci, bssgp_pdu_str(pdu_type)); return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI, NULL, msg); } -- To view, visit https://gerrit.osmocom.org/3089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I718c949759688cb34ce6bcbb3da2092fcdfa6989 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 30 15:18:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 30 Jun 2017 15:18:33 +0000 Subject: [PATCH] osmo-bts[master]: OML: fill MO while handling attr. request Message-ID: Review at https://gerrit.osmocom.org/3090 OML: fill MO while handling attr. request Copy Obj, Class and TRX# into BTS' MO to properly distinguish between BTS-level and TRX-level attributes. Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Related: OS#2317 --- M src/common/oml.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/90/3090/1 diff --git a/src/common/oml.c b/src/common/oml.c index 8f23f82..e665e85 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1123,6 +1123,8 @@ ret = oml_ipa_set_attr(bts, msg); break; case NM_MT_GET_ATTR: + bts->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + bts->mo.obj_class = foh->obj_class; ret = oml_rx_get_attr(bts, msg); break; default: -- To view, visit https://gerrit.osmocom.org/3090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 30 15:27:51 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 30 Jun 2017 15:27:51 +0000 Subject: [PATCH] openbsc[master]: bsc_init: add logging for unhandled signals Message-ID: Review at https://gerrit.osmocom.org/3091 bsc_init: add logging for unhandled signals Change-Id: I0ddaec3b017d637027b0478ce3e137becbf25ea7 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/91/3091/1 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ead21b4..a382709 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -391,7 +391,7 @@ abis_nm_clear_queue(trx->bts); break; default: - break; + LOGP(DLMI, LOGL_ERROR, "Unhandled input signal %s\n", get_value_string(e1inp_signal_names, signal);); } return 0; -- To view, visit https://gerrit.osmocom.org/3091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ddaec3b017d637027b0478ce3e137becbf25ea7 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 30 15:31:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 30 Jun 2017 15:31:00 +0000 Subject: openbsc[master]: Fix BTS number in attribute requests In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/2868/1/openbsc/src/libbsc/bsc_init.c File openbsc/src/libbsc/bsc_init.c: Line 346: abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); > I think removing trx->nr makes a lot of sens. But for bts->nr, I'm not sur The classic E1 should not be affected by this at all: the calls to oml_nm_get_attr() were added specifically for OS#1614 "better identification of BTS model" so any changes to it should not have effect on classic E1 BTS which would most likely ignore it. -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Fri Jun 30 15:32:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 30 Jun 2017 15:32:12 +0000 Subject: openbsc[master]: Fix BTS number in attribute requests In-Reply-To: References: Message-ID: Patch Set 1: Also, if I understand 3GPP TS 52.021 ?9.3 correctly than we can't use BTS number in here. Am I mistaken? -- To view, visit https://gerrit.osmocom.org/2868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Jun 30 15:39:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 30 Jun 2017 15:39:52 +0000 Subject: [PATCH] openbsc[master]: bsc_init: add logging for unhandled signals In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3091 to look at the new patch set (#2). bsc_init: add logging for unhandled signals Change-Id: I0ddaec3b017d637027b0478ce3e137becbf25ea7 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/91/3091/2 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index ead21b4..265ed49 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -391,7 +391,7 @@ abis_nm_clear_queue(trx->bts); break; default: - break; + LOGP(DLMI, LOGL_ERROR, "Unhandled input signal %s\n", get_value_string(e1inp_signal_names, signal)); } return 0; -- To view, visit https://gerrit.osmocom.org/3091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0ddaec3b017d637027b0478ce3e137becbf25ea7 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 30 16:59:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 16:59:33 +0000 Subject: [PATCH] libosmocore[master]: l1sap.h: Add ber10k and lqual_cb to ph_tch_param Message-ID: Review at https://gerrit.osmocom.org/3092 l1sap.h: Add ber10k and lqual_cb to ph_tch_param These fields are required in osmo-bts to do low link quality checks in a generic way. Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82 --- M include/osmocom/gsm/l1sap.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/3092/1 diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 01f61ce..1bc1818 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -84,6 +84,8 @@ uint32_t fn; /*!< GSM Frame Number */ int8_t rssi; /*!< RSSI of received indication */ uint8_t marker; /*!< RTP Marker bit (speech onset indicator) */ + uint16_t ber10k; /*!< BER in units of 0.01% */ + int16_t lqual_cb; /* !< Link quality in centiBel */ }; /*! for PH-CONN.ind */ -- To view, visit https://gerrit.osmocom.org/3092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4ae20c22b881e94585dad710f17b9e37f77bf82 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:50 +0000 Subject: [PATCH] osmo-bts[master]: Allow passing low link quality buffers to upper layers 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/3056 to look at the new patch set (#4). Allow passing low link quality buffers to upper layers We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering events on the upper layer. With this change, the upper layer will increase correctly seq + ts for RTP. It will then send an RTP packet with only the header and no payload, which is not correct but at least we avoid drifting the RTP clock. Upcoming patch in the series solves this issue. This patch assumes that we are not lossing data events from the physical layer and that we receive an event every 20ms, even if the MS is not transmitting due to DTX. Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82 Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/common/pcu_sock.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 9 files changed, 49 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/3056/4 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 6373ba8..4e9c9e2 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -85,7 +85,8 @@ extern uint8_t gsmtap_sapi_acch; int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, - struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn); + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, + uint16_t ber10k, int16_t lqual_cb); #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 85d1dd1..076222b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -135,11 +135,12 @@ } int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, - struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn) + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, + uint16_t ber10k, int16_t lqual_cb) { struct osmo_phsap_prim *l1sap; - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", + LOGP(DL1P, LOGL_DEBUG, "%s Rx -> RTP: %s\n", gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); rmsg->l2h = rmsg->data; @@ -150,6 +151,8 @@ rmsg); l1sap->u.tch.chan_nr = chan_nr; l1sap->u.tch.fn = fn; + l1sap->u.tch.ber10k = ber10k; + l1sap->u.tch.lqual_cb = lqual_cb; return l1sap_up(trx, l1sap); } diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 2755048..a4ddc05 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -329,11 +330,18 @@ struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_data *data_ind; struct gsm_bts *bts = ts->trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d " "block=%d data=%s\n", is_ptcch, arfcn, block_nr, osmo_hexdump(data, len)); + if (lqual / 10 < btsb->min_qual_norm) { + LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n", + lqual, btsb->min_qual_norm); + return 0; + } + msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_IND, bts->nr); if (!msg) return -ENOMEM; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index bd9e003..66aa21a 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -923,7 +923,6 @@ struct msgb *l1p_msg) { struct gsm_bts_trx *trx = lc15l1_hdl_trx(fl1); - struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct osmo_phsap_prim *l1sap; uint32_t fn; @@ -943,12 +942,6 @@ link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a29733f..c61712f 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -369,9 +369,12 @@ return -EAGAIN; if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -459,8 +462,9 @@ } if (rmsg) - return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->u32Fn); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); return 0; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 427acdf..5785b9a 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1050,8 +1050,6 @@ process_meas_res(trx, chan_nr, fn, data_ind->Data.ulDataLength, &data_ind->MeasurementInfo); - /* FIXME: check min_qual_norm! */ - DEBUGP(DL1C, "Rx PH-DATA.ind %s: %s data_len:%d \n", get_value_string(octphy_l1sapi_names, sapi), osmo_hexdump(data_ind->Data.abyDataContent, diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 79bf245..38fb9fb 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -188,16 +188,25 @@ uint32_t payload_type = data_ind->Data.ulPayloadType; uint8_t *payload = data_ind->Data.abyDataContent; + uint16_t b_total = data_ind->MeasurementInfo.usBERTotalBitCnt; + uint16_t b_error = data_ind->MeasurementInfo.usBERCnt; + uint16_t ber10k = b_total ? BER_10K * b_error / b_total : 0; + int16_t lqual_cb = 0; /* FIXME: check min_qual_norm! */ + uint8_t payload_len; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; if (data_ind->Data.ulDataLength < 1) { - LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->Data.ulFrameNumber, + ber10k, lqual_cb); } + payload_len = data_ind->Data.ulDataLength; switch (payload_type) { @@ -255,7 +264,8 @@ if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->Data.ulFrameNumber); + data_ind->Data.ulFrameNumber, + ber10k, lqual_cb); return 0; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 837fc5c..299a743 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -923,7 +923,6 @@ struct msgb *l1p_msg) { struct gsm_bts_trx *trx = femtol1_hdl_trx(fl1); - struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); uint8_t chan_nr, link_id; struct msgb *sap_msg; struct osmo_phsap_prim *l1sap; @@ -942,12 +941,6 @@ link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, fn, &data_ind->measParam); - - if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm - && data_ind->msgUnitParam.u8Size != 0) { - msgb_free(l1p_msg); - return 0; - } DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), @@ -974,7 +967,7 @@ l1sap->u.data.chan_nr = chan_nr; l1sap->u.data.fn = fn; l1sap->u.data.rssi = (int8_t) (data_ind->measParam.fRssi); - if (!pcu_direct) { + if (!pcu_direct) { /* FIXME: if pcu_direct=1, then this is not set, what to do in pcu_tx_data_ind() in this case ?*/ l1sap->u.data.ber10k = data_ind->measParam.fBer * 10000; l1sap->u.data.ta_offs_qbits = data_ind->measParam.i16BurstTiming; l1sap->u.data.lqual_cb = data_ind->measParam.fLinkQuality * 10; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 6333d19..b65628f 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -514,9 +514,12 @@ return -EAGAIN; if (data_ind->msgUnitParam.u8Size < 1) { - LOGP(DL1C, LOGL_ERROR, "chan_nr %d Rx Payload size 0\n", - chan_nr); - return -EINVAL; + LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr); + /* Push empty payload to upper layers */ + rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -605,11 +608,13 @@ return 0; rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); break; + /* FIXME: what about GsmL1_TchPlType_Amr_SidBad? not well documented. */ } if (rmsg) - return add_l1sap_header(trx, rmsg, lchan, chan_nr, - data_ind->u32Fn); + return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, + data_ind->measParam.fBer * 10000, + data_ind->measParam.fLinkQuality * 10); return 0; -- To view, visit https://gerrit.osmocom.org/3056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5df8940fab833eb4e3ed851880b66987d356031 Gerrit-PatchSet: 4 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 Fri Jun 30 17:13:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:50 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: fn_ms_adj: Add err logging and always return GSM_RT... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3084 to look at the new patch set (#2). l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION After latest changes, l2 expects to receive an event for every TCH frame, that is, no TCH frame event should be lost on that layer. We should now then be safe returning always GSM_RTP_DURATION. The code which used to calculate the variable duration is left there to assert that indeed we are not longer having this kind of issues. Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 --- M src/common/l1sap.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/84/3084/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 410e1d3..7b7c15e 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -87,10 +88,6 @@ { uint32_t samples_passed, r; - /* don't adjust duration when DTX is not enabled */ - if (lchan->ts->trx->bts->dtxu == GSM48_DTX_SHALL_NOT_BE_USED) - return GSM_RTP_DURATION; - if (lchan->tch.last_fn != LCHAN_FN_DUMMY) { /* 12/13 frames usable for audio in TCH, 160 samples per RTP packet, @@ -100,7 +97,11 @@ GSM_RTP_DURATION */ r = samples_passed + GSM_RTP_DURATION / 2; r -= r % GSM_RTP_DURATION; - return r; + + if (r != GSM_RTP_DURATION) + LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with lower layer:" + " %"PRIu32" vs %d (%"PRIu32"->%"PRIu32")\n", + r, GSM_RTP_DURATION, lchan->tch.last_fn, fn); } return GSM_RTP_DURATION; } -- To view, visit https://gerrit.osmocom.org/3084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9d112c6db142be138e71393e77129e6d069d9973 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:50 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.c: Avoid sending RTP frame with empty payload 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/3071 to look at the new patch set (#5). l1sap.c: Avoid sending RTP frame with empty payload Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1 Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc --- M src/common/l1sap.c 1 file changed, 26 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/3071/5 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 4a7e2c7..410e1d3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1061,6 +1061,7 @@ struct gsm_lchan *lchan; uint8_t chan_nr; uint32_t fn; + struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); chan_nr = tch_ind->chan_nr; fn = tch_ind->fn; @@ -1076,22 +1077,33 @@ msgb_pull(msg, sizeof(*l1sap)); - /* hand msg to RTP code for transmission */ - if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); - - /* if loopback is enabled, also queue received RTP data */ - if (lchan->loopback) { - /* make sure the queue doesn't get too long */ - queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); - /* add new frame to queue */ - msgb_enqueue(&lchan->dl_tch_queue, msg); - /* Return 1 to signal that we're still using msg and it should not be freed */ - return 1; + /* Low level layers always call us when TCH content is expected, even if + * the content is not available due to decoding issues. Content not + * available is expected as empty payload. We also check if quality is + * good enough. */ + if (msg->len && tch_ind->lqual_cb / 10 >= btsb->min_qual_norm) { + /* hand msg to RTP code for transmission */ + if (lchan->abis_ip.rtp_socket) + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker); + /* if loopback is enabled, also queue received RTP data */ + if (lchan->loopback) { + /* make sure the queue doesn't get too long */ + queue_limit_to(gsm_lchan_name(lchan), &lchan->dl_tch_queue, 1); + /* add new frame to queue */ + msgb_enqueue(&lchan->dl_tch_queue, msg); + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; + } + /* Only clear the marker bit once we have sent a RTP packet with it */ + lchan->rtp_tx_marker = false; + } else { + DEBUGP(DL1P, "Skipping RTP frame with lost payload\n"); + if (lchan->abis_ip.rtp_socket) + osmo_rtp_skipped_frame(lchan->abis_ip.rtp_socket, fn_ms_adj(fn, lchan)); + lchan->rtp_tx_marker = true; } - lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/3071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts 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 Jun 30 17:13:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:52 +0000 Subject: [PATCH] osmo-bts[master]: sysmo/tch.c: Use L1P instead of L1C for logging and allocation Message-ID: Review at https://gerrit.osmocom.org/3093 sysmo/tch.c: Use L1P instead of L1C for logging and allocation Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b --- M src/osmo-bts-sysmo/tch.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/3093/1 diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a12b1a7..6333d19 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -58,7 +58,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -113,7 +113,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -200,12 +200,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -239,7 +239,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -269,7 +269,7 @@ uint8_t amr_if2_len = payload_len - 2; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -296,7 +296,7 @@ else if (cmr_idx >= amr_mrc->num_modes || cmr_idx > GsmL1_AmrCodecMode_Unset) { /* Make sure the CMR of the phone is in the active codec set */ - LOGP(DL1C, LOGL_NOTICE, "L1->RTP: overriding CMR IDX %u\n", cmr_idx); + LOGP(DL1P, LOGL_NOTICE, "L1->RTP: overriding CMR IDX %u\n", cmr_idx); cmr = AMR_CMR_NONE; } else { cmr = amr_mrc->bts_mode[cmr_idx].mode; @@ -552,31 +552,31 @@ case GsmL1_TchPlType_Amr_SidFirstP1: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstP2: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidUpdateInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " "(%d bytes)\n", payload_len); break; default: - LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); break; @@ -614,7 +614,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:52 +0000 Subject: [PATCH] osmo-bts[master]: litecell15/tch.c: Use L1P instead of L1C for logging and all... Message-ID: Review at https://gerrit.osmocom.org/3094 litecell15/tch.c: Use L1P instead of L1C for logging and allocation Change-Id: Iecda49dc7e6005acfdaf4bd03599c26ce4bccc73 --- M src/osmo-bts-litecell15/tch.c 1 file changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/3094/1 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 8bed695..c82d6f8 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -61,7 +61,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -95,7 +95,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -126,12 +126,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -155,7 +155,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -172,7 +172,7 @@ uint8_t amr_if2_len = payload_len - 2; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -405,31 +405,31 @@ case GsmL1_TchPlType_Amr_SidFirstP1: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstP2: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidFirstInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " "(%d bytes)\n", payload_len); break; case GsmL1_TchPlType_Amr_SidUpdateInH: if (lchan->type != GSM_LCHAN_TCH_H) goto err_payload_match; lchan->rtp_tx_marker = true; - LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + LOGP(DL1P, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " "(%d bytes)\n", payload_len); break; default: - LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); break; @@ -465,7 +465,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %s incompatible with lchan\n", gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecda49dc7e6005acfdaf4bd03599c26ce4bccc73 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:52 +0000 Subject: [PATCH] osmo-bts[master]: octphy/tch.c: Use L1P instead of L1C for logging and allocation Message-ID: Review at https://gerrit.osmocom.org/3095 octphy/tch.c: Use L1P instead of L1C for logging and allocation Change-Id: I8593e9fcd94f1a42f1e09f079d3d40f07bd56307 --- M src/osmo-bts-octphy/l1_tch.c 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/3095/1 diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index 5693313..79bf245 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -43,7 +43,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -93,7 +93,7 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; @@ -132,12 +132,12 @@ struct msgb *msg; uint8_t *cur; - msg = msgb_alloc_headroom(1024, 128, "L1C-to-RTP"); + msg = msgb_alloc_headroom(1024, 128, "L1P-to-RTP"); if (!msg) return NULL; if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "L1 HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return NULL; } @@ -164,7 +164,7 @@ { if (payload_len != GSM_HR_BYTES) { - LOGP(DL1C, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", + LOGP(DL1P, LOGL_ERROR, "RTP HR frame length %u != expected %u\n", payload_len, GSM_HR_BYTES); return 0; } @@ -217,13 +217,13 @@ goto err_payload_match; break; default: - LOGP(DL1C, LOGL_NOTICE, + LOGP(DL1P, LOGL_NOTICE, "%s Rx Payload Type %d is unsupported\n", gsm_lchan_name(lchan), payload_type); break; } - LOGP(DL1C, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", + LOGP(DL1P, LOGL_DEBUG, "%s Rx codec frame (%u): %s\n", gsm_lchan_name(lchan), payload_len, osmo_hexdump(payload, payload_len)); @@ -247,7 +247,7 @@ rmsg = l1_to_rtppayload_amr(payload, payload_len, &lchan->tch.amr_mr); #else - LOGP(DL1C, LOGL_ERROR, "OctPHY only supports FR!\n"); + LOGP(DL1P, LOGL_ERROR, "OctPHY only supports FR!\n"); return -1; #endif break; @@ -260,7 +260,7 @@ return 0; err_payload_match: - LOGP(DL1C, LOGL_ERROR, + LOGP(DL1P, LOGL_ERROR, "%s Rx Payload Type %d incompatible with lchan\n", gsm_lchan_name(lchan), payload_type); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8593e9fcd94f1a42f1e09f079d3d40f07bd56307 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:52 +0000 Subject: [PATCH] osmo-bts[master]: Fix annoying trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/3096 Fix annoying trailing whitespace This whitespace keeps being automatically fixed by editor, polluting my patches. Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a --- M src/common/pcu_sock.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/oml.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_if.c 5 files changed, 16 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/3096/1 diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 1ae6cb6..2755048 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -74,8 +74,8 @@ return NULL; msgb_put(msg, sizeof(struct gsm_pcu_if)); pcu_prim = (struct gsm_pcu_if *) msg->data; - pcu_prim->msg_type = msg_type; - pcu_prim->bts_nr = bts_nr; + pcu_prim->msg_type = msg_type; + pcu_prim->bts_nr = bts_nr; return msg; } @@ -566,7 +566,7 @@ struct gsm_bts_trx *trx; struct gsm_lchan *lchan; - LOGP(DPCU, LOGL_INFO, "%s request received: TRX=%d TX=%d\n", + LOGP(DPCU, LOGL_INFO, "%s request received: TRX=%d TX=%d\n", (act_req->activate) ? "Activate" : "Deactivate", act_req->trx_nr, act_req->ts_nr); diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d6cffc9..bd9e003 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -2,7 +2,7 @@ /* Copyright (C) 2015 by Yves Godin * Copyright (C) 2016 by Harald Welte - * + * * Based on sysmoBTS: * (C) 2011-2014 by Harald Welte * (C) 2014 by Holger Hans Peter Freyther @@ -1482,21 +1482,21 @@ fl1h->hw_info.ver_minor = rc; rc = lc15bts_option_get(LC15BTS_OPTION_BAND); - if (rc < 0) + if (rc < 0) return rc; switch (rc) { - case LC15BTS_BAND_850: - fl1h->hw_info.band_support = GSM_BAND_850; + case LC15BTS_BAND_850: + fl1h->hw_info.band_support = GSM_BAND_850; break; - case LC15BTS_BAND_900: - fl1h->hw_info.band_support = GSM_BAND_900; + case LC15BTS_BAND_900: + fl1h->hw_info.band_support = GSM_BAND_900; break; - case LC15BTS_BAND_1800: - fl1h->hw_info.band_support = GSM_BAND_1800; + case LC15BTS_BAND_1800: + fl1h->hw_info.band_support = GSM_BAND_1800; break; - case LC15BTS_BAND_1900: - fl1h->hw_info.band_support = GSM_BAND_1900; + case LC15BTS_BAND_1900: + fl1h->hw_info.band_support = GSM_BAND_1900; break; default: return -1; @@ -1576,4 +1576,3 @@ return 0; } - diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 5c53feb..d9f613d 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1,5 +1,5 @@ /* Copyright (C) 2015 by Yves Godin - * + * * Based on sysmoBTS: * (C) 2011 by Harald Welte * (C) 2013-2014 by Holger Hans Peter Freyther diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index c82d6f8..a29733f 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -1,7 +1,7 @@ /* Traffic channel support for NuRAN Wireless Litecell 1.5 BTS L1 */ /* Copyright (C) 2015 by Yves Godin - * + * * Based on sysmoBTS: * (C) 2011-2012 by Harald Welte * diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8b31630..427acdf 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1103,7 +1103,7 @@ l1sap->u.data.ber10k = b_total ? BER_10K * b_error / b_total : 0; /* FIXME::burst timing in 1x but PCU is expecting 4X */ - l1sap->u.data.ta_offs_qbits = (data_ind->MeasurementInfo.sBurstTiming * 4); + l1sap->u.data.ta_offs_qbits = (data_ind->MeasurementInfo.sBurstTiming * 4); snr = data_ind->MeasurementInfo.sSNRDb; /* FIXME: better converion formulae for SnR -> C / I? l1sap->u.data.lqual_cb = (snr ? snr : (snr - 65536)) * 10 / 256; -- To view, visit https://gerrit.osmocom.org/3096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:53 +0000 Subject: [PATCH] osmo-bts[master]: sysmo, litecell15: Make sure all TCH events are triggered Message-ID: Review at https://gerrit.osmocom.org/3097 sysmo, litecell15: Make sure all TCH events are triggered Change-Id: Ie674c7ec40838af36308c6998f227fa452ace4b4 --- M src/osmo-bts-litecell15/oml.c M src/osmo-bts-sysmo/oml.c 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/3097/1 diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index d9f613d..7b728f9 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1030,6 +1030,11 @@ case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: lchan2lch_par(lch_par, lchan); + /* + * Be sure that every packet is received, even if it + * fails. In this case the length might be lower or 0. + */ + act_req->fBFILevel = -200.0f; break; case GsmL1_Sapi_Ptcch: lch_par->ptcch.u8Bsic = lchan->ts->trx->bts->bsic; diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index e1264af..505a457 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1047,6 +1047,11 @@ case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: lchan2lch_par(lch_par, lchan); + /* + * Be sure that every packet is received, even if it + * fails. In this case the length might be lower or 0. + */ + act_req->fBFILevel = -200.0f; break; case GsmL1_Sapi_Ptcch: lch_par->ptcch.u8Bsic = lchan->ts->trx->bts->bsic; -- To view, visit https://gerrit.osmocom.org/3097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie674c7ec40838af36308c6998f227fa452ace4b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:13:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:13:53 +0000 Subject: [PATCH] osmo-bts[master]: Log fn across different layers Message-ID: Review at https://gerrit.osmocom.org/3098 Log fn across different layers This commit also fixes a missing end of line in the log output of handle_ph_data_ind Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 --- M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/3098/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 076222b..4a7e2c7 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -963,8 +963,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d fn=%"PRIu32"\n", + g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id, fn); if (ts_is_pdch(&trx->ts[tn])) { lchan = get_lchan_by_chan_nr(trx, chan_nr); @@ -1067,8 +1067,8 @@ gsm_fn2gsmtime(&g_time, fn); - DEBUGP(DL1P, "Rx TCH.ind %02u/%02u/%02u chan_nr=%d\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Rx TCH.ind %02u/%02u/%02u chan_nr=%d fn=%"PRIu32"\n", + g_time.t1, g_time.t2, g_time.t3, chan_nr, fn); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); if (!lchan) diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 66aa21a..1880db7 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -943,9 +943,9 @@ process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - DEBUGP(DL1C, "Rx PH-DATA.ind %s (hL2 %08x): %s", + DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x fn %"PRIu32"): %s\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), - (uint32_t)data_ind->hLayer2, + (uint32_t)data_ind->hLayer2, fn, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 299a743..d96e780 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -942,9 +943,9 @@ process_meas_res(trx, chan_nr, fn, &data_ind->measParam); - DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x): %s", + DEBUGP(DL1P, "Rx PH-DATA.ind %s (hL2 %08x fn %"PRIu32"): %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi), - data_ind->hLayer2, + data_ind->hLayer2, fn, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); -- To view, visit https://gerrit.osmocom.org/3098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I049f58d51333d3590361db5c0105e6899a862af6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:15:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:15:25 +0000 Subject: [ABANDON] osmo-bts[master]: litecell15: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: litecell15: Allow passing low quality buffers to upper layers ...................................................................... Abandoned Abandon, all hw specific commits are merged into the same commit because on the new version there's a generic API change required. -- To view, visit https://gerrit.osmocom.org/3077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I3aba5949ce2ecb2ee3d8a8e57a3e6b2108691160 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 30 17:15:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 30 Jun 2017 17:15:32 +0000 Subject: [ABANDON] osmo-bts[master]: octphy: Allow passing low quality buffers to upper layers In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: octphy: Allow passing low quality buffers to upper layers ...................................................................... Abandoned Abandon, all hw specific commits are merged into the same commit because on the new version there's a generic API change required. -- To view, visit https://gerrit.osmocom.org/3078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I02bf4bca041fccf96fe2986480251f96248ce2d1 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: Pau Espin Pedrol